Line data Source code
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 : #ifndef _EXTENSIONS_DBP_GRIDWIZARD_HXX_
21 : #define _EXTENSIONS_DBP_GRIDWIZARD_HXX_
22 :
23 : #include "controlwizard.hxx"
24 : #include "commonpagesdbp.hxx"
25 :
26 : //.........................................................................
27 : namespace dbp
28 : {
29 : //.........................................................................
30 :
31 : //=====================================================================
32 : //= OGridSettings
33 : //=====================================================================
34 0 : struct OGridSettings : public OControlWizardSettings
35 : {
36 : ::com::sun::star::uno::Sequence< ::rtl::OUString > aSelectedFields;
37 : };
38 :
39 : //=====================================================================
40 : //= OGridWizard
41 : //=====================================================================
42 0 : class OGridWizard : public OControlWizard
43 : {
44 : protected:
45 : OGridSettings m_aSettings;
46 : sal_Bool m_bHadDataSelection : 1;
47 :
48 : public:
49 : OGridWizard(
50 : Window* _pParent,
51 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel,
52 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
53 : );
54 :
55 0 : OGridSettings& getSettings() { return m_aSettings; }
56 :
57 : protected:
58 : // OWizardMachine overridables
59 : virtual ::svt::OWizardPage* createPage( WizardState _nState );
60 : virtual WizardState determineNextState( WizardState _nCurrentState ) const;
61 : virtual void enterState( WizardState _nState );
62 : virtual sal_Bool leaveState( WizardState _nState );
63 : virtual sal_Bool onFinish();
64 :
65 : virtual sal_Bool approveControl(sal_Int16 _nClassId);
66 :
67 : protected:
68 : void implApplySettings();
69 : };
70 :
71 : //=====================================================================
72 : //= OGridPage
73 : //=====================================================================
74 0 : class OGridPage : public OControlWizardPage
75 : {
76 : public:
77 0 : OGridPage( OGridWizard* _pParent, const ResId& _rId ) : OControlWizardPage(_pParent, _rId) { }
78 :
79 : protected:
80 0 : OGridSettings& getSettings() { return static_cast<OGridWizard*>(getDialog())->getSettings(); }
81 : };
82 :
83 : //=====================================================================
84 : //= OGridFieldsSelection
85 : //=====================================================================
86 0 : class OGridFieldsSelection : public OGridPage
87 : {
88 : protected:
89 : FixedLine m_aFrame;
90 : FixedText m_aExistFieldsLabel;
91 : ListBox m_aExistFields;
92 : PushButton m_aSelectOne;
93 : PushButton m_aSelectAll;
94 : PushButton m_aDeselectOne;
95 : PushButton m_aDeselectAll;
96 : FixedText m_aSelFieldsLabel;
97 : ListBox m_aSelFields;
98 :
99 : public:
100 : OGridFieldsSelection( OGridWizard* _pParent );
101 :
102 : protected:
103 : // TabPage overridables
104 : virtual void ActivatePage();
105 :
106 : // OWizardPage overridables
107 : virtual void initializePage();
108 : virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
109 : virtual bool canAdvance() const;
110 :
111 : protected:
112 : DECL_LINK(OnMoveOneEntry, PushButton*);
113 : DECL_LINK(OnMoveAllEntries, PushButton*);
114 : DECL_LINK(OnEntrySelected, ListBox*);
115 : DECL_LINK(OnEntryDoubleClicked, ListBox*);
116 :
117 : void implCheckButtons();
118 : void implApplySettings();
119 :
120 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > implGetColumns(sal_Bool _bShowError = sal_True);
121 : };
122 :
123 : //.........................................................................
124 : } // namespace dbp
125 : //.........................................................................
126 :
127 : #endif // _EXTENSIONS_DBP_GRIDWIZARD_HXX_
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|