1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: general.hxx,v $
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>
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>
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"
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
;
71 FixedText aPublisherFT
;
82 FixedText aBooktitleFT
;
84 FixedText aHowpublishedFT
;
86 FixedText aOrganizationsFT
;
87 FixedText aInstitutionFT
;
90 FixedText aReportTypeFT
;
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
];
121 String aBibTypeArr
[ TYPE_COUNT
];
123 String sTableErrorString
;
125 String sTypeColumnName
;
127 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>
130 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
133 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>
134 xCurrentBoundComponent
;
136 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>
139 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSetListener
>
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
,
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
* );
158 virtual void Resize();
159 void InitFixedTexts( void ); // create mnemonics and set text an all fixed texts
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
200 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>&
201 BibGeneralPage::GetControlContainer() const
206 inline BibDataManager
* BibGeneralPage::GetDataManager()