1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
30 struct OOptionGroupSettings
: public OControlWizardSettings
34 OUString sDefaultField
;
39 class OGroupBoxWizard
: public OControlWizard
42 OOptionGroupSettings m_aSettings
;
44 bool m_bVisitedDefault
: 1;
45 bool m_bVisitedDB
: 1;
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
; }
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
;
69 class OGBWPage
: public OControlWizardPage
72 OGBWPage(OControlWizard
* _pParent
, const OString
& _rID
, const OUString
& _rUIXMLDescription
)
73 : OControlWizardPage(_pParent
, _rID
, _rUIXMLDescription
)
78 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
81 class ORadioSelectionPage
: public OGBWPage
84 VclPtr
<Edit
> m_pRadioName
;
85 VclPtr
<PushButton
> m_pMoveRight
;
86 VclPtr
<PushButton
> m_pMoveLeft
;
87 VclPtr
<ListBox
> m_pExistingRadios
;
90 ORadioSelectionPage( OControlWizard
* _pParent
);
91 virtual ~ORadioSelectionPage();
92 virtual void dispose() SAL_OVERRIDE
;
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
113 VclPtr
<RadioButton
> m_pDefSelYes
;
114 VclPtr
<RadioButton
> m_pDefSelNo
;
115 VclPtr
<ListBox
> m_pDefSelection
;
118 ODefaultFieldSelectionPage( OControlWizard
* _pParent
);
119 virtual ~ODefaultFieldSelectionPage();
120 virtual void dispose() SAL_OVERRIDE
;
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
133 VclPtr
<Edit
> m_pValue
;
134 VclPtr
<ListBox
> m_pOptions
;
136 StringArray m_aUncommittedValues
;
137 ::svt::WizardTypes::WizardState
141 OOptionValuesPage( OControlWizard
* _pParent
);
142 virtual ~OOptionValuesPage();
143 virtual void dispose() SAL_OVERRIDE
;
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
161 OOptionDBFieldPage( OControlWizard
* _pParent
);
164 OOptionGroupSettings
& getSettings() { return static_cast<OGroupBoxWizard
*>(getDialog())->getSettings(); }
166 // ODBFieldPage overridables
167 virtual OUString
& getDBFieldSetting() SAL_OVERRIDE
;
170 class OFinalizeGBWPage
: public OGBWPage
173 VclPtr
<Edit
> m_pName
;
176 OFinalizeGBWPage( OControlWizard
* _pParent
);
177 virtual ~OFinalizeGBWPage();
178 virtual void dispose() SAL_OVERRIDE
;
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
;
194 #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GROUPBOXWIZ_HXX
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */