bump product version to 4.1.6.2
[LibreOffice.git] / extensions / source / dbpilots / groupboxwiz.hxx
blob026e39e7ea4be905f94dc94254458c32b882602f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 //.........................................................................
27 namespace dbp
29 //.........................................................................
31 //=====================================================================
32 //= OOptionGroupSettings
33 //=====================================================================
34 struct OOptionGroupSettings : public OControlWizardSettings
36 StringArray aLabels;
37 StringArray aValues;
38 String sDefaultField;
39 String sDBField;
40 String sName;
43 //=====================================================================
44 //= OGroupBoxWizard
45 //=====================================================================
46 class OGroupBoxWizard : public OControlWizard
48 protected:
49 OOptionGroupSettings m_aSettings;
51 sal_Bool m_bVisitedDefault : 1;
52 sal_Bool m_bVisitedDB : 1;
54 public:
55 OGroupBoxWizard(
56 Window* _pParent,
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; }
63 protected:
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);
72 protected:
73 void createRadios();
76 //=====================================================================
77 //= OGBWPage
78 //=====================================================================
79 class OGBWPage : public OControlWizardPage
81 public:
82 OGBWPage( OControlWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
84 protected:
85 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
88 //=====================================================================
89 //= ORadioSelectionPage
90 //=====================================================================
91 class ORadioSelectionPage : public OGBWPage
93 protected:
94 FixedLine m_aFrame;
95 FixedText m_aRadioNameLabel;
96 Edit m_aRadioName;
97 PushButton m_aMoveRight;
98 PushButton m_aMoveLeft;
99 FixedText m_aExistingRadiosLabel;
100 ListBox m_aExistingRadios;
102 public:
103 ORadioSelectionPage( OControlWizard* _pParent );
105 protected:
106 // TabPage overridables
107 void ActivatePage();
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
126 protected:
127 FixedLine m_aFrame;
128 FixedText m_aDefaultSelectionLabel;
129 RadioButton m_aDefSelYes;
130 RadioButton m_aDefSelNo;
131 ListBox m_aDefSelection;
133 public:
134 ODefaultFieldSelectionPage( OControlWizard* _pParent );
136 protected:
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
149 protected:
150 FixedLine m_aFrame;
151 FixedText m_aDescription;
152 FixedText m_aValueLabel;
153 Edit m_aValue;
154 FixedText m_aOptionsLabel;
155 ListBox m_aOptions;
157 StringArray m_aUncommittedValues;
158 ::svt::WizardTypes::WizardState
159 m_nLastSelection;
161 public:
162 OOptionValuesPage( OControlWizard* _pParent );
164 protected:
165 // TabPage overridables
166 void ActivatePage();
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
182 public:
183 OOptionDBFieldPage( OControlWizard* _pParent );
185 protected:
186 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
188 // ODBFieldPage overridables
189 virtual String& getDBFieldSetting();
192 //=====================================================================
193 //= OFinalizeGBWPage
194 //=====================================================================
195 class OFinalizeGBWPage : public OGBWPage
197 protected:
198 FixedLine m_aFrame;
199 FixedText m_aNameLabel;
200 Edit m_aName;
201 FixedText m_aThatsAll;
203 public:
204 OFinalizeGBWPage( OControlWizard* _pParent );
206 protected:
207 // TabPage overridables
208 void ActivatePage();
210 // OWizardPage overridables
211 virtual void initializePage();
212 virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
213 virtual bool canAdvance() const;
216 //.........................................................................
217 } // namespace dbp
218 //.........................................................................
220 #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */