bump product version to 5.0.4.1
[LibreOffice.git] / extensions / source / dbpilots / groupboxwiz.hxx
blobaeae81d10899e0e009215b581e48b39908532cec
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 INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
23 #include "controlwizard.hxx"
24 #include "commonpagesdbp.hxx"
27 namespace dbp
30 struct OOptionGroupSettings : public OControlWizardSettings
32 StringArray aLabels;
33 StringArray aValues;
34 OUString sDefaultField;
35 OUString sDBField;
36 OUString sName;
39 class OGroupBoxWizard : public OControlWizard
41 protected:
42 OOptionGroupSettings m_aSettings;
44 bool m_bVisitedDefault : 1;
45 bool m_bVisitedDB : 1;
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
54 OOptionGroupSettings& getSettings() { return m_aSettings; }
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;
63 virtual bool approveControl(sal_Int16 _nClassId) SAL_OVERRIDE;
65 protected:
66 void createRadios();
69 class OGBWPage : public OControlWizardPage
71 public:
72 OGBWPage(OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription)
73 : OControlWizardPage(_pParent, _rID, _rUIXMLDescription)
77 protected:
78 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
81 class ORadioSelectionPage : public OGBWPage
83 protected:
84 VclPtr<Edit> m_pRadioName;
85 VclPtr<PushButton> m_pMoveRight;
86 VclPtr<PushButton> m_pMoveLeft;
87 VclPtr<ListBox> m_pExistingRadios;
89 public:
90 ORadioSelectionPage( OControlWizard* _pParent );
91 virtual ~ORadioSelectionPage();
92 virtual void dispose() SAL_OVERRIDE;
94 protected:
95 // TabPage overridables
96 void ActivatePage() SAL_OVERRIDE;
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;
103 DECL_LINK( OnMoveEntry, PushButton* );
104 DECL_LINK( OnEntrySelected, ListBox* );
105 DECL_LINK( OnNameModified, Edit* );
107 void implCheckMoveButtons();
110 class ODefaultFieldSelectionPage : public OMaybeListSelectionPage
112 protected:
113 VclPtr<RadioButton> m_pDefSelYes;
114 VclPtr<RadioButton> m_pDefSelNo;
115 VclPtr<ListBox> m_pDefSelection;
117 public:
118 ODefaultFieldSelectionPage( OControlWizard* _pParent );
119 virtual ~ODefaultFieldSelectionPage();
120 virtual void dispose() SAL_OVERRIDE;
122 protected:
123 // OWizardPage overridables
124 virtual void initializePage() SAL_OVERRIDE;
125 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
127 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
130 class OOptionValuesPage : public OGBWPage
132 protected:
133 VclPtr<Edit> m_pValue;
134 VclPtr<ListBox> m_pOptions;
136 StringArray m_aUncommittedValues;
137 ::svt::WizardTypes::WizardState
138 m_nLastSelection;
140 public:
141 OOptionValuesPage( OControlWizard* _pParent );
142 virtual ~OOptionValuesPage();
143 virtual void dispose() SAL_OVERRIDE;
145 protected:
146 // TabPage overridables
147 void ActivatePage() SAL_OVERRIDE;
149 // OWizardPage overridables
150 virtual void initializePage() SAL_OVERRIDE;
151 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
153 void implTraveledOptions();
155 DECL_LINK( OnOptionSelected, ListBox* );
158 class OOptionDBFieldPage : public ODBFieldPage
160 public:
161 OOptionDBFieldPage( OControlWizard* _pParent );
163 protected:
164 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
166 // ODBFieldPage overridables
167 virtual OUString& getDBFieldSetting() SAL_OVERRIDE;
170 class OFinalizeGBWPage : public OGBWPage
172 protected:
173 VclPtr<Edit> m_pName;
175 public:
176 OFinalizeGBWPage( OControlWizard* _pParent );
177 virtual ~OFinalizeGBWPage();
178 virtual void dispose() SAL_OVERRIDE;
180 protected:
181 // TabPage overridables
182 void ActivatePage() SAL_OVERRIDE;
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;
191 } // namespace dbp
194 #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */