android: Update app icon to new startcenter icon
[LibreOffice.git] / dbaccess / source / ui / dlg / detailpages.hxx
blobaa01c12f930eb714847e54d445085dbab77016e7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "adminpages.hxx"
23 #include <charsetlistbox.hxx>
24 #include "TextConnectionHelper.hxx"
25 #include "admincontrols.hxx"
27 #include <o3tl/typed_flags_set.hxx>
29 enum class OCommonBehaviourTabPageFlags {
30 NONE = 0x0000,
31 UseCharset = 0x0002,
32 UseOptions = 0x0004,
34 namespace o3tl {
35 template<> struct typed_flags<OCommonBehaviourTabPageFlags> : is_typed_flags<OCommonBehaviourTabPageFlags, 0x0006> {};
38 namespace dbaui
40 /** eases the implementation of tab pages handling user/password and/or character
41 set and/or generic options input
42 <BR>
43 The controls to be used have to be defined within the resource, as usual, but
44 this class does all the handling necessary.
46 class OCommonBehaviourTabPage : public OGenericAdministrationPage
48 OCommonBehaviourTabPageFlags m_nControlFlags;
50 std::unique_ptr<weld::Label> m_xOptionsLabel;
51 std::unique_ptr<weld::Entry> m_xOptions;
53 std::unique_ptr<weld::Label> m_xDataConvertLabel;
54 std::unique_ptr<weld::Label> m_xCharsetLabel;
55 std::unique_ptr<CharSetListBox> m_xCharset;
57 public:
58 virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) override;
60 OCommonBehaviourTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rId, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags);
61 protected:
63 virtual ~OCommonBehaviourTabPage() override;
65 // subclasses must override this, but it isn't pure virtual
66 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
68 // <method>OGenericAdministrationPage::fillControls</method>
69 virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
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);
78 // ODbaseDetailsPage
79 class ODbaseDetailsPage : public OCommonBehaviourTabPage
81 public:
82 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
84 ODbaseDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs);
85 virtual ~ODbaseDetailsPage() override;
86 private:
87 OUString m_sDsn;
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;
93 protected:
94 virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
96 private:
97 DECL_LINK(OnButtonClicked, weld::Button&, void);
98 DECL_LINK(OnButtonToggled, weld::Toggleable&, void);
101 // OAdoDetailsPage
102 class OAdoDetailsPage : public OCommonBehaviourTabPage
104 public:
105 OAdoDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
108 // OOdbcDetailsPage
109 class OOdbcDetailsPage : public OCommonBehaviourTabPage
111 public:
112 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
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;
122 // OUserDriverDetailsPage
123 class OUserDriverDetailsPage : public OCommonBehaviourTabPage
125 public:
126 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
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;
142 // OMySQLODBCDetailsPage
143 class OMySQLODBCDetailsPage : public OCommonBehaviourTabPage
145 public:
146 OMySQLODBCDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
149 // OGeneralSpecialJDBCDetailsPage
150 class OGeneralSpecialJDBCDetailsPage final : public OCommonBehaviourTabPage
152 public:
153 OGeneralSpecialJDBCDetailsPage(weld::Container* pPage, weld::DialogController* pController,
154 const SfxItemSet& _rCoreAttrs,
155 sal_uInt16 _nPortId,
156 bool bShowSocket = true);
157 virtual ~OGeneralSpecialJDBCDetailsPage() override;
159 private:
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;
165 DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
167 OUString m_sDefaultJdbcDriverName;
168 TypedWhichId<SfxInt32Item> m_nPortId;
169 bool m_bUseClass;
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;
180 // MySQLNativePage
181 class MySQLNativePage : public OCommonBehaviourTabPage
183 public:
184 MySQLNativePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
185 virtual ~MySQLNativePage() override;
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;
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;
203 // OOdbcDetailsPage
204 class OLDAPDetailsPage : public OCommonBehaviourTabPage
206 public:
207 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
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;
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;
222 DECL_LINK(OnCheckBoxClick, weld::Toggleable&, void);
225 // OTextDetailsPage
226 class OTextDetailsPage : public OCommonBehaviourTabPage
228 public:
229 virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
231 OTextDetailsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
232 virtual ~OTextDetailsPage() override;
234 protected:
235 virtual bool prepareLeave() override;
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;
241 private:
242 std::unique_ptr<OTextConnectionHelper> m_xTextConnectionHelper;
245 } // namespace dbaui
247 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */