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 INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
22 :
23 : #include "controlwizard.hxx"
24 : #include "commonpagesdbp.hxx"
25 :
26 :
27 : namespace dbp
28 : {
29 :
30 0 : struct OOptionGroupSettings : public OControlWizardSettings
31 : {
32 : StringArray aLabels;
33 : StringArray aValues;
34 : OUString sDefaultField;
35 : OUString sDBField;
36 : OUString sName;
37 : };
38 :
39 0 : class OGroupBoxWizard : public OControlWizard
40 : {
41 : protected:
42 : OOptionGroupSettings m_aSettings;
43 :
44 : bool m_bVisitedDefault : 1;
45 : bool m_bVisitedDB : 1;
46 :
47 : public:
48 : OGroupBoxWizard(
49 : vcl::Window* _pParent,
50 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel,
51 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
52 : );
53 :
54 0 : OOptionGroupSettings& getSettings() { return m_aSettings; }
55 :
56 : protected:
57 : // OWizardMachine overridables
58 : virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
59 : virtual WizardState determineNextState( WizardState _nCurrentState ) const SAL_OVERRIDE;
60 : virtual void enterState( WizardState _nState ) SAL_OVERRIDE;
61 : virtual bool onFinish() SAL_OVERRIDE;
62 :
63 : virtual bool approveControl(sal_Int16 _nClassId) SAL_OVERRIDE;
64 :
65 : protected:
66 : void createRadios();
67 : };
68 :
69 0 : class OGBWPage : public OControlWizardPage
70 : {
71 : public:
72 0 : OGBWPage(OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription)
73 0 : : OControlWizardPage(_pParent, _rID, _rUIXMLDescription)
74 : {
75 0 : }
76 :
77 : protected:
78 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
79 : };
80 :
81 : class ORadioSelectionPage : public OGBWPage
82 : {
83 : protected:
84 : VclPtr<Edit> m_pRadioName;
85 : VclPtr<PushButton> m_pMoveRight;
86 : VclPtr<PushButton> m_pMoveLeft;
87 : VclPtr<ListBox> m_pExistingRadios;
88 :
89 : public:
90 : ORadioSelectionPage( OControlWizard* _pParent );
91 : virtual ~ORadioSelectionPage();
92 : virtual void dispose() SAL_OVERRIDE;
93 :
94 : protected:
95 : // TabPage overridables
96 : void ActivatePage() SAL_OVERRIDE;
97 :
98 : // OWizardPage overridables
99 : virtual void initializePage() SAL_OVERRIDE;
100 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
101 : virtual bool canAdvance() const SAL_OVERRIDE;
102 :
103 : DECL_LINK( OnMoveEntry, PushButton* );
104 : DECL_LINK( OnEntrySelected, ListBox* );
105 : DECL_LINK( OnNameModified, Edit* );
106 :
107 : void implCheckMoveButtons();
108 : };
109 :
110 : class ODefaultFieldSelectionPage : public OMaybeListSelectionPage
111 : {
112 : protected:
113 : VclPtr<RadioButton> m_pDefSelYes;
114 : VclPtr<RadioButton> m_pDefSelNo;
115 : VclPtr<ListBox> m_pDefSelection;
116 :
117 : public:
118 : ODefaultFieldSelectionPage( OControlWizard* _pParent );
119 : virtual ~ODefaultFieldSelectionPage();
120 : virtual void dispose() SAL_OVERRIDE;
121 :
122 : protected:
123 : // OWizardPage overridables
124 : virtual void initializePage() SAL_OVERRIDE;
125 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
126 :
127 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
128 : };
129 :
130 : class OOptionValuesPage : public OGBWPage
131 : {
132 : protected:
133 : VclPtr<Edit> m_pValue;
134 : VclPtr<ListBox> m_pOptions;
135 :
136 : StringArray m_aUncommittedValues;
137 : ::svt::WizardTypes::WizardState
138 : m_nLastSelection;
139 :
140 : public:
141 : OOptionValuesPage( OControlWizard* _pParent );
142 : virtual ~OOptionValuesPage();
143 : virtual void dispose() SAL_OVERRIDE;
144 :
145 : protected:
146 : // TabPage overridables
147 : void ActivatePage() SAL_OVERRIDE;
148 :
149 : // OWizardPage overridables
150 : virtual void initializePage() SAL_OVERRIDE;
151 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
152 :
153 : void implTraveledOptions();
154 :
155 : DECL_LINK( OnOptionSelected, ListBox* );
156 : };
157 :
158 0 : class OOptionDBFieldPage : public ODBFieldPage
159 : {
160 : public:
161 : OOptionDBFieldPage( OControlWizard* _pParent );
162 :
163 : protected:
164 0 : OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
165 :
166 : // ODBFieldPage overridables
167 : virtual OUString& getDBFieldSetting() SAL_OVERRIDE;
168 : };
169 :
170 : class OFinalizeGBWPage : public OGBWPage
171 : {
172 : protected:
173 : VclPtr<Edit> m_pName;
174 :
175 : public:
176 : OFinalizeGBWPage( OControlWizard* _pParent );
177 : virtual ~OFinalizeGBWPage();
178 : virtual void dispose() SAL_OVERRIDE;
179 :
180 : protected:
181 : // TabPage overridables
182 : void ActivatePage() SAL_OVERRIDE;
183 :
184 : // OWizardPage overridables
185 : virtual void initializePage() SAL_OVERRIDE;
186 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
187 : virtual bool canAdvance() const SAL_OVERRIDE;
188 : };
189 :
190 :
191 : } // namespace dbp
192 :
193 :
194 : #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
195 :
196 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|