Use correct object
[LibreOffice.git] / cui / source / options / connpooloptions.hxx
blob2413f0d16de332fa71831a77a217dfb28b7574e1
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 <sfx2/tabdlg.hxx>
23 #include <com/sun/star/configuration/ReadWriteAccess.hpp>
25 #include "connpoolsettings.hxx"
27 namespace offapp
29 class ConnectionPoolOptionsPage final : public SfxTabPage
31 OUString m_sYes;
32 OUString m_sNo;
33 DriverPoolingSettings m_aSettings;
34 DriverPoolingSettings m_aSavedSettings;
36 css::uno::Reference< css::configuration::XReadWriteAccess> m_xReadWriteAccess;
38 std::unique_ptr<weld::CheckButton> m_xEnablePooling;
39 std::unique_ptr<weld::Widget> m_xEnablePoolingImg;
40 std::unique_ptr<weld::Label> m_xDriversLabel;
41 std::unique_ptr<weld::TreeView> m_xDriverList;
42 std::unique_ptr<weld::Label> m_xDriverLabel;
43 std::unique_ptr<weld::Label> m_xDriver;
44 std::unique_ptr<weld::CheckButton> m_xDriverPoolingEnabled;
45 std::unique_ptr<weld::Widget> m_xDriverPoolingEnabledImg;
46 std::unique_ptr<weld::Label> m_xTimeoutLabel;
47 std::unique_ptr<weld::SpinButton> m_xTimeout;
48 std::unique_ptr<weld::Widget> m_xTimeoutImg;
50 public:
51 ConnectionPoolOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet);
52 virtual ~ConnectionPoolOptionsPage() override;
53 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* _rAttrSet);
54 virtual OUString GetAllStrings() override;
56 private:
57 virtual bool FillItemSet(SfxItemSet* _rSet) override;
58 virtual void Reset(const SfxItemSet* _rSet) override;
59 virtual void ActivatePage( const SfxItemSet& _rSet) override;
61 void updateRow(size_t nRow);
62 void updateCurrentRow();
63 void UpdateDriverList(const DriverPoolingSettings& _rSettings);
64 bool isModifiedDriverList() const;
65 void saveDriverList() { m_aSavedSettings = m_aSettings; }
67 DECL_LINK(OnEnabledDisabled, weld::Toggleable&, void);
68 DECL_LINK(OnSpinValueChanged, weld::SpinButton&, void);
69 DECL_LINK(OnDriverRowChanged, weld::TreeView&, void);
71 void implInitControls(const SfxItemSet& _rSet);
73 void commitTimeoutField();
76 } // namespace offapp
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */