1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
21 #define _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
23 #include "controlwizard.hxx"
24 #include "commonpagesdbp.hxx"
26 //.........................................................................
29 //.........................................................................
31 //=====================================================================
32 //= OOptionGroupSettings
33 //=====================================================================
34 struct OOptionGroupSettings
: public OControlWizardSettings
43 //=====================================================================
45 //=====================================================================
46 class OGroupBoxWizard
: public OControlWizard
49 OOptionGroupSettings m_aSettings
;
51 sal_Bool m_bVisitedDefault
: 1;
52 sal_Bool m_bVisitedDB
: 1;
57 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxObjectModel
,
58 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxContext
61 OOptionGroupSettings
& getSettings() { return m_aSettings
; }
64 // OWizardMachine overridables
65 virtual ::svt::OWizardPage
* createPage( WizardState _nState
);
66 virtual WizardState
determineNextState( WizardState _nCurrentState
) const;
67 virtual void enterState( WizardState _nState
);
68 virtual sal_Bool
onFinish();
70 virtual sal_Bool
approveControl(sal_Int16 _nClassId
);
76 //=====================================================================
78 //=====================================================================
79 class OGBWPage
: public OControlWizardPage
82 OGBWPage( OControlWizard
* _pParent
, const ResId
& _rId
) : OControlWizardPage(_pParent
, _rId
) { }
85 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
88 //=====================================================================
89 //= ORadioSelectionPage
90 //=====================================================================
91 class ORadioSelectionPage
: public OGBWPage
95 FixedText m_aRadioNameLabel
;
97 PushButton m_aMoveRight
;
98 PushButton m_aMoveLeft
;
99 FixedText m_aExistingRadiosLabel
;
100 ListBox m_aExistingRadios
;
103 ORadioSelectionPage( OControlWizard
* _pParent
);
106 // TabPage overridables
109 // OWizardPage overridables
110 virtual void initializePage();
111 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
112 virtual bool canAdvance() const;
114 DECL_LINK( OnMoveEntry
, PushButton
* );
115 DECL_LINK( OnEntrySelected
, ListBox
* );
116 DECL_LINK( OnNameModified
, Edit
* );
118 void implCheckMoveButtons();
121 //=====================================================================
122 //= ODefaultFieldSelectionPage
123 //=====================================================================
124 class ODefaultFieldSelectionPage
: public OMaybeListSelectionPage
128 FixedText m_aDefaultSelectionLabel
;
129 RadioButton m_aDefSelYes
;
130 RadioButton m_aDefSelNo
;
131 ListBox m_aDefSelection
;
134 ODefaultFieldSelectionPage( OControlWizard
* _pParent
);
137 // OWizardPage overridables
138 virtual void initializePage();
139 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
141 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
144 //=====================================================================
145 //= OOptionValuesPage
146 //=====================================================================
147 class OOptionValuesPage
: public OGBWPage
151 FixedText m_aDescription
;
152 FixedText m_aValueLabel
;
154 FixedText m_aOptionsLabel
;
157 StringArray m_aUncommittedValues
;
158 ::svt::WizardTypes::WizardState
162 OOptionValuesPage( OControlWizard
* _pParent
);
165 // TabPage overridables
168 // OWizardPage overridables
169 virtual void initializePage();
170 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
172 void implTraveledOptions();
174 DECL_LINK( OnOptionSelected
, ListBox
* );
177 //=====================================================================
178 //= OOptionDBFieldPage
179 //=====================================================================
180 class OOptionDBFieldPage
: public ODBFieldPage
183 OOptionDBFieldPage( OControlWizard
* _pParent
);
186 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
188 // ODBFieldPage overridables
189 virtual String
& getDBFieldSetting();
192 //=====================================================================
194 //=====================================================================
195 class OFinalizeGBWPage
: public OGBWPage
199 FixedText m_aNameLabel
;
201 FixedText m_aThatsAll
;
204 OFinalizeGBWPage( OControlWizard
* _pParent
);
207 // TabPage overridables
210 // OWizardPage overridables
211 virtual void initializePage();
212 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
213 virtual bool canAdvance() const;
216 //.........................................................................
218 //.........................................................................
220 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */