merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / dbpilots / commonpagesdbp.hxx
bloba20587b36d722de976763ea3eceb5a9528d21dce
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
29 #define _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
31 #include "controlwizard.hxx"
32 #include <vcl/fixed.hxx>
33 #include <vcl/lstbox.hxx>
34 #include <com/sun/star/container/XNameAccess.hpp>
36 //.........................................................................
37 namespace dbp
39 //.........................................................................
41 //=====================================================================
42 //= OTableSelectionPage
43 //=====================================================================
44 class OTableSelectionPage : public OControlWizardPage
46 protected:
47 FixedLine m_aData;
48 FixedText m_aExplanation;
49 FixedText m_aDatasourceLabel;
50 ListBox m_aDatasource;
51 PushButton m_aSearchDatabase;
52 FixedText m_aTableLabel;
53 ListBox m_aTable;
55 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
56 m_xDSContext;
58 public:
59 OTableSelectionPage(OControlWizard* _pParent);
61 protected:
62 // TabPage overridables
63 void ActivatePage();
65 // OWizardPage overridables
66 virtual void initializePage();
67 virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
69 protected:
70 DECL_LINK( OnListboxSelection, ListBox* );
71 DECL_LINK( OnListboxDoubleClicked, ListBox* );
72 DECL_LINK( OnSearchClicked, PushButton* );
74 void implCollectDatasource();
75 void implFillTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >&
76 _rxConn = ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >());
78 // OControlWizardPage overridables
79 virtual bool canAdvance() const;
82 //=====================================================================
83 //= OMaybeListSelectionPage
84 //=====================================================================
85 class OMaybeListSelectionPage : public OControlWizardPage
87 protected:
88 RadioButton* m_pYes;
89 RadioButton* m_pNo;
90 ListBox* m_pList;
92 public:
93 OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId );
95 protected:
96 DECL_LINK( OnRadioSelected, RadioButton* );
98 // TabPage overridables
99 void ActivatePage();
101 // own helper
102 void announceControls(
103 RadioButton& _rYesButton,
104 RadioButton& _rNoButton,
105 ListBox& _rSelection);
107 void implEnableWindows();
109 void implInitialize(const String& _rSelection);
110 void implCommit(String& _rSelection);
113 //=====================================================================
114 //= ODBFieldPage
115 //=====================================================================
116 class ODBFieldPage : public OMaybeListSelectionPage
118 protected:
119 FixedLine m_aFrame;
120 FixedText m_aDescription;
121 FixedText m_aQuestion;
122 RadioButton m_aStoreYes;
123 RadioButton m_aStoreNo;
124 ListBox m_aStoreWhere;
126 public:
127 ODBFieldPage( OControlWizard* _pParent );
129 protected:
130 void setDescriptionText(const String& _rDesc) { m_aDescription.SetText(_rDesc); }
132 // OWizardPage overridables
133 virtual void initializePage();
134 virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
136 // own overridables
137 virtual String& getDBFieldSetting() = 0;
140 //.........................................................................
141 } // namespace dbp
142 //.........................................................................
145 #endif // _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_