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_DBACCESS_SOURCE_UI_DLG_CONNECTIONPAGE_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_DLG_CONNECTIONPAGE_HXX
22 
23 #include "ConnectionHelper.hxx"
24 #include "adminpages.hxx"
25 #include <ucbhelper/content.hxx>
26 #include <curledit.hxx>
27 
28 namespace dbaui
29 {
30 
31     // OConnectionTabPage
32 
33     /** implements the connection page of the data source properties dialog.
34     */
35     class OConnectionTabPage final : public OConnectionHelper
36     {
37     private:
38         // user authentication
39         std::unique_ptr<weld::Label> m_xFL2;
40         std::unique_ptr<weld::Label> m_xUserNameLabel;
41         std::unique_ptr<weld::Entry> m_xUserName;
42         std::unique_ptr<weld::CheckButton> m_xPasswordRequired;
43 
44         // jdbc driver
45         std::unique_ptr<weld::Label> m_xFL3;
46         std::unique_ptr<weld::Label> m_xJavaDriverLabel;
47         std::unique_ptr<weld::Entry> m_xJavaDriver;
48         std::unique_ptr<weld::Button> m_xTestJavaDriver;
49 
50         // connection test
51         std::unique_ptr<weld::Button> m_xTestConnection;
52 
53         // called when the test connection button was clicked
54         DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
55         DECL_LINK(OnEditModified, weld::Entry&, void);
56 
57     public:
58         OConnectionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs);
59         static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* _rAttrSet);
60         virtual ~OConnectionTabPage() override;
61         virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;
62 
63         virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
64 
65         /** changes the connection URL.
66             <p>The new URL must be of the type which is currently selected, only the parts which do not
67             affect the type may be changed (compared to the previous URL).</p>
68         */
69     private:
70         /** enables the test connection button, if allowed
71         */
72         virtual bool checkTestConnection() override;
73     };
74 }   // namespace dbaui
75 
76 #endif // INCLUDED_DBACCESS_SOURCE_UI_DLG_CONNECTIONPAGE_HXX
77 
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
79