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_COMMONPAGESDBP_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX
22 :
23 : #include "controlwizard.hxx"
24 : #include <vcl/fixed.hxx>
25 : #include <vcl/lstbox.hxx>
26 : #include <com/sun/star/sdb/XDatabaseContext.hpp>
27 :
28 :
29 : namespace dbp
30 : {
31 :
32 :
33 :
34 : //= OTableSelectionPage
35 :
36 0 : class OTableSelectionPage : public OControlWizardPage
37 : {
38 : protected:
39 : FixedText *m_pDatasourceLabel;
40 : ListBox *m_pDatasource;
41 : PushButton *m_pSearchDatabase;
42 : ListBox *m_pTable;
43 :
44 : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
45 : m_xDSContext;
46 :
47 : public:
48 : OTableSelectionPage(OControlWizard* _pParent);
49 :
50 : protected:
51 : // TabPage overridables
52 : void ActivatePage() SAL_OVERRIDE;
53 :
54 : // OWizardPage overridables
55 : virtual void initializePage() SAL_OVERRIDE;
56 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
57 :
58 : protected:
59 : DECL_LINK( OnListboxSelection, ListBox* );
60 : DECL_LINK( OnListboxDoubleClicked, ListBox* );
61 : DECL_LINK( OnSearchClicked, PushButton* );
62 :
63 : void implCollectDatasource();
64 : void implFillTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >&
65 : _rxConn = ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >());
66 :
67 : // OControlWizardPage overridables
68 : virtual bool canAdvance() const SAL_OVERRIDE;
69 : };
70 :
71 :
72 : //= OMaybeListSelectionPage
73 :
74 0 : class OMaybeListSelectionPage : public OControlWizardPage
75 : {
76 : protected:
77 : RadioButton* m_pYes;
78 : RadioButton* m_pNo;
79 : ListBox* m_pList;
80 :
81 : public:
82 : OMaybeListSelectionPage( OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription );
83 :
84 : protected:
85 : DECL_LINK( OnRadioSelected, RadioButton* );
86 :
87 : // TabPage overridables
88 : void ActivatePage() SAL_OVERRIDE;
89 :
90 : // own helper
91 : void announceControls(
92 : RadioButton& _rYesButton,
93 : RadioButton& _rNoButton,
94 : ListBox& _rSelection);
95 :
96 : void implEnableWindows();
97 :
98 : void implInitialize(const OUString& _rSelection);
99 : void implCommit(OUString& _rSelection);
100 : };
101 :
102 :
103 : //= ODBFieldPage
104 :
105 0 : class ODBFieldPage : public OMaybeListSelectionPage
106 : {
107 : protected:
108 : FixedText* m_pDescription;
109 : RadioButton* m_pStoreYes;
110 : RadioButton* m_pStoreNo;
111 : ListBox* m_pStoreWhere;
112 :
113 : public:
114 : ODBFieldPage( OControlWizard* _pParent );
115 :
116 : protected:
117 0 : void setDescriptionText(const OUString& _rDesc) { m_pDescription->SetText(_rDesc); }
118 :
119 : // OWizardPage overridables
120 : virtual void initializePage() SAL_OVERRIDE;
121 : virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
122 :
123 : // own overridables
124 : virtual OUString& getDBFieldSetting() = 0;
125 : };
126 :
127 :
128 : } // namespace dbp
129 :
130 :
131 :
132 : #endif // INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX
133 :
134 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|