LibreOffice Module extensions (master) 1
commonpagesdbp.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 "controlwizard.hxx"
23#include <vcl/weld.hxx>
24#include <com/sun/star/sdb/XDatabaseContext.hpp>
25
26namespace dbp
27{
29 {
30 std::unique_ptr<weld::TreeView> m_xTable;
31 std::unique_ptr<weld::TreeView> m_xDatasource;
32 std::unique_ptr<weld::Button> m_xSearchDatabase;
33 std::unique_ptr<weld::Container> m_xSourceBox;
34
35 css::uno::Reference< css::sdb::XDatabaseContext >
37
38 public:
39 explicit OTableSelectionPage(weld::Container* pPage, OControlWizard* pParent);
40 virtual ~OTableSelectionPage() override;
41
42 private:
43 // BuilderPage overridables
44 void Activate() override;
45
46 // OWizardPage overridables
47 virtual void initializePage() override;
48 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
49
50 DECL_LINK( OnListboxSelection, weld::TreeView&, void );
51 DECL_LINK( OnListboxDoubleClicked, weld::TreeView&, bool );
52 DECL_LINK( OnSearchClicked, weld::Button&, void );
53
54 void implFillTables(const css::uno::Reference< css::sdbc::XConnection >&
55 _rxConn = css::uno::Reference< css::sdbc::XConnection >());
56
57 // OControlWizardPage overridables
58 virtual bool canAdvance() const override;
59 };
60
62 {
66
67 public:
68 OMaybeListSelectionPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID);
69 virtual ~OMaybeListSelectionPage() override;
70
71 protected:
72 DECL_LINK( OnRadioSelected, weld::Toggleable&, void );
73
74 // BuilderPage overridables
75 void Activate() override;
76
77 // own helper
79 weld::RadioButton& _rYesButton,
80 weld::RadioButton& _rNoButton,
81 weld::ComboBox& _rSelection);
82
83 void implEnableWindows();
84
85 void implInitialize(const OUString& _rSelection);
86 void implCommit(OUString& _rSelection);
87 };
88
90 {
91 std::unique_ptr<weld::Label> m_xDescription;
92 std::unique_ptr<weld::RadioButton> m_xStoreYes;
93 std::unique_ptr<weld::RadioButton> m_xStoreNo;
94 std::unique_ptr<weld::ComboBox> m_xStoreWhere;
95
96 public:
97 explicit ODBFieldPage(weld::Container* pPage, OControlWizard* pWizard);
98 virtual ~ODBFieldPage() override;
99
100 protected:
101 void setDescriptionText(const OUString& rDesc)
102 {
103 m_xDescription->set_label(rDesc);
104 }
105
106 // OWizardPage overridables
107 virtual void initializePage() override;
108 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
109
110 // own overridables
111 virtual OUString& getDBFieldSetting() = 0;
112 };
113
114
115} // namespace dbp
116
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~ODBFieldPage() override
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
std::unique_ptr< weld::RadioButton > m_xStoreYes
std::unique_ptr< weld::ComboBox > m_xStoreWhere
std::unique_ptr< weld::Label > m_xDescription
ODBFieldPage(weld::Container *pPage, OControlWizard *pWizard)
virtual void initializePage() override
std::unique_ptr< weld::RadioButton > m_xStoreNo
virtual OUString & getDBFieldSetting()=0
void setDescriptionText(const OUString &rDesc)
void implCommit(OUString &_rSelection)
virtual ~OMaybeListSelectionPage() override
void announceControls(weld::RadioButton &_rYesButton, weld::RadioButton &_rNoButton, weld::ComboBox &_rSelection)
OMaybeListSelectionPage(weld::Container *pPage, OControlWizard *pWizard, const OUString &rUIXMLDescription, const OUString &rID)
DECL_LINK(OnRadioSelected, weld::Toggleable &, void)
void implInitialize(const OUString &_rSelection)
weld::RadioButton * m_pYes
DECL_LINK(OnListboxDoubleClicked, weld::TreeView &, bool)
DECL_LINK(OnListboxSelection, weld::TreeView &, void)
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
DECL_LINK(OnSearchClicked, weld::Button &, void)
std::unique_ptr< weld::Container > m_xSourceBox
std::unique_ptr< weld::TreeView > m_xTable
virtual ~OTableSelectionPage() override
virtual bool canAdvance() const override
OTableSelectionPage(weld::Container *pPage, OControlWizard *pParent)
css::uno::Reference< css::sdb::XDatabaseContext > m_xDSContext
std::unique_ptr< weld::Button > m_xSearchDatabase
virtual void initializePage() override
void implFillTables(const css::uno::Reference< css::sdbc::XConnection > &_rxConn=css::uno::Reference< css::sdbc::XConnection >())
std::unique_ptr< weld::TreeView > m_xDatasource