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_GROUPBOXWIZ_HXX_
29 #define _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
31 #include "controlwizard.hxx"
32 #include "commonpagesdbp.hxx"
34 //.........................................................................
37 //.........................................................................
39 //=====================================================================
40 //= OOptionGroupSettings
41 //=====================================================================
42 struct OOptionGroupSettings
: public OControlWizardSettings
51 //=====================================================================
53 //=====================================================================
54 class OGroupBoxWizard
: public OControlWizard
57 OOptionGroupSettings m_aSettings
;
59 sal_Bool m_bVisitedDefault
: 1;
60 sal_Bool m_bVisitedDB
: 1;
65 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxObjectModel
,
66 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
69 OOptionGroupSettings
& getSettings() { return m_aSettings
; }
72 // OWizardMachine overridables
73 virtual ::svt::OWizardPage
* createPage( WizardState _nState
);
74 virtual WizardState
determineNextState( WizardState _nCurrentState
) const;
75 virtual void enterState( WizardState _nState
);
76 virtual sal_Bool
onFinish();
78 virtual sal_Bool
approveControl(sal_Int16 _nClassId
);
84 //=====================================================================
86 //=====================================================================
87 class OGBWPage
: public OControlWizardPage
90 OGBWPage( OControlWizard
* _pParent
, const ResId
& _rId
) : OControlWizardPage(_pParent
, _rId
) { }
93 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
96 //=====================================================================
97 //= ORadioSelectionPage
98 //=====================================================================
99 class ORadioSelectionPage
: public OGBWPage
103 FixedText m_aRadioNameLabel
;
105 PushButton m_aMoveRight
;
106 PushButton m_aMoveLeft
;
107 FixedText m_aExistingRadiosLabel
;
108 ListBox m_aExistingRadios
;
111 ORadioSelectionPage( OControlWizard
* _pParent
);
114 // TabPage overridables
117 // OWizardPage overridables
118 virtual void initializePage();
119 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
120 virtual bool canAdvance() const;
122 DECL_LINK( OnMoveEntry
, PushButton
* );
123 DECL_LINK( OnEntrySelected
, ListBox
* );
124 DECL_LINK( OnNameModified
, Edit
* );
126 void implCheckMoveButtons();
129 //=====================================================================
130 //= ODefaultFieldSelectionPage
131 //=====================================================================
132 class ODefaultFieldSelectionPage
: public OMaybeListSelectionPage
136 FixedText m_aDefaultSelectionLabel
;
137 RadioButton m_aDefSelYes
;
138 RadioButton m_aDefSelNo
;
139 ListBox m_aDefSelection
;
142 ODefaultFieldSelectionPage( OControlWizard
* _pParent
);
145 // OWizardPage overridables
146 virtual void initializePage();
147 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
149 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
152 //=====================================================================
153 //= OOptionValuesPage
154 //=====================================================================
155 class OOptionValuesPage
: public OGBWPage
159 FixedText m_aDescription
;
160 FixedText m_aValueLabel
;
162 FixedText m_aOptionsLabel
;
165 StringArray m_aUncommittedValues
;
166 ::svt::WizardTypes::WizardState
170 OOptionValuesPage( OControlWizard
* _pParent
);
173 // TabPage overridables
176 // OWizardPage overridables
177 virtual void initializePage();
178 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
180 void implTraveledOptions();
182 DECL_LINK( OnOptionSelected
, ListBox
* );
185 //=====================================================================
186 //= OOptionDBFieldPage
187 //=====================================================================
188 class OOptionDBFieldPage
: public ODBFieldPage
191 OOptionDBFieldPage( OControlWizard
* _pParent
);
194 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
196 // ODBFieldPage overridables
197 virtual String
& getDBFieldSetting();
200 //=====================================================================
202 //=====================================================================
203 class OFinalizeGBWPage
: public OGBWPage
207 FixedText m_aNameLabel
;
209 FixedText m_aThatsAll
;
212 OFinalizeGBWPage( OControlWizard
* _pParent
);
215 // TabPage overridables
218 // OWizardPage overridables
219 virtual void initializePage();
220 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
221 virtual bool canAdvance() const;
224 //.........................................................................
226 //.........................................................................
228 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_