Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _BIB_GENERAL_HXX
21 : #define _BIB_GENERAL_HXX
22 :
23 : #include <com/sun/star/awt/XFocusListener.hpp>
24 : #include <com/sun/star/awt/XControlContainer.hpp>
25 : #include <com/sun/star/form/XBoundComponent.hpp>
26 : #include <com/sun/star/sdbc/XRowSetListener.hpp>
27 : #include <svtools/stdctrl.hxx>
28 :
29 : #include <vcl/lstbox.hxx>
30 : #include <vcl/group.hxx>
31 : #include <svtools/svmedit.hxx>
32 : #include <vcl/tabpage.hxx>
33 : #include <vcl/combobox.hxx>
34 : #include <vcl/scrbar.hxx>
35 : #include <cppuhelper/implbase1.hxx> // helper for implementations
36 : #include "bibshortcuthandler.hxx"
37 :
38 :
39 : class BibDataManager;
40 : #define TYPE_COUNT 22
41 : #define FIELD_COUNT 31
42 :
43 : typedef cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > BibGeneralPageBaseClass;
44 :
45 : class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
46 : {
47 : Window aControlParentWin;
48 : FixedText aIdentifierFT;
49 : FixedText aAuthTypeFT;
50 : FixedText aYearFT;
51 :
52 : FixedText aAuthorFT;
53 : FixedText aTitleFT;
54 :
55 : FixedText aPublisherFT;
56 : FixedText aAddressFT;
57 : FixedText aISBNFT;
58 :
59 : FixedText aChapterFT;
60 : FixedText aPagesFT;
61 : FixedLine aFirstFL;
62 :
63 : FixedText aEditorFT;
64 : FixedText aEditionFT;
65 :
66 : FixedText aBooktitleFT;
67 : FixedText aVolumeFT;
68 : FixedText aHowpublishedFT;
69 :
70 : FixedText aOrganizationsFT;
71 : FixedText aInstitutionFT;
72 : FixedText aSchoolFT;
73 :
74 : FixedText aReportTypeFT;
75 : FixedText aMonthFT;
76 : FixedLine aSecondFL;
77 :
78 : FixedText aJournalFT;
79 : FixedText aNumberFT;
80 : FixedText aSeriesFT;
81 :
82 : FixedText aAnnoteFT;
83 : FixedText aNoteFT;
84 : FixedText aURLFT;
85 : FixedLine aThirdFL;
86 :
87 : FixedText aCustom1FT;
88 : FixedText aCustom2FT;
89 : FixedText aCustom3FT;
90 : FixedText aCustom4FT;
91 : FixedText aCustom5FT;
92 :
93 : ScrollBar aHoriScroll;
94 : ScrollBar aVertScroll;
95 :
96 : FixedText* aFixedTexts[ FIELD_COUNT ];
97 : sal_Int16 nFT2CtrlMap[ FIELD_COUNT ];
98 :
99 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
100 : aControls[ FIELD_COUNT ];
101 :
102 : Size aStdSize;
103 : Point aBasePos;
104 :
105 : String aBibTypeArr[ TYPE_COUNT ];
106 : String sErrorPrefix;
107 : String sTableErrorString;
108 :
109 : String sTypeColumnName;
110 :
111 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
112 : xCtrlContnr;
113 :
114 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
115 : xMgr;
116 :
117 : ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
118 : xCurrentBoundComponent;
119 :
120 : ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
121 : xLBModel;
122 :
123 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >
124 : xPosListener;
125 :
126 :
127 : BibDataManager* pDatMan;
128 :
129 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
130 : AddXControl( const String& rName, Point aPos, Size aSize, const rtl::OString& sHelpId,
131 : sal_Int16& rIndex );
132 :
133 : void AddControlWithError( const rtl::OUString& rColumnName, const Point& rPos,
134 : const Size& rSize, String& rErrorString, String aColumnUIName,
135 : const rtl::OString& sHelpId, sal_uInt16 nIndexInFTArray );
136 :
137 : void AdjustScrollbars();
138 :
139 : DECL_LINK( ScrollHdl, ScrollBar* );
140 :
141 : protected:
142 : virtual void Resize();
143 : void InitFixedTexts( void ); // create mnemonics and set text an all fixed texts
144 :
145 : public:
146 : BibGeneralPage(Window* pParent, BibDataManager* pDatMan);
147 : virtual ~BibGeneralPage();
148 :
149 : inline const String& GetErrorString() const;
150 :
151 : inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >&
152 : GetTypeListBoxModel() const;
153 : inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >&
154 : GetControlContainer() const;
155 :
156 : inline BibDataManager* GetDataManager();
157 :
158 : void CommitActiveControl();
159 :
160 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException );
161 :
162 : void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException );
163 : void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException );
164 :
165 : void RemoveListeners();
166 :
167 : virtual void GetFocus();
168 :
169 : virtual sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); // returns true, if key was handled
170 : };
171 :
172 :
173 0 : inline const String& BibGeneralPage::GetErrorString() const
174 : {
175 0 : return sTableErrorString;
176 : }
177 :
178 : inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >&
179 0 : BibGeneralPage::GetTypeListBoxModel() const
180 : {
181 0 : return xLBModel;
182 : }
183 :
184 : inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >&
185 0 : BibGeneralPage::GetControlContainer() const
186 : {
187 0 : return xCtrlContnr;
188 : }
189 :
190 0 : inline BibDataManager* BibGeneralPage::GetDataManager()
191 : {
192 0 : return pDatMan;
193 : }
194 :
195 : #endif
196 :
197 :
198 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|