LibreOffice Module extensions (master) 1
datman.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 "bibview.hxx"
23
24#include <com/sun/star/awt/XControlModel.hpp>
25#include <com/sun/star/form/XForm.hpp>
26#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
27#include <com/sun/star/form/runtime/XFormController.hpp>
30#include <com/sun/star/form/XLoadable.hpp>
31#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
32#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
34#include <vcl/vclptr.hxx>
35
36namespace weld { class Window; }
37
38namespace bib
39{
40 class BibView;
41 class BibBeamer;
42}
43
44class BibToolBar;
45struct BibDBDescriptor;
46
48 :public cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor >
49{
50private:
51 css::uno::Reference< css::frame::XDispatchProvider > xMasterDispatchProvider;
52 css::uno::Reference< css::frame::XDispatchProvider > xSlaveDispatchProvider;
53 css::uno::Reference< css::frame::XDispatch > xFormDispatch;
54 css::uno::Reference< css::frame::XDispatchProviderInterception > xInterception;
55
56protected:
57 virtual ~BibInterceptorHelper( ) override;
58
59public:
60 BibInterceptorHelper( const ::bib::BibBeamer* pBibBeamer, css::uno::Reference< css::frame::XDispatch > const & xDispatch);
61
62 void ReleaseInterceptor();
63
64 // XDispatchProvider
65 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags ) override;
66 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts ) override;
67 // XDispatchProviderInterceptor
68 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider( ) override;
69 virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewSlaveDispatchProvider ) override;
70 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider( ) override;
71 virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewMasterDispatchProvider ) override;
72};
73
74typedef comphelper::WeakComponentImplHelper < css::form::XLoadable
77{
78private:
79 css::uno::Reference< css::form::XForm > m_xForm;
80 css::uno::Reference< css::awt::XControlModel > m_xGridModel;
81 css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser;
82 css::uno::Reference< css::form::runtime::XFormController > m_xFormCtrl;
83 css::uno::Reference< css::frame::XDispatch > m_xFormDispatch;
85
88 OUString aQuoteChar;
89
91
94
96
97 void InsertFields(const css::uno::Reference< css::form::XFormComponent > & xGrid);
98
99 css::uno::Reference< css::awt::XControlModel > const &
100 updateGridModel(const css::uno::Reference< css::form::XForm > & xDbForm);
101 static css::uno::Reference< css::awt::XControlModel >
102 createGridModel( const OUString& rName );
103
104 // XLoadable
105 virtual void SAL_CALL load( ) override;
106 virtual void SAL_CALL unload( ) override;
107 virtual void SAL_CALL reload( ) override;
108 virtual sal_Bool SAL_CALL isLoaded( ) override;
109 virtual void SAL_CALL addLoadListener( const css::uno::Reference< css::form::XLoadListener >& aListener ) override;
110 virtual void SAL_CALL removeLoadListener( const css::uno::Reference< css::form::XLoadListener >& aListener ) override;
111
112 using WeakComponentImplHelperBase::disposing;
113
114public:
115
117 virtual ~BibDataManager() override;
118
119 css::uno::Reference< css::form::XForm > createDatabaseForm( BibDBDescriptor& aDesc);
120
121 css::uno::Reference< css::awt::XControlModel > updateGridModel();
122
123 css::uno::Sequence< OUString> getDataSources() const;
124
125 const OUString& getActiveDataSource() const {return aDataSourceURL;}
126 void setActiveDataSource(const OUString& rURL);
127
128 const OUString& getActiveDataTable() const { return aActiveDataTable;}
129 void setActiveDataTable(const OUString& rTable);
130
131 void setFilter(const OUString& rQuery);
132 OUString getFilter() const;
133
134 css::uno::Sequence< OUString> getQueryFields() const;
135 OUString getQueryField() const;
136 void startQueryWith(const OUString& rQuery);
137
138 const css::uno::Reference< css::sdb::XSingleSelectQueryComposer >& getParser() const { return m_xParser; }
139 const css::uno::Reference< css::form::XForm >& getForm() const { return m_xForm; }
140
141
142 static OUString getControlName(sal_Int32 nFormatKey );
143
144 css::uno::Reference< css::awt::XControlModel > loadControlModel(const OUString& rName,
145 bool bForceListBox);
146
147 void CreateMappingDialog(weld::Window* pParent);
148 OUString CreateDBChangeDialog(weld::Window* pParent);
149
151
152 void SetView( ::bib::BibView* pView ) { pBibView = pView; }
153
154 void SetToolbar(BibToolBar* pSet);
155
156 const OUString& GetIdentifierMapping();
158
159 css::uno::Reference< css::form::runtime::XFormController > const & GetFormController();
160 void RegisterInterceptor( const ::bib::BibBeamer* pBibBeamer);
161
162 bool HasActiveConnection() const;
163};
164
165
166/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::frame::XDispatch > m_xFormDispatch
Definition: datman.hxx:83
VclPtr< ::bib::BibView > pBibView
Definition: datman.hxx:92
const OUString & GetIdentifierMapping()
Definition: datman.cxx:1336
virtual sal_Bool SAL_CALL isLoaded() override
Definition: datman.cxx:1076
static css::uno::Reference< css::awt::XControlModel > createGridModel(const OUString &rName)
Definition: datman.cxx:1102
const OUString & getActiveDataTable() const
Definition: datman.hxx:128
void DispatchDBChangeDialog()
Definition: datman.cxx:1330
void SetView(::bib::BibView *pView)
Definition: datman.hxx:152
css::uno::Reference< css::form::runtime::XFormController > m_xFormCtrl
Definition: datman.hxx:82
VclPtr< BibToolBar > pToolbar
Definition: datman.hxx:93
OUString sIdentifierMapping
Definition: datman.hxx:95
void CreateMappingDialog(weld::Window *pParent)
Definition: datman.cxx:1306
css::uno::Reference< css::form::XForm > m_xForm
Definition: datman.hxx:79
::comphelper::OInterfaceContainerHelper4< css::form::XLoadListener > m_aLoadListeners
Definition: datman.hxx:90
rtl::Reference< BibInterceptorHelper > m_xInterceptorHelper
Definition: datman.hxx:84
css::uno::Reference< css::awt::XControlModel > loadControlModel(const OUString &rName, bool bForceListBox)
Definition: datman.cxx:1177
void setActiveDataTable(const OUString &rTable)
Definition: datman.cxx:939
OUString getQueryField() const
Definition: datman.cxx:829
css::uno::Reference< css::awt::XControlModel > const & updateGridModel(const css::uno::Reference< css::form::XForm > &xDbForm)
void ResetIdentifierMapping()
Definition: datman.hxx:157
css::uno::Sequence< OUString > getDataSources() const
Definition: datman.cxx:758
const OUString & getActiveDataSource() const
Definition: datman.hxx:125
css::uno::Reference< css::form::XForm > createDatabaseForm(BibDBDescriptor &aDesc)
Definition: datman.cxx:677
void InsertFields(const css::uno::Reference< css::form::XFormComponent > &xGrid)
Definition: datman.cxx:563
virtual void SAL_CALL unload() override
Definition: datman.cxx:1022
virtual void SAL_CALL reload() override
Definition: datman.cxx:1049
virtual void SAL_CALL removeLoadListener(const css::uno::Reference< css::form::XLoadListener > &aListener) override
Definition: datman.cxx:1095
virtual ~BibDataManager() override
Definition: datman.cxx:539
OUString CreateDBChangeDialog(weld::Window *pParent)
Definition: datman.cxx:1315
void setFilter(const OUString &rQuery)
Definition: datman.cxx:780
OUString aDataSourceURL
Definition: datman.hxx:87
const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > & getParser() const
Definition: datman.hxx:138
OUString getFilter() const
Definition: datman.cxx:801
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser
Definition: datman.hxx:81
virtual void SAL_CALL load() override
Definition: datman.cxx:1003
bool HasActiveConnection() const
Definition: datman.cxx:1390
static OUString getControlName(sal_Int32 nFormatKey)
Definition: datman.cxx:1138
virtual void SAL_CALL addLoadListener(const css::uno::Reference< css::form::XLoadListener > &aListener) override
Definition: datman.cxx:1088
OUString aQuoteChar
Definition: datman.hxx:88
css::uno::Reference< css::awt::XControlModel > updateGridModel()
Definition: datman.cxx:644
const css::uno::Reference< css::form::XForm > & getForm() const
Definition: datman.hxx:139
void RegisterInterceptor(const ::bib::BibBeamer *pBibBeamer)
Definition: datman.cxx:1381
void startQueryWith(const OUString &rQuery)
Definition: datman.cxx:844
css::uno::Sequence< OUString > getQueryFields() const
Definition: datman.cxx:820
void setActiveDataSource(const OUString &rURL)
Definition: datman.cxx:859
OUString aActiveDataTable
Definition: datman.hxx:86
void SetToolbar(BibToolBar *pSet)
Definition: datman.cxx:1362
css::uno::Reference< css::form::runtime::XFormController > const & GetFormController()
Definition: datman.cxx:1369
css::uno::Reference< css::awt::XControlModel > m_xGridModel
Definition: datman.hxx:80
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
Definition: datman.cxx:519
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
Definition: datman.cxx:480
void ReleaseInterceptor()
Definition: datman.cxx:472
BibInterceptorHelper(const ::bib::BibBeamer *pBibBeamer, css::uno::Reference< css::frame::XDispatch > const &xDispatch)
Definition: datman.cxx:456
css::uno::Reference< css::frame::XDispatch > xFormDispatch
Definition: datman.hxx:53
css::uno::Reference< css::frame::XDispatchProvider > xSlaveDispatchProvider
Definition: datman.hxx:52
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewSlaveDispatchProvider) override
Definition: datman.cxx:513
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewMasterDispatchProvider) override
Definition: datman.cxx:524
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
Definition: datman.cxx:495
virtual ~BibInterceptorHelper() override
Definition: datman.cxx:468
css::uno::Reference< css::frame::XDispatchProviderInterception > xInterception
Definition: datman.hxx:54
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
Definition: datman.cxx:508
css::uno::Reference< css::frame::XDispatchProvider > xMasterDispatchProvider
Definition: datman.hxx:51
comphelper::WeakComponentImplHelper< css::form::XLoadable > BibDataManager_Base
Definition: datman.hxx:75
Definition: bibbeam.cxx:40
unsigned char sal_Bool