merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / dbpilots / gridwizard.hxx
blob85b91d274345a699585f4eb301bb869e377cca8e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _EXTENSIONS_DBP_GRIDWIZARD_HXX_
29 #define _EXTENSIONS_DBP_GRIDWIZARD_HXX_
31 #include "controlwizard.hxx"
32 #include "commonpagesdbp.hxx"
34 //.........................................................................
35 namespace dbp
37 //.........................................................................
39 //=====================================================================
40 //= OGridSettings
41 //=====================================================================
42 struct OGridSettings : public OControlWizardSettings
44 ::com::sun::star::uno::Sequence< ::rtl::OUString > aSelectedFields;
47 //=====================================================================
48 //= OGridWizard
49 //=====================================================================
50 class OGridWizard : public OControlWizard
52 protected:
53 OGridSettings m_aSettings;
54 sal_Bool m_bHadDataSelection : 1;
56 public:
57 OGridWizard(
58 Window* _pParent,
59 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel,
60 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
63 OGridSettings& getSettings() { return m_aSettings; }
65 protected:
66 // OWizardMachine overridables
67 virtual ::svt::OWizardPage* createPage( WizardState _nState );
68 virtual WizardState determineNextState( WizardState _nCurrentState ) const;
69 virtual void enterState( WizardState _nState );
70 virtual sal_Bool leaveState( WizardState _nState );
71 virtual sal_Bool onFinish();
73 virtual sal_Bool approveControl(sal_Int16 _nClassId);
75 protected:
76 void implApplySettings();
79 //=====================================================================
80 //= OGridPage
81 //=====================================================================
82 class OGridPage : public OControlWizardPage
84 public:
85 OGridPage( OGridWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
87 protected:
88 OGridSettings& getSettings() { return static_cast<OGridWizard*>(getDialog())->getSettings(); }
91 //=====================================================================
92 //= OGridFieldsSelection
93 //=====================================================================
94 class OGridFieldsSelection : public OGridPage
96 protected:
97 FixedLine m_aFrame;
98 FixedText m_aExistFieldsLabel;
99 ListBox m_aExistFields;
100 PushButton m_aSelectOne;
101 PushButton m_aSelectAll;
102 PushButton m_aDeselectOne;
103 PushButton m_aDeselectAll;
104 FixedText m_aSelFieldsLabel;
105 ListBox m_aSelFields;
107 public:
108 OGridFieldsSelection( OGridWizard* _pParent );
110 protected:
111 // TabPage overridables
112 virtual void ActivatePage();
114 // OWizardPage overridables
115 virtual void initializePage();
116 virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
117 virtual bool canAdvance() const;
119 protected:
120 DECL_LINK(OnMoveOneEntry, PushButton*);
121 DECL_LINK(OnMoveAllEntries, PushButton*);
122 DECL_LINK(OnEntrySelected, ListBox*);
123 DECL_LINK(OnEntryDoubleClicked, ListBox*);
125 void implCheckButtons();
126 void implApplySettings();
128 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > implGetColumns(sal_Bool _bShowError = sal_True);
131 //.........................................................................
132 } // namespace dbp
133 //.........................................................................
135 #endif // _EXTENSIONS_DBP_GRIDWIZARD_HXX_