1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _BIB_GENERAL_HXX
30 #define _BIB_GENERAL_HXX
32 #include <com/sun/star/awt/XFocusListener.hpp>
33 #include <com/sun/star/awt/XControlContainer.hpp>
34 #include <com/sun/star/form/XBoundComponent.hpp>
35 #include <com/sun/star/sdbc/XRowSetListener.hpp>
36 #include <svtools/stdctrl.hxx>
38 #include <vcl/lstbox.hxx>
39 #include <vcl/group.hxx>
40 #include <svtools/svmedit.hxx>
41 #include <vcl/tabpage.hxx>
42 #include <vcl/combobox.hxx>
43 #include <vcl/scrbar.hxx>
44 #include <cppuhelper/implbase1.hxx> // helper for implementations
45 #include "bibshortcuthandler.hxx"
50 #define FIELD_COUNT 31
52 typedef cppu::WeakAggImplHelper1
< ::com::sun::star::awt::XFocusListener
> BibGeneralPageBaseClass
;
54 class BibGeneralPage
: public BibGeneralPageBaseClass
, public BibTabPage
56 Window aControlParentWin
;
57 FixedText aIdentifierFT
;
58 FixedText aAuthTypeFT
;
64 FixedText aPublisherFT
;
75 FixedText aBooktitleFT
;
77 FixedText aHowpublishedFT
;
79 FixedText aOrganizationsFT
;
80 FixedText aInstitutionFT
;
83 FixedText aReportTypeFT
;
100 FixedText aCustom5FT
;
102 ScrollBar aHoriScroll
;
103 ScrollBar aVertScroll
;
105 FixedText
* aFixedTexts
[ FIELD_COUNT
];
106 sal_Int16 nFT2CtrlMap
[ FIELD_COUNT
];
108 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
>
109 aControls
[ FIELD_COUNT
];
114 String aBibTypeArr
[ TYPE_COUNT
];
116 String sTableErrorString
;
118 String sTypeColumnName
;
120 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>
123 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
126 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>
127 xCurrentBoundComponent
;
129 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>
132 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSetListener
>
136 BibDataManager
* pDatMan
;
138 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>
139 AddXControl( const String
& rName
, Point aPos
, Size aSize
, const rtl::OString
& sHelpId
,
142 void AddControlWithError( const rtl::OUString
& rColumnName
, const Point
& rPos
,
143 const Size
& rSize
, String
& rErrorString
, String aColumnUIName
,
144 const rtl::OString
& sHelpId
, sal_uInt16 nIndexInFTArray
);
146 void AdjustScrollbars();
148 DECL_LINK( ScrollHdl
, ScrollBar
* );
151 virtual void Resize();
152 void InitFixedTexts( void ); // create mnemonics and set text an all fixed texts
155 BibGeneralPage(Window
* pParent
, BibDataManager
* pDatMan
);
156 virtual ~BibGeneralPage();
158 inline const String
& GetErrorString() const;
160 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>&
161 GetTypeListBoxModel() const;
162 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>&
163 GetControlContainer() const;
165 inline BibDataManager
* GetDataManager();
167 void CommitActiveControl();
169 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw( com::sun::star::uno::RuntimeException
);
171 void SAL_CALL
focusGained( const ::com::sun::star::awt::FocusEvent
& e
) throw( com::sun::star::uno::RuntimeException
);
172 void SAL_CALL
focusLost( const ::com::sun::star::awt::FocusEvent
& e
) throw( com::sun::star::uno::RuntimeException
);
174 void RemoveListeners();
176 virtual void GetFocus();
178 virtual sal_Bool
HandleShortCutKey( const KeyEvent
& rKeyEvent
); // returns true, if key was handled
182 inline const String
& BibGeneralPage::GetErrorString() const
184 return sTableErrorString
;
187 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XBoundComponent
>&
188 BibGeneralPage::GetTypeListBoxModel() const
193 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>&
194 BibGeneralPage::GetControlContainer() const
199 inline BibDataManager
* BibGeneralPage::GetDataManager()
207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */