Bump for 3.6-28
[LibreOffice.git] / extensions / source / bibliography / general.hxx
blob0095d18d36264f880620adfd7d8cfd9db1ea891e
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"
48 class BibDataManager;
49 #define TYPE_COUNT 22
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;
59 FixedText aYearFT;
61 FixedText aAuthorFT;
62 FixedText aTitleFT;
64 FixedText aPublisherFT;
65 FixedText aAddressFT;
66 FixedText aISBNFT;
68 FixedText aChapterFT;
69 FixedText aPagesFT;
70 FixedLine aFirstFL;
72 FixedText aEditorFT;
73 FixedText aEditionFT;
75 FixedText aBooktitleFT;
76 FixedText aVolumeFT;
77 FixedText aHowpublishedFT;
79 FixedText aOrganizationsFT;
80 FixedText aInstitutionFT;
81 FixedText aSchoolFT;
83 FixedText aReportTypeFT;
84 FixedText aMonthFT;
85 FixedLine aSecondFL;
87 FixedText aJournalFT;
88 FixedText aNumberFT;
89 FixedText aSeriesFT;
91 FixedText aAnnoteFT;
92 FixedText aNoteFT;
93 FixedText aURLFT;
94 FixedLine aThirdFL;
96 FixedText aCustom1FT;
97 FixedText aCustom2FT;
98 FixedText aCustom3FT;
99 FixedText aCustom4FT;
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 ];
111 Size aStdSize;
112 Point aBasePos;
114 String aBibTypeArr[ TYPE_COUNT ];
115 String sErrorPrefix;
116 String sTableErrorString;
118 String sTypeColumnName;
120 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
121 xCtrlContnr;
123 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
124 xMgr;
126 ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
127 xCurrentBoundComponent;
129 ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
130 xLBModel;
132 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >
133 xPosListener;
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,
140 sal_Int16& rIndex );
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* );
150 protected:
151 virtual void Resize();
152 void InitFixedTexts( void ); // create mnemonics and set text an all fixed texts
154 public:
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
190 return xLBModel;
193 inline const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >&
194 BibGeneralPage::GetControlContainer() const
196 return xCtrlContnr;
199 inline BibDataManager* BibGeneralPage::GetDataManager()
201 return pDatMan;
204 #endif
207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */