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: groupboxwiz.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_GROUPBOXWIZ_HXX_
32 #define _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
34 #include "controlwizard.hxx"
35 #include "commonpagesdbp.hxx"
37 //.........................................................................
40 //.........................................................................
42 //=====================================================================
43 //= OOptionGroupSettings
44 //=====================================================================
45 struct OOptionGroupSettings
: public OControlWizardSettings
54 //=====================================================================
56 //=====================================================================
57 class OGroupBoxWizard
: public OControlWizard
60 OOptionGroupSettings m_aSettings
;
62 sal_Bool m_bVisitedDefault
: 1;
63 sal_Bool m_bVisitedDB
: 1;
68 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxObjectModel
,
69 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
72 OOptionGroupSettings
& getSettings() { return m_aSettings
; }
75 // OWizardMachine overridables
76 virtual ::svt::OWizardPage
* createPage( WizardState _nState
);
77 virtual WizardState
determineNextState( WizardState _nCurrentState
) const;
78 virtual void enterState( WizardState _nState
);
80 virtual sal_Bool
onFinish(sal_Int32 _nResult
);
82 virtual sal_Bool
approveControl(sal_Int16 _nClassId
);
88 //=====================================================================
90 //=====================================================================
91 class OGBWPage
: public OControlWizardPage
94 OGBWPage( OControlWizard
* _pParent
, const ResId
& _rId
) : OControlWizardPage(_pParent
, _rId
) { }
97 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
100 //=====================================================================
101 //= ORadioSelectionPage
102 //=====================================================================
103 class ORadioSelectionPage
: public OGBWPage
107 FixedText m_aRadioNameLabel
;
109 PushButton m_aMoveRight
;
110 PushButton m_aMoveLeft
;
111 FixedText m_aExistingRadiosLabel
;
112 ListBox m_aExistingRadios
;
115 ORadioSelectionPage( OControlWizard
* _pParent
);
118 // TabPage overridables
121 // OWizardPage overridables
122 virtual void initializePage();
123 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
124 virtual bool canAdvance() const;
126 DECL_LINK( OnMoveEntry
, PushButton
* );
127 DECL_LINK( OnEntrySelected
, ListBox
* );
128 DECL_LINK( OnNameModified
, Edit
* );
130 void implCheckMoveButtons();
133 //=====================================================================
134 //= ODefaultFieldSelectionPage
135 //=====================================================================
136 class ODefaultFieldSelectionPage
: public OMaybeListSelectionPage
140 FixedText m_aDefaultSelectionLabel
;
141 RadioButton m_aDefSelYes
;
142 RadioButton m_aDefSelNo
;
143 ListBox m_aDefSelection
;
146 ODefaultFieldSelectionPage( OControlWizard
* _pParent
);
149 // OWizardPage overridables
150 virtual void initializePage();
151 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
153 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
156 //=====================================================================
157 //= OOptionValuesPage
158 //=====================================================================
159 class OOptionValuesPage
: public OGBWPage
163 FixedText m_aDescription
;
164 FixedText m_aValueLabel
;
166 FixedText m_aOptionsLabel
;
169 StringArray m_aUncommittedValues
;
170 WizardState m_nLastSelection
;
173 OOptionValuesPage( OControlWizard
* _pParent
);
176 // TabPage overridables
179 // OWizardPage overridables
180 virtual void initializePage();
181 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
183 void implTraveledOptions();
185 DECL_LINK( OnOptionSelected
, ListBox
* );
188 //=====================================================================
189 //= OOptionDBFieldPage
190 //=====================================================================
191 class OOptionDBFieldPage
: public ODBFieldPage
194 OOptionDBFieldPage( OControlWizard
* _pParent
);
197 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
199 // ODBFieldPage overridables
200 virtual String
& getDBFieldSetting();
203 //=====================================================================
205 //=====================================================================
206 class OFinalizeGBWPage
: public OGBWPage
210 FixedText m_aNameLabel
;
212 FixedText m_aThatsAll
;
215 OFinalizeGBWPage( OControlWizard
* _pParent
);
218 // TabPage overridables
221 // OWizardPage overridables
222 virtual void initializePage();
223 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
224 virtual bool canAdvance() const;
227 //.........................................................................
229 //.........................................................................
231 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_