LibreOffice Module extensions (master) 1
controlwizard.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 <com/sun/star/lang/XMultiServiceFactory.hpp>
23#include <com/sun/star/form/FormComponentType.hpp>
24#include <com/sun/star/sdbc/XConnection.hpp>
25#include <com/sun/star/task/XInteractionHandler.hpp>
26#include <com/sun/star/uno/XComponentContext.hpp>
27#include <vcl/weld.hxx>
28#include <vcl/wizardmachine.hxx>
29#include "dbptypes.hxx"
30#include <strings.hrc>
31#include <componentmodule.hxx>
32#include "wizardcontext.hxx"
33
34class ResId;
35
36namespace dbp
37{
39 {
40 OUString sControlLabel;
41 };
42
43 class OControlWizard;
46 {
48 std::unique_ptr<weld::Label> m_xFormDatasourceLabel;
49 std::unique_ptr<weld::Label> m_xFormDatasource;
50 std::unique_ptr<weld::Label> m_xFormContentTypeLabel;
51 std::unique_ptr<weld::Label> m_xFormContentType;
52 std::unique_ptr<weld::Label> m_xFormTable;
53 std::unique_ptr<weld::Frame> m_xFrame;
54
55 protected:
57 const OControlWizard* getDialog() const;
58 const OControlWizardContext& getContext() const;
59 bool updateContext();
60 void setFormConnection(const css::uno::Reference< css::sdbc::XConnection >& _rxConn, bool _bAutoDispose = true );
61 css::uno::Reference< css::sdbc::XConnection >
62 getFormConnection() const;
63 public:
64 OControlWizardPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID);
65 virtual ~OControlWizardPage() override;
66
67 protected:
68 static void fillListBox(
69 weld::TreeView& _rList,
70 const css::uno::Sequence< OUString >& _rItems);
71 static void fillListBox(
72 weld::ComboBox& _rList,
73 const css::uno::Sequence< OUString >& _rItems);
74
75 protected:
77
78 protected:
79 // OWizardPage overridables
80 virtual void initializePage() override;
81 };
82
83 struct OAccessRegulator;
84
87 {
88 private:
90 css::uno::Reference< css::uno::XComponentContext >
92
93 public:
95 weld::Window* _pParent,
96 const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel,
97 const css::uno::Reference< css::uno::XComponentContext >& _rxContext
98 );
99 virtual ~OControlWizard() override;
100
101 // make the same base class methods public
103
104 public:
105 const css::uno::Reference< css::uno::XComponentContext >&
106 getComponentContext() const { return m_xContext; }
107
108 const OControlWizardContext& getContext() const { return m_aContext; }
109 bool updateContext(const OAccessRegulator&);
110 void setFormConnection(const OAccessRegulator&, const css::uno::Reference< css::sdbc::XConnection >& _rxConn, bool _bAutoDispose );
111 css::uno::Reference< css::sdbc::XConnection >
113
117 css::uno::Reference< css::task::XInteractionHandler > getInteractionHandler(weld::Window* _pWindow) const;
118
119 protected:
120 // initialize the derivees settings (which have to be derived from OControlWizardSettings)
121 // with some common data extracted from the control model
123 // commit the control-relevant settings
124 void commitControlSettings(OControlWizardSettings const * _pSettings);
125
127
128 css::uno::Reference< css::sdbc::XConnection >
129 getFormConnection() const;
130
131 virtual bool approveControl(sal_Int16 _nClassId) = 0;
132
133 virtual short run() override;
134
135 private:
136 bool initContext();
137
138 void implGetDSContext();
139 void implDetermineForm();
140 void implDeterminePage();
141 void implDetermineShape();
142 };
143
144
145} // namespace dbp
146
147
148/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OControlWizardPage(weld::Container *pPage, OControlWizard *pWizard, const OUString &rUIXMLDescription, const OUString &rID)
std::unique_ptr< weld::Label > m_xFormDatasource
OControlWizard * getDialog()
css::uno::Reference< css::sdbc::XConnection > getFormConnection() const
virtual ~OControlWizardPage() override
virtual void initializePage() override
std::unique_ptr< weld::Label > m_xFormTable
std::unique_ptr< weld::Label > m_xFormContentTypeLabel
static void fillListBox(weld::ComboBox &_rList, const css::uno::Sequence< OUString > &_rItems)
const OControlWizardContext & getContext() const
std::unique_ptr< weld::Frame > m_xFrame
void setFormConnection(const css::uno::Reference< css::sdbc::XConnection > &_rxConn, bool _bAutoDispose=true)
static void fillListBox(weld::TreeView &_rList, const css::uno::Sequence< OUString > &_rItems)
std::unique_ptr< weld::Label > m_xFormDatasourceLabel
OControlWizard * m_pDialog
std::unique_ptr< weld::Label > m_xFormContentType
OControlWizardContext m_aContext
virtual short run() override
void initControlSettings(OControlWizardSettings *_pSettings)
virtual bool approveControl(sal_Int16 _nClassId)=0
css::uno::Reference< css::uno::XComponentContext > m_xContext
OControlWizard(weld::Window *_pParent, const css::uno::Reference< css::beans::XPropertySet > &_rxObjectModel, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
void commitControlSettings(OControlWizardSettings const *_pSettings)
css::uno::Reference< css::sdbc::XConnection > getFormConnection() const
css::uno::Reference< css::task::XInteractionHandler > getInteractionHandler(weld::Window *_pWindow) const
returns the com.sun.star.task.InteractionHandler
bool updateContext(const OAccessRegulator &)
virtual ~OControlWizard() override
void setFormConnection(const OAccessRegulator &, const css::uno::Reference< css::sdbc::XConnection > &_rxConn, bool _bAutoDispose)
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
const OControlWizardContext & getContext() const
::vcl::OWizardPage OControlWizardPage_Base
::vcl::WizardMachine OControlWizard_Base