Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
21 : : #define _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
22 : :
23 : : #include "controlwizard.hxx"
24 : : #include "commonpagesdbp.hxx"
25 : :
26 : : //.........................................................................
27 : : namespace dbp
28 : : {
29 : : //.........................................................................
30 : :
31 : : //=====================================================================
32 : : //= OOptionGroupSettings
33 : : //=====================================================================
34 : 0 : struct OOptionGroupSettings : public OControlWizardSettings
35 : : {
36 : : StringArray aLabels;
37 : : StringArray aValues;
38 : : String sDefaultField;
39 : : String sDBField;
40 : : String sName;
41 : : };
42 : :
43 : : //=====================================================================
44 : : //= OGroupBoxWizard
45 : : //=====================================================================
46 : 0 : class OGroupBoxWizard : public OControlWizard
47 : : {
48 : : protected:
49 : : OOptionGroupSettings m_aSettings;
50 : :
51 : : sal_Bool m_bVisitedDefault : 1;
52 : : sal_Bool m_bVisitedDB : 1;
53 : :
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::lang::XMultiServiceFactory >& _rxORB
59 : : );
60 : :
61 : 0 : OOptionGroupSettings& getSettings() { return m_aSettings; }
62 : :
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();
69 : :
70 : : virtual sal_Bool approveControl(sal_Int16 _nClassId);
71 : :
72 : : protected:
73 : : void createRadios();
74 : : };
75 : :
76 : : //=====================================================================
77 : : //= OGBWPage
78 : : //=====================================================================
79 : 0 : class OGBWPage : public OControlWizardPage
80 : : {
81 : : public:
82 : 0 : OGBWPage( OControlWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
83 : :
84 : : protected:
85 : 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
86 : : };
87 : :
88 : : //=====================================================================
89 : : //= ORadioSelectionPage
90 : : //=====================================================================
91 : 0 : class ORadioSelectionPage : public OGBWPage
92 : : {
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;
101 : :
102 : : public:
103 : : ORadioSelectionPage( OControlWizard* _pParent );
104 : :
105 : : protected:
106 : : // TabPage overridables
107 : : void ActivatePage();
108 : :
109 : : // OWizardPage overridables
110 : : virtual void initializePage();
111 : : virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
112 : : virtual bool canAdvance() const;
113 : :
114 : : DECL_LINK( OnMoveEntry, PushButton* );
115 : : DECL_LINK( OnEntrySelected, ListBox* );
116 : : DECL_LINK( OnNameModified, Edit* );
117 : :
118 : : void implCheckMoveButtons();
119 : : };
120 : :
121 : : //=====================================================================
122 : : //= ODefaultFieldSelectionPage
123 : : //=====================================================================
124 : 0 : class ODefaultFieldSelectionPage : public OMaybeListSelectionPage
125 : : {
126 : : protected:
127 : : FixedLine m_aFrame;
128 : : FixedText m_aDefaultSelectionLabel;
129 : : RadioButton m_aDefSelYes;
130 : : RadioButton m_aDefSelNo;
131 : : ListBox m_aDefSelection;
132 : :
133 : : public:
134 : : ODefaultFieldSelectionPage( OControlWizard* _pParent );
135 : :
136 : : protected:
137 : : // OWizardPage overridables
138 : : virtual void initializePage();
139 : : virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
140 : :
141 : 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
142 : : };
143 : :
144 : : //=====================================================================
145 : : //= OOptionValuesPage
146 : : //=====================================================================
147 : 0 : class OOptionValuesPage : public OGBWPage
148 : : {
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;
156 : :
157 : : StringArray m_aUncommittedValues;
158 : : ::svt::WizardTypes::WizardState
159 : : m_nLastSelection;
160 : :
161 : : public:
162 : : OOptionValuesPage( OControlWizard* _pParent );
163 : :
164 : : protected:
165 : : // TabPage overridables
166 : : void ActivatePage();
167 : :
168 : : // OWizardPage overridables
169 : : virtual void initializePage();
170 : : virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
171 : :
172 : : void implTraveledOptions();
173 : :
174 : : DECL_LINK( OnOptionSelected, ListBox* );
175 : : };
176 : :
177 : : //=====================================================================
178 : : //= OOptionDBFieldPage
179 : : //=====================================================================
180 : 0 : class OOptionDBFieldPage : public ODBFieldPage
181 : : {
182 : : public:
183 : : OOptionDBFieldPage( OControlWizard* _pParent );
184 : :
185 : : protected:
186 : 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
187 : :
188 : : // ODBFieldPage overridables
189 : : virtual String& getDBFieldSetting();
190 : : };
191 : :
192 : : //=====================================================================
193 : : //= OFinalizeGBWPage
194 : : //=====================================================================
195 : 0 : class OFinalizeGBWPage : public OGBWPage
196 : : {
197 : : protected:
198 : : FixedLine m_aFrame;
199 : : FixedText m_aNameLabel;
200 : : Edit m_aName;
201 : : FixedText m_aThatsAll;
202 : :
203 : : public:
204 : : OFinalizeGBWPage( OControlWizard* _pParent );
205 : :
206 : : protected:
207 : : // TabPage overridables
208 : : void ActivatePage();
209 : :
210 : : // OWizardPage overridables
211 : : virtual void initializePage();
212 : : virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
213 : : virtual bool canAdvance() const;
214 : : };
215 : :
216 : : //.........................................................................
217 : : } // namespace dbp
218 : : //.........................................................................
219 : :
220 : : #endif // _EXTENSIONS_DBP_GROUPBOXWIZ_HXX_
221 : :
222 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|