update dev300-m58
[ooovba.git] / extensions / source / dbpilots / groupboxwiz.hxx
blob78e040a6cbac49bf993530dfb1a1702f88e04b06
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: groupboxwiz.hxx,v $
10 * $Revision: 1.10 $
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 //.........................................................................
38 namespace dbp
40 //.........................................................................
42 //=====================================================================
43 //= OOptionGroupSettings
44 //=====================================================================
45 struct OOptionGroupSettings : public OControlWizardSettings
47 StringArray aLabels;
48 StringArray aValues;
49 String sDefaultField;
50 String sDBField;
51 String sName;
54 //=====================================================================
55 //= OGroupBoxWizard
56 //=====================================================================
57 class OGroupBoxWizard : public OControlWizard
59 protected:
60 OOptionGroupSettings m_aSettings;
62 sal_Bool m_bVisitedDefault : 1;
63 sal_Bool m_bVisitedDB : 1;
65 public:
66 OGroupBoxWizard(
67 Window* _pParent,
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; }
74 protected:
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);
84 protected:
85 void createRadios();
88 //=====================================================================
89 //= OGBWPage
90 //=====================================================================
91 class OGBWPage : public OControlWizardPage
93 public:
94 OGBWPage( OControlWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
96 protected:
97 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
100 //=====================================================================
101 //= ORadioSelectionPage
102 //=====================================================================
103 class ORadioSelectionPage : public OGBWPage
105 protected:
106 FixedLine m_aFrame;
107 FixedText m_aRadioNameLabel;
108 Edit m_aRadioName;
109 PushButton m_aMoveRight;
110 PushButton m_aMoveLeft;
111 FixedText m_aExistingRadiosLabel;
112 ListBox m_aExistingRadios;
114 public:
115 ORadioSelectionPage( OControlWizard* _pParent );
117 protected:
118 // TabPage overridables
119 void ActivatePage();
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
138 protected:
139 FixedLine m_aFrame;
140 FixedText m_aDefaultSelectionLabel;
141 RadioButton m_aDefSelYes;
142 RadioButton m_aDefSelNo;
143 ListBox m_aDefSelection;
145 public:
146 ODefaultFieldSelectionPage( OControlWizard* _pParent );
148 protected:
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
161 protected:
162 FixedLine m_aFrame;
163 FixedText m_aDescription;
164 FixedText m_aValueLabel;
165 Edit m_aValue;
166 FixedText m_aOptionsLabel;
167 ListBox m_aOptions;
169 StringArray m_aUncommittedValues;
170 WizardState m_nLastSelection;
172 public:
173 OOptionValuesPage( OControlWizard* _pParent );
175 protected:
176 // TabPage overridables
177 void ActivatePage();
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
193 public:
194 OOptionDBFieldPage( OControlWizard* _pParent );
196 protected:
197 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
199 // ODBFieldPage overridables
200 virtual String& getDBFieldSetting();
203 //=====================================================================
204 //= OFinalizeGBWPage
205 //=====================================================================
206 class OFinalizeGBWPage : public OGBWPage
208 protected:
209 FixedLine m_aFrame;
210 FixedText m_aNameLabel;
211 Edit m_aName;
212 FixedText m_aThatsAll;
214 public:
215 OFinalizeGBWPage( OControlWizard* _pParent );
217 protected:
218 // TabPage overridables
219 void ActivatePage();
221 // OWizardPage overridables
222 virtual void initializePage();
223 virtual sal_Bool commitPage( CommitPageReason _eReason );
224 virtual bool canAdvance() const;
227 //.........................................................................
228 } // namespace dbp
229 //.........................................................................
231 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_