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_GRIDWIZARD_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GRIDWIZARD_HXX
23 #include "controlwizard.hxx"
24 #include "commonpagesdbp.hxx"
29 struct OGridSettings
: public OControlWizardSettings
31 ::com::sun::star::uno::Sequence
< OUString
> aSelectedFields
;
34 class OGridWizard
: public OControlWizard
37 OGridSettings m_aSettings
;
38 bool m_bHadDataSelection
: 1;
42 vcl::Window
* _pParent
,
43 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxObjectModel
,
44 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxContext
47 OGridSettings
& getSettings() { return m_aSettings
; }
50 // OWizardMachine overridables
51 virtual VclPtr
<TabPage
> createPage( WizardState _nState
) SAL_OVERRIDE
;
52 virtual WizardState
determineNextState( WizardState _nCurrentState
) const SAL_OVERRIDE
;
53 virtual void enterState( WizardState _nState
) SAL_OVERRIDE
;
54 virtual bool leaveState( WizardState _nState
) SAL_OVERRIDE
;
55 virtual bool onFinish() SAL_OVERRIDE
;
57 virtual bool approveControl(sal_Int16 _nClassId
) SAL_OVERRIDE
;
60 void implApplySettings();
63 class OGridPage
: public OControlWizardPage
66 OGridPage( OGridWizard
* _pParent
, const OString
& _rID
, const OUString
& _rUIXMLDescription
) : OControlWizardPage(_pParent
, _rID
, _rUIXMLDescription
) { }
69 OGridSettings
& getSettings() { return static_cast<OGridWizard
*>(getDialog())->getSettings(); }
72 class OGridFieldsSelection
: public OGridPage
75 VclPtr
<ListBox
> m_pExistFields
;
76 VclPtr
<PushButton
> m_pSelectOne
;
77 VclPtr
<PushButton
> m_pSelectAll
;
78 VclPtr
<PushButton
> m_pDeselectOne
;
79 VclPtr
<PushButton
> m_pDeselectAll
;
80 VclPtr
<ListBox
> m_pSelFields
;
83 OGridFieldsSelection( OGridWizard
* _pParent
);
84 virtual ~OGridFieldsSelection();
85 virtual void dispose() SAL_OVERRIDE
;
88 // TabPage overridables
89 virtual void ActivatePage() SAL_OVERRIDE
;
91 // OWizardPage overridables
92 virtual void initializePage() SAL_OVERRIDE
;
93 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason
) SAL_OVERRIDE
;
94 virtual bool canAdvance() const SAL_OVERRIDE
;
97 DECL_LINK(OnMoveOneEntry
, PushButton
*);
98 DECL_LINK(OnMoveAllEntries
, PushButton
*);
99 DECL_LINK(OnEntrySelected
, ListBox
*);
100 DECL_LINK(OnEntryDoubleClicked
, ListBox
*);
102 void implCheckButtons();
103 void implApplySettings();
105 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> implGetColumns(bool _bShowError
= true);
112 #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GRIDWIZARD_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */