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 INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GRIDWIZARD_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GRIDWIZARD_HXX
22 :
23 : #include "controlwizard.hxx"
24 : #include "commonpagesdbp.hxx"
25 :
26 :
27 : namespace dbp
28 : {
29 0 : struct OGridSettings : public OControlWizardSettings
30 : {
31 : ::com::sun::star::uno::Sequence< OUString > aSelectedFields;
32 : };
33 :
34 0 : class OGridWizard : public OControlWizard
35 : {
36 : protected:
37 : OGridSettings m_aSettings;
38 : bool m_bHadDataSelection : 1;
39 :
40 : public:
41 : OGridWizard(
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
45 : );
46 :
47 0 : OGridSettings& getSettings() { return m_aSettings; }
48 :
49 : protected:
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;
56 :
57 : virtual bool approveControl(sal_Int16 _nClassId) SAL_OVERRIDE;
58 :
59 : protected:
60 : void implApplySettings();
61 : };
62 :
63 0 : class OGridPage : public OControlWizardPage
64 : {
65 : public:
66 0 : OGridPage( OGridWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription ) : OControlWizardPage(_pParent, _rID, _rUIXMLDescription) { }
67 :
68 : protected:
69 0 : OGridSettings& getSettings() { return static_cast<OGridWizard*>(getDialog())->getSettings(); }
70 : };
71 :
72 : class OGridFieldsSelection : public OGridPage
73 : {
74 : protected:
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;
81 :
82 : public:
83 : OGridFieldsSelection( OGridWizard* _pParent );
84 : virtual ~OGridFieldsSelection();
85 : virtual void dispose() SAL_OVERRIDE;
86 :
87 : protected:
88 : // TabPage overridables
89 : virtual void ActivatePage() SAL_OVERRIDE;
90 :
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;
95 :
96 : protected:
97 : DECL_LINK(OnMoveOneEntry, PushButton*);
98 : DECL_LINK(OnMoveAllEntries, PushButton*);
99 : DECL_LINK(OnEntrySelected, ListBox*);
100 : DECL_LINK(OnEntryDoubleClicked, ListBox*);
101 :
102 : void implCheckButtons();
103 : void implApplySettings();
104 :
105 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > implGetColumns(bool _bShowError = true);
106 : };
107 :
108 :
109 : } // namespace dbp
110 :
111 :
112 : #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_GRIDWIZARD_HXX
113 :
114 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|