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 //.........................................................................
39 //.........................................................................
41 //=====================================================================
42 //= OTableSelectionPage
43 //=====================================================================
44 class OTableSelectionPage
: public OControlWizardPage
48 FixedText m_aExplanation
;
49 FixedText m_aDatasourceLabel
;
50 ListBox m_aDatasource
;
51 PushButton m_aSearchDatabase
;
52 FixedText m_aTableLabel
;
55 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
>
59 OTableSelectionPage(OControlWizard
* _pParent
);
62 // TabPage overridables
65 // OWizardPage overridables
66 virtual void initializePage();
67 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
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
93 OMaybeListSelectionPage( OControlWizard
* _pParent
, const ResId
& _rId
);
96 DECL_LINK( OnRadioSelected
, RadioButton
* );
98 // TabPage overridables
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 //=====================================================================
115 //=====================================================================
116 class ODBFieldPage
: public OMaybeListSelectionPage
120 FixedText m_aDescription
;
121 FixedText m_aQuestion
;
122 RadioButton m_aStoreYes
;
123 RadioButton m_aStoreNo
;
124 ListBox m_aStoreWhere
;
127 ODBFieldPage( OControlWizard
* _pParent
);
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
);
137 virtual String
& getDBFieldSetting() = 0;
140 //.........................................................................
142 //.........................................................................
145 #endif // _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_