update dev300-m58
[ooovba.git] / extensions / source / bibliography / general.hxx
blobb179582650531eea44beeb2d7209f53d21f3b677
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: general.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BIB_GENERAL_HXX
32 #define _BIB_GENERAL_HXX
34 #include <com/sun/star/awt/XFocusListener.hpp>
35 #include <com/sun/star/awt/XControlContainer.hpp>
36 //#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
37 //#include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 //#endif
39 #include <com/sun/star/form/XBoundComponent.hpp>
40 #include <com/sun/star/sdbc/XRowSetListener.hpp>
41 #include <svtools/stdctrl.hxx>
43 #ifndef _LSTBOX_HXX //autogen
44 #include <vcl/lstbox.hxx>
45 #endif
46 #include <vcl/group.hxx>
47 #include <svtools/svmedit.hxx>
48 #include <vcl/tabpage.hxx>
49 #include <vcl/combobox.hxx>
50 #include <vcl/scrbar.hxx>
51 #include <cppuhelper/implbase1.hxx> // helper for implementations
52 #include "bibshortcuthandler.hxx"
55 class BibDataManager;
56 #define TYPE_COUNT 22
57 #define FIELD_COUNT 31
59 typedef cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > BibGeneralPageBaseClass;
61 class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
63 Window aControlParentWin;
64 FixedText aIdentifierFT;
65 FixedText aAuthTypeFT;
66 FixedText aYearFT;
68 FixedText aAuthorFT;
69 FixedText aTitleFT;
71 FixedText aPublisherFT;
72 FixedText aAddressFT;
73 FixedText aISBNFT;
75 FixedText aChapterFT;
76 FixedText aPagesFT;
77 FixedLine aFirstFL;
79 FixedText aEditorFT;
80 FixedText aEditionFT;
82 FixedText aBooktitleFT;
83 FixedText aVolumeFT;
84 FixedText aHowpublishedFT;
86 FixedText aOrganizationsFT;
87 FixedText aInstitutionFT;
88 FixedText aSchoolFT;
90 FixedText aReportTypeFT;
91 FixedText aMonthFT;
92 FixedLine aSecondFL;
94 FixedText aJournalFT;
95 FixedText aNumberFT;
96 FixedText aSeriesFT;
98 FixedText aAnnoteFT;
99 FixedText aNoteFT;
100 FixedText aURLFT;
101 FixedLine aThirdFL;
103 FixedText aCustom1FT;
104 FixedText aCustom2FT;
105 FixedText aCustom3FT;
106 FixedText aCustom4FT;
107 FixedText aCustom5FT;
109 ScrollBar aHoriScroll;
110 ScrollBar aVertScroll;
112 FixedText* aFixedTexts[ FIELD_COUNT ];
113 sal_Int16 nFT2CtrlMap[ FIELD_COUNT ];
115 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
116 aControls[ FIELD_COUNT ];
118 Size aStdSize;
119 Point aBasePos;
121 String aBibTypeArr[ TYPE_COUNT ];
122 String sErrorPrefix;
123 String sTableErrorString;
125 String sTypeColumnName;
127 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
128 xCtrlContnr;
130 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
131 xMgr;
133 ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
134 xCurrentBoundComponent;
136 ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
137 xLBModel;
139 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >
140 xPosListener;
143 BibDataManager* pDatMan;
145 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
146 AddXControl( const String& rName, Point aPos, Size aSize, sal_uInt16 nHelpId,
147 sal_Int16& rIndex );
149 void AddControlWithError( const rtl::OUString& rColumnName, const Point& rPos,
150 const Size& rSize, String& rErrorString, String aColumnUIName,
151 sal_uInt16 nHelpId, sal_uInt16 nIndexInFTArray );
153 void AdjustScrollbars();
155 DECL_LINK( ScrollHdl, ScrollBar* );
157 protected:
158 virtual void Resize();
159 void InitFixedTexts( void ); // create mnemonics and set text an all fixed texts
161 public:
162 BibGeneralPage(Window* pParent, BibDataManager* pDatMan);
163 virtual ~BibGeneralPage();
165 inline const String& GetErrorString() const;
167 inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >&
168 GetTypeListBoxModel() const;
169 inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >&
170 GetControlContainer() const;
172 inline BibDataManager* GetDataManager();
174 void CommitActiveControl();
176 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException );
178 void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException );
179 void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException );
181 void RemoveListeners();
183 virtual void GetFocus();
185 virtual BOOL HandleShortCutKey( const KeyEvent& rKeyEvent ); // returns true, if key was handled
189 inline const String& BibGeneralPage::GetErrorString() const
191 return sTableErrorString;
194 inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >&
195 BibGeneralPage::GetTypeListBoxModel() const
197 return xLBModel;
200 inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >&
201 BibGeneralPage::GetControlContainer() const
203 return xCtrlContnr;
206 inline BibDataManager* BibGeneralPage::GetDataManager()
208 return pDatMan;
211 #endif