merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / dbpilots / commonpagesdbp.hxx
blob9236f0f32b89cdc539911d199744aa86f4e19e81
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: commonpagesdbp.hxx,v $
10 * $Revision: 1.8 $
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 _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
32 #define _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
34 #include "controlwizard.hxx"
35 #include <vcl/fixed.hxx>
36 #include <vcl/lstbox.hxx>
37 #include <com/sun/star/container/XNameAccess.hpp>
39 //.........................................................................
40 namespace dbp
42 //.........................................................................
44 //=====================================================================
45 //= OTableSelectionPage
46 //=====================================================================
47 class OTableSelectionPage : public OControlWizardPage
49 protected:
50 FixedLine m_aData;
51 FixedText m_aExplanation;
52 FixedText m_aDatasourceLabel;
53 ListBox m_aDatasource;
54 PushButton m_aSearchDatabase;
55 FixedText m_aTableLabel;
56 ListBox m_aTable;
58 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
59 m_xDSContext;
61 public:
62 OTableSelectionPage(OControlWizard* _pParent);
64 protected:
65 // TabPage overridables
66 void ActivatePage();
68 // OWizardPage overridables
69 virtual void initializePage();
70 virtual sal_Bool commitPage( CommitPageReason _eReason );
72 protected:
73 DECL_LINK( OnListboxSelection, ListBox* );
74 DECL_LINK( OnListboxDoubleClicked, ListBox* );
75 DECL_LINK( OnSearchClicked, PushButton* );
77 void implCollectDatasource();
78 void implFillTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >&
79 _rxConn = ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >());
81 // OControlWizardPage overridables
82 virtual bool canAdvance() const;
85 //=====================================================================
86 //= OMaybeListSelectionPage
87 //=====================================================================
88 class OMaybeListSelectionPage : public OControlWizardPage
90 protected:
91 RadioButton* m_pYes;
92 RadioButton* m_pNo;
93 ListBox* m_pList;
95 public:
96 OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId );
98 protected:
99 DECL_LINK( OnRadioSelected, RadioButton* );
101 // TabPage overridables
102 void ActivatePage();
104 // own helper
105 void announceControls(
106 RadioButton& _rYesButton,
107 RadioButton& _rNoButton,
108 ListBox& _rSelection);
110 void implEnableWindows();
112 void implInitialize(const String& _rSelection);
113 void implCommit(String& _rSelection);
116 //=====================================================================
117 //= ODBFieldPage
118 //=====================================================================
119 class ODBFieldPage : public OMaybeListSelectionPage
121 protected:
122 FixedLine m_aFrame;
123 FixedText m_aDescription;
124 FixedText m_aQuestion;
125 RadioButton m_aStoreYes;
126 RadioButton m_aStoreNo;
127 ListBox m_aStoreWhere;
129 public:
130 ODBFieldPage( OControlWizard* _pParent );
132 protected:
133 void setDescriptionText(const String& _rDesc) { m_aDescription.SetText(_rDesc); }
135 // OWizardPage overridables
136 virtual void initializePage();
137 virtual sal_Bool commitPage( CommitPageReason _eReason );
139 // own overridables
140 virtual String& getDBFieldSetting() = 0;
143 //.........................................................................
144 } // namespace dbp
145 //.........................................................................
148 #endif // _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_