LibreOffice Module dbaccess (master) 1
detailpages.hxx
Go to the documentation of this file.
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#pragma once
21
22#include "adminpages.hxx"
23#include <charsetlistbox.hxx>
25#include "admincontrols.hxx"
26
28
30 NONE = 0x0000,
31 UseCharset = 0x0002,
32 UseOptions = 0x0004,
33};
34namespace o3tl {
35 template<> struct typed_flags<OCommonBehaviourTabPageFlags> : is_typed_flags<OCommonBehaviourTabPageFlags, 0x0006> {};
36}
37
38namespace dbaui
39{
47 {
49
50 std::unique_ptr<weld::Label> m_xOptionsLabel;
51 std::unique_ptr<weld::Entry> m_xOptions;
52
53 std::unique_ptr<weld::Label> m_xDataConvertLabel;
54 std::unique_ptr<weld::Label> m_xCharsetLabel;
55 std::unique_ptr<CharSetListBox> m_xCharset;
56
57 public:
58 virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) override;
59
60 OCommonBehaviourTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags);
61 protected:
62
63 virtual ~OCommonBehaviourTabPage() override;
64
65 // subclasses must override this, but it isn't pure virtual
66 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
67
68 // <method>OGenericAdministrationPage::fillControls</method>
69 virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
70
71 // <method>OGenericAdministrationPage::fillWindows</method>
72 virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
73 private:
74 DECL_LINK(CharsetSelectHdl, weld::ComboBox&, void);
75 };
76
77
78 // ODbaseDetailsPage
80 {
81 public:
82 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
83
84 ODbaseDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs);
85 virtual ~ODbaseDetailsPage() override;
86 private:
87 OUString m_sDsn;
88
89 std::unique_ptr<weld::CheckButton> m_xShowDeleted;
90 std::unique_ptr<weld::Label> m_xFT_Message;
91 std::unique_ptr<weld::Button> m_xIndexes;
92
93 protected:
94 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
95
96 private:
97 DECL_LINK(OnButtonClicked, weld::Button&, void);
98 DECL_LINK(OnButtonToggled, weld::Toggleable&, void);
99 };
100
101 // OAdoDetailsPage
103 {
104 public:
105 OAdoDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
106 };
107
108 // OOdbcDetailsPage
110 {
111 public:
112 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
113
114 OOdbcDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
115 virtual ~OOdbcDetailsPage() override;
116 protected:
117 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
118 private:
119 std::unique_ptr<weld::CheckButton> m_xUseCatalog;
120 };
121
122 // OUserDriverDetailsPage
124 {
125 public:
126 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
127
128 OUserDriverDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs);
129 virtual ~OUserDriverDetailsPage() override;
130 protected:
131 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
132 virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
133 virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
134 private:
135 std::unique_ptr<weld::Label> m_xFTHostname;
136 std::unique_ptr<weld::Entry> m_xEDHostname;
137 std::unique_ptr<weld::Label> m_xPortNumber;
138 std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
139 std::unique_ptr<weld::CheckButton> m_xUseCatalog;
140 };
141
142 // OMySQLODBCDetailsPage
144 {
145 public:
146 OMySQLODBCDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
147 };
148
149 // OGeneralSpecialJDBCDetailsPage
151 {
152 public:
154 const SfxItemSet& _rCoreAttrs,
155 sal_uInt16 _nPortId,
156 bool bShowSocket = true);
157 virtual ~OGeneralSpecialJDBCDetailsPage() override;
158
159 private:
160
161 virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
162 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
163 virtual void callModifiedHdl(weld::Widget* pControl = nullptr) override;
164
165 DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
166
170
171 std::unique_ptr<weld::Entry> m_xEDHostname;
172 std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
173 std::unique_ptr<weld::Label> m_xFTSocket;
174 std::unique_ptr<weld::Entry> m_xEDSocket;
175 std::unique_ptr<weld::Label> m_xFTDriverClass;
176 std::unique_ptr<weld::Entry> m_xEDDriverClass;
177 std::unique_ptr<weld::Button> m_xTestJavaDriver;
178 };
179
180 // MySQLNativePage
182 {
183 public:
184 MySQLNativePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
185 virtual ~MySQLNativePage() override;
186
187 private:
188 std::unique_ptr<weld::Widget> m_xMySQLSettingsContainer;
189 std::unique_ptr<MySQLNativeSettings> m_xMySQLSettings;
190 std::unique_ptr<weld::Label> m_xSeparator1;
191 std::unique_ptr<weld::Label> m_xSeparator2;
192 std::unique_ptr<weld::Label> m_xUserNameLabel;
193 std::unique_ptr<weld::Entry> m_xUserName;
194 std::unique_ptr<weld::CheckButton> m_xPasswordRequired;
195
196 protected:
197 virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
198 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
199 virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
200 virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
201 };
202
203 // OOdbcDetailsPage
205 {
206 public:
207 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
208
209 OLDAPDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
210 virtual ~OLDAPDetailsPage() override;
211 protected:
212 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
213 private:
214 sal_Int32 m_iSSLPort;
215 sal_Int32 m_iNormalPort;
216
217 std::unique_ptr<weld::Entry> m_xETBaseDN;
218 std::unique_ptr<weld::CheckButton> m_xCBUseSSL;
219 std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
220 std::unique_ptr<weld::SpinButton> m_xNFRowCount;
221
222 DECL_LINK(OnCheckBoxClick, weld::Toggleable&, void);
223 };
224
225 // OTextDetailsPage
227 {
228 public:
229 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
230
231 OTextDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
232 virtual ~OTextDetailsPage() override;
233
234 protected:
235 virtual bool prepareLeave() override;
236
237 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
238 virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
239 virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
240
241 private:
242 std::unique_ptr<OTextConnectionHelper> m_xTextConnectionHelper;
243 };
244
245} // namespace dbaui
246
247/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::Label > m_xSeparator2
std::unique_ptr< weld::Entry > m_xUserName
std::unique_ptr< weld::Label > m_xUserNameLabel
std::unique_ptr< weld::Widget > m_xMySQLSettingsContainer
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
std::unique_ptr< weld::Label > m_xSeparator1
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
MySQLNativePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual ~MySQLNativePage() override
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< MySQLNativeSettings > m_xMySQLSettings
std::unique_ptr< weld::CheckButton > m_xPasswordRequired
OAdoDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
eases the implementation of tab pages handling user/password and/or character set and/or generic opti...
Definition: detailpages.hxx:47
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::Label > m_xCharsetLabel
Definition: detailpages.hxx:54
std::unique_ptr< weld::Label > m_xOptionsLabel
Definition: detailpages.hxx:50
virtual ~OCommonBehaviourTabPage() override
Definition: detailpages.cxx:86
OCommonBehaviourTabPage(weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OUString &rId, const SfxItemSet &_rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags)
Definition: detailpages.cxx:54
std::unique_ptr< weld::Entry > m_xOptions
Definition: detailpages.hxx:51
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
Definition: detailpages.cxx:91
std::unique_ptr< weld::Label > m_xDataConvertLabel
Definition: detailpages.hxx:53
DECL_LINK(CharsetSelectHdl, weld::ComboBox &, void)
std::unique_ptr< CharSetListBox > m_xCharset
Definition: detailpages.hxx:55
OCommonBehaviourTabPageFlags m_nControlFlags
Definition: detailpages.hxx:48
std::unique_ptr< weld::Button > m_xIndexes
Definition: detailpages.hxx:91
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::Label > m_xFT_Message
Definition: detailpages.hxx:90
ODbaseDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
virtual ~ODbaseDetailsPage() override
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
DECL_LINK(OnButtonClicked, weld::Button &, void)
DECL_LINK(OnButtonToggled, weld::Toggleable &, void)
std::unique_ptr< weld::CheckButton > m_xShowDeleted
Definition: detailpages.hxx:89
std::unique_ptr< weld::Button > m_xTestJavaDriver
std::unique_ptr< weld::Label > m_xFTDriverClass
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual ~OGeneralSpecialJDBCDetailsPage() override
std::unique_ptr< weld::Label > m_xFTSocket
std::unique_ptr< weld::Entry > m_xEDHostname
TypedWhichId< SfxInt32Item > m_nPortId
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual void callModifiedHdl(weld::Widget *pControl=nullptr) override
OGeneralSpecialJDBCDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs, sal_uInt16 _nPortId, bool bShowSocket=true)
DECL_LINK(OnTestJavaClickHdl, weld::Button &, void)
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
std::unique_ptr< weld::Entry > m_xEDDriverClass
std::unique_ptr< weld::Entry > m_xEDSocket
std::unique_ptr< weld::Entry > m_xETBaseDN
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::CheckButton > m_xCBUseSSL
virtual ~OLDAPDetailsPage() override
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
OLDAPDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
std::unique_ptr< weld::SpinButton > m_xNFRowCount
DECL_LINK(OnCheckBoxClick, weld::Toggleable &, void)
OMySQLODBCDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::CheckButton > m_xUseCatalog
virtual ~OOdbcDetailsPage() override
OOdbcDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
std::unique_ptr< OTextConnectionHelper > m_xTextConnectionHelper
virtual ~OTextDetailsPage() override
virtual bool prepareLeave() override
called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_T...
OTextDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::Entry > m_xEDHostname
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
OUserDriverDetailsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::Label > m_xPortNumber
virtual ~OUserDriverDetailsPage() override
std::unique_ptr< weld::CheckButton > m_xUseCatalog
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::Label > m_xFTHostname
OCommonBehaviourTabPageFlags
Definition: detailpages.hxx:29
NONE