1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: commonpagesdbp.hxx,v $
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 //.........................................................................
42 //.........................................................................
44 //=====================================================================
45 //= OTableSelectionPage
46 //=====================================================================
47 class OTableSelectionPage
: public OControlWizardPage
51 FixedText m_aExplanation
;
52 FixedText m_aDatasourceLabel
;
53 ListBox m_aDatasource
;
54 PushButton m_aSearchDatabase
;
55 FixedText m_aTableLabel
;
58 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
>
62 OTableSelectionPage(OControlWizard
* _pParent
);
65 // TabPage overridables
68 // OWizardPage overridables
69 virtual void initializePage();
70 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
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
96 OMaybeListSelectionPage( OControlWizard
* _pParent
, const ResId
& _rId
);
99 DECL_LINK( OnRadioSelected
, RadioButton
* );
101 // TabPage overridables
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 //=====================================================================
118 //=====================================================================
119 class ODBFieldPage
: public OMaybeListSelectionPage
123 FixedText m_aDescription
;
124 FixedText m_aQuestion
;
125 RadioButton m_aStoreYes
;
126 RadioButton m_aStoreNo
;
127 ListBox m_aStoreWhere
;
130 ODBFieldPage( OControlWizard
* _pParent
);
133 void setDescriptionText(const String
& _rDesc
) { m_aDescription
.SetText(_rDesc
); }
135 // OWizardPage overridables
136 virtual void initializePage();
137 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
140 virtual String
& getDBFieldSetting() = 0;
143 //.........................................................................
145 //.........................................................................
148 #endif // _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_