merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / dbpilots / groupboxwiz.hxx
blobde0f9767f3a482daa70563d45b9953b82caeb5d3
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 //.........................................................................
35 namespace dbp
37 //.........................................................................
39 //=====================================================================
40 //= OOptionGroupSettings
41 //=====================================================================
42 struct OOptionGroupSettings : public OControlWizardSettings
44 StringArray aLabels;
45 StringArray aValues;
46 String sDefaultField;
47 String sDBField;
48 String sName;
51 //=====================================================================
52 //= OGroupBoxWizard
53 //=====================================================================
54 class OGroupBoxWizard : public OControlWizard
56 protected:
57 OOptionGroupSettings m_aSettings;
59 sal_Bool m_bVisitedDefault : 1;
60 sal_Bool m_bVisitedDB : 1;
62 public:
63 OGroupBoxWizard(
64 Window* _pParent,
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; }
71 protected:
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);
80 protected:
81 void createRadios();
84 //=====================================================================
85 //= OGBWPage
86 //=====================================================================
87 class OGBWPage : public OControlWizardPage
89 public:
90 OGBWPage( OControlWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
92 protected:
93 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
96 //=====================================================================
97 //= ORadioSelectionPage
98 //=====================================================================
99 class ORadioSelectionPage : public OGBWPage
101 protected:
102 FixedLine m_aFrame;
103 FixedText m_aRadioNameLabel;
104 Edit m_aRadioName;
105 PushButton m_aMoveRight;
106 PushButton m_aMoveLeft;
107 FixedText m_aExistingRadiosLabel;
108 ListBox m_aExistingRadios;
110 public:
111 ORadioSelectionPage( OControlWizard* _pParent );
113 protected:
114 // TabPage overridables
115 void ActivatePage();
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
134 protected:
135 FixedLine m_aFrame;
136 FixedText m_aDefaultSelectionLabel;
137 RadioButton m_aDefSelYes;
138 RadioButton m_aDefSelNo;
139 ListBox m_aDefSelection;
141 public:
142 ODefaultFieldSelectionPage( OControlWizard* _pParent );
144 protected:
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
157 protected:
158 FixedLine m_aFrame;
159 FixedText m_aDescription;
160 FixedText m_aValueLabel;
161 Edit m_aValue;
162 FixedText m_aOptionsLabel;
163 ListBox m_aOptions;
165 StringArray m_aUncommittedValues;
166 ::svt::WizardTypes::WizardState
167 m_nLastSelection;
169 public:
170 OOptionValuesPage( OControlWizard* _pParent );
172 protected:
173 // TabPage overridables
174 void ActivatePage();
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
190 public:
191 OOptionDBFieldPage( OControlWizard* _pParent );
193 protected:
194 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
196 // ODBFieldPage overridables
197 virtual String& getDBFieldSetting();
200 //=====================================================================
201 //= OFinalizeGBWPage
202 //=====================================================================
203 class OFinalizeGBWPage : public OGBWPage
205 protected:
206 FixedLine m_aFrame;
207 FixedText m_aNameLabel;
208 Edit m_aName;
209 FixedText m_aThatsAll;
211 public:
212 OFinalizeGBWPage( OControlWizard* _pParent );
214 protected:
215 // TabPage overridables
216 void ActivatePage();
218 // OWizardPage overridables
219 virtual void initializePage();
220 virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
221 virtual bool canAdvance() const;
224 //.........................................................................
225 } // namespace dbp
226 //.........................................................................
228 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_