LibreOffice Module extensions (master) 1
groupboxwiz.hxx
Go to the documentation of this file.
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#pragma once
21
22#include "controlwizard.hxx"
23#include "commonpagesdbp.hxx"
24
27
28namespace dbp
29{
30
32 {
33 std::vector<OUString> aLabels;
34 std::vector<OUString> aValues;
35 OUString sDefaultField;
36 OUString sDBField;
37 };
38
39 class OGroupBoxWizard final : public OControlWizard
40 {
42
44 bool m_bVisitedDB : 1;
45
46 public:
48 weld::Window* _pParent,
49 const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel,
50 const css::uno::Reference< css::uno::XComponentContext >& _rxContext
51 );
52
54
55 private:
56 // OWizardMachine overridables
57 virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
58 virtual WizardState determineNextState( WizardState _nCurrentState ) const override;
59 virtual void enterState( WizardState _nState ) override;
60 virtual bool onFinish() override;
61
62 virtual bool approveControl(sal_Int16 _nClassId) override;
63 };
64
66 {
67 public:
68 OGBWPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID)
69 : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID)
70 {
71 }
72
73 protected:
75 };
76
77 class ORadioSelectionPage final : public OGBWPage
78 {
79 std::unique_ptr<weld::Entry> m_xRadioName;
80 std::unique_ptr<weld::Button> m_xMoveRight;
81 std::unique_ptr<weld::Button> m_xMoveLeft;
82 std::unique_ptr<weld::TreeView> m_xExistingRadios;
83
84 public:
85 explicit ORadioSelectionPage(weld::Container* pPage, OControlWizard* pWizard);
86 virtual ~ORadioSelectionPage() override;
87
88 private:
89 // BuilderPage overridables
90 void Activate() override;
91
92 // OWizardPage overridables
93 virtual void initializePage() override;
94 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
95 virtual bool canAdvance() const override;
96
97 DECL_LINK( OnMoveEntry, weld::Button&, void );
98 DECL_LINK( OnEntrySelected, weld::TreeView&, void );
99 DECL_LINK( OnNameModified, weld::Entry&, void );
100
102 };
103
105 {
106 std::unique_ptr<weld::RadioButton> m_xDefSelYes;
107 std::unique_ptr<weld::RadioButton> m_xDefSelNo;
108 std::unique_ptr<weld::ComboBox> m_xDefSelection;
109
110 public:
112 virtual ~ODefaultFieldSelectionPage() override;
113
114 private:
115 // OWizardPage overridables
116 virtual void initializePage() override;
117 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
118
120 };
121
122 class OOptionValuesPage final : public OGBWPage
123 {
124 std::unique_ptr<weld::Entry> m_xValue;
125 std::unique_ptr<weld::TreeView> m_xOptions;
126
127 std::vector<OUString> m_aUncommittedValues;
130
131 public:
132 explicit OOptionValuesPage(weld::Container* pPage, OControlWizard* pWizard);
133 virtual ~OOptionValuesPage() override;
134
135 private:
136 // BuilderPage overridables
137 void Activate() override;
138
139 // OWizardPage overridables
140 virtual void initializePage() override;
141 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
142
143 void implTraveledOptions();
144
145 DECL_LINK( OnOptionSelected, weld::TreeView&, void );
146 };
147
149 {
150 public:
151 explicit OOptionDBFieldPage(weld::Container* pPage, OControlWizard* pWizard);
152
153 protected:
154 // ODBFieldPage overridables
155 virtual OUString& getDBFieldSetting() override;
156 };
157
158 class OFinalizeGBWPage final : public OGBWPage
159 {
160 std::unique_ptr<weld::Entry> m_xName;
161
162 public:
163 explicit OFinalizeGBWPage(weld::Container* pPage, OControlWizard* pWizard);
164 virtual ~OFinalizeGBWPage() override;
165
166 private:
167 // BuilderPage overridables
168 void Activate() override;
169
170 // OWizardPage overridables
171 virtual void initializePage() override;
172 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
173 virtual bool canAdvance() const override;
174 };
175
176
177} // namespace dbp
178
179
180/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OControlWizard * getDialog()
std::unique_ptr< weld::RadioButton > m_xDefSelNo
virtual void initializePage() override
ODefaultFieldSelectionPage(weld::Container *pPage, OControlWizard *pWizard)
std::unique_ptr< weld::RadioButton > m_xDefSelYes
virtual ~ODefaultFieldSelectionPage() override
OOptionGroupSettings & getSettings()
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
std::unique_ptr< weld::ComboBox > m_xDefSelection
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
OFinalizeGBWPage(weld::Container *pPage, OControlWizard *pWizard)
virtual bool canAdvance() const override
virtual void initializePage() override
virtual ~OFinalizeGBWPage() override
std::unique_ptr< weld::Entry > m_xName
void Activate() override
OOptionGroupSettings & getSettings()
Definition: groupboxwiz.hxx:74
OGBWPage(weld::Container *pPage, OControlWizard *pWizard, const OUString &rUIXMLDescription, const OUString &rID)
Definition: groupboxwiz.hxx:68
OGroupBoxWizard(weld::Window *_pParent, const css::uno::Reference< css::beans::XPropertySet > &_rxObjectModel, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
Definition: groupboxwiz.cxx:41
OOptionGroupSettings m_aSettings
Definition: groupboxwiz.hxx:41
virtual std::unique_ptr< BuilderPage > createPage(WizardState _nState) override
Definition: groupboxwiz.cxx:61
virtual WizardState determineNextState(WizardState _nCurrentState) const override
Definition: groupboxwiz.cxx:87
virtual bool approveControl(sal_Int16 _nClassId) override
Definition: groupboxwiz.cxx:56
virtual void enterState(WizardState _nState) override
virtual bool onFinish() override
OOptionGroupSettings & getSettings()
Definition: groupboxwiz.hxx:53
OOptionDBFieldPage(weld::Container *pPage, OControlWizard *pWizard)
virtual OUString & getDBFieldSetting() override
void Activate() override
DECL_LINK(OnOptionSelected, weld::TreeView &, void)
std::unique_ptr< weld::TreeView > m_xOptions
virtual void initializePage() override
OOptionValuesPage(weld::Container *pPage, OControlWizard *pWizard)
virtual ~OOptionValuesPage() override
std::unique_ptr< weld::Entry > m_xValue
std::vector< OUString > m_aUncommittedValues
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
::vcl::WizardTypes::WizardState m_nLastSelection
void Activate() override
DECL_LINK(OnMoveEntry, weld::Button &, void)
std::unique_ptr< weld::Entry > m_xRadioName
Definition: groupboxwiz.hxx:79
std::unique_ptr< weld::Button > m_xMoveRight
Definition: groupboxwiz.hxx:80
DECL_LINK(OnNameModified, weld::Entry &, void)
virtual ~ORadioSelectionPage() override
virtual bool canAdvance() const override
std::unique_ptr< weld::TreeView > m_xExistingRadios
Definition: groupboxwiz.hxx:82
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
std::unique_ptr< weld::Button > m_xMoveLeft
Definition: groupboxwiz.hxx:81
virtual void initializePage() override
ORadioSelectionPage(weld::Container *pPage, OControlWizard *pWizard)
DECL_LINK(OnEntrySelected, weld::TreeView &, void)
sal_Int16 WizardState
std::vector< OUString > aLabels
Definition: groupboxwiz.hxx:33
std::vector< OUString > aValues
Definition: groupboxwiz.hxx:34