bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / dbpilots / groupboxwiz.hxx
blobf00320e21c6814cbae2d85e963923adf31d82a92
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 std::vector<OUString> aLabels;
33 std::vector<OUString> aValues;
34 OUString sDefaultField;
35 OUString sDBField;
38 class OGroupBoxWizard final : public OControlWizard
40 OOptionGroupSettings m_aSettings;
42 bool m_bVisitedDefault : 1;
43 bool m_bVisitedDB : 1;
45 public:
46 OGroupBoxWizard(
47 vcl::Window* _pParent,
48 const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel,
49 const css::uno::Reference< css::uno::XComponentContext >& _rxContext
52 OOptionGroupSettings& getSettings() { return m_aSettings; }
54 private:
55 // OWizardMachine overridables
56 virtual VclPtr<TabPage> createPage( WizardState _nState ) override;
57 virtual WizardState determineNextState( WizardState _nCurrentState ) const override;
58 virtual void enterState( WizardState _nState ) override;
59 virtual bool onFinish() override;
61 virtual bool approveControl(sal_Int16 _nClassId) override;
64 class OGBWPage : public OControlWizardPage
66 public:
67 OGBWPage(OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription)
68 : OControlWizardPage(_pParent, _rID, _rUIXMLDescription)
72 protected:
73 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
76 class ORadioSelectionPage final : public OGBWPage
78 VclPtr<Edit> m_pRadioName;
79 VclPtr<PushButton> m_pMoveRight;
80 VclPtr<PushButton> m_pMoveLeft;
81 VclPtr<ListBox> m_pExistingRadios;
83 public:
84 explicit ORadioSelectionPage( OControlWizard* _pParent );
85 virtual ~ORadioSelectionPage() override;
86 virtual void dispose() override;
88 private:
89 // TabPage overridables
90 void ActivatePage() override;
92 // OWizardPage overridables
93 virtual void initializePage() override;
94 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
95 virtual bool canAdvance() const override;
97 DECL_LINK( OnMoveEntry, Button*, void );
98 DECL_LINK( OnEntrySelected, ListBox&, void );
99 DECL_LINK( OnNameModified, Edit&, void );
101 void implCheckMoveButtons();
104 class ODefaultFieldSelectionPage final : public OMaybeListSelectionPage
106 VclPtr<RadioButton> m_pDefSelYes;
107 VclPtr<RadioButton> m_pDefSelNo;
108 VclPtr<ListBox> m_pDefSelection;
110 public:
111 explicit ODefaultFieldSelectionPage( OControlWizard* _pParent );
112 virtual ~ODefaultFieldSelectionPage() override;
113 virtual void dispose() override;
115 private:
116 // OWizardPage overridables
117 virtual void initializePage() override;
118 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
120 OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
123 class OOptionValuesPage final : public OGBWPage
125 VclPtr<Edit> m_pValue;
126 VclPtr<ListBox> m_pOptions;
128 std::vector<OUString> m_aUncommittedValues;
129 ::svt::WizardTypes::WizardState
130 m_nLastSelection;
132 public:
133 explicit OOptionValuesPage( OControlWizard* _pParent );
134 virtual ~OOptionValuesPage() override;
135 virtual void dispose() override;
137 private:
138 // TabPage overridables
139 void ActivatePage() override;
141 // OWizardPage overridables
142 virtual void initializePage() override;
143 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
145 void implTraveledOptions();
147 DECL_LINK( OnOptionSelected, ListBox&, void );
150 class OOptionDBFieldPage : public ODBFieldPage
152 public:
153 explicit OOptionDBFieldPage( OControlWizard* _pParent );
155 protected:
156 // ODBFieldPage overridables
157 virtual OUString& getDBFieldSetting() override;
160 class OFinalizeGBWPage final : public OGBWPage
162 VclPtr<Edit> m_pName;
164 public:
165 explicit OFinalizeGBWPage( OControlWizard* _pParent );
166 virtual ~OFinalizeGBWPage() override;
167 virtual void dispose() override;
169 private:
170 // TabPage overridables
171 void ActivatePage() override;
173 // OWizardPage overridables
174 virtual void initializePage() override;
175 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
176 virtual bool canAdvance() const override;
180 } // namespace dbp
183 #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */