LibreOffice Module dbaccess (master) 1
databaseobjectview.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 <rtl/ustring.hxx>
23#include <com/sun/star/sdbc/XConnection.hpp>
24#include <com/sun/star/sdbc/XDataSource.hpp>
25#include <com/sun/star/lang/XComponent.hpp>
26#include <com/sun/star/frame/XComponentLoader.hpp>
27#include <com/sun/star/frame/XFrame.hpp>
28#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
29#include <com/sun/star/uno/XComponentContext.hpp>
31
32namespace dbaui
33{
40 {
41 private:
42 css::uno::Reference< css::uno::XComponentContext >
44 css::uno::Reference< css::frame::XFrame >
46 css::uno::Reference< css::frame::XComponentLoader >
48 css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >
51
52 private:
53 css::uno::Reference< css::lang::XComponent >
55 const ::comphelper::NamedValueCollection& i_rDispatchArgs
56 );
57
58 protected:
72 virtual css::uno::Reference< css::lang::XComponent > doCreateView(
73 const css::uno::Any& _rDataSource,
74 const OUString& _rObjectName,
75 const ::comphelper::NamedValueCollection& i_rCreationArgs
76 );
77
78 virtual void fillDispatchArgs(
80 const css::uno::Any& _rDataSource,
81 const OUString& _rObjectName
82 );
83
84 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >&
85 getApplicationUI() const { return m_xApplication; }
86 css::uno::Reference< css::sdbc::XConnection >
87 getConnection() const;
88
89 public:
91 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
92 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
93 const css::uno::Reference< css::frame::XFrame >& _rxParentFrame,
94 OUString _sComponentURL
95 );
97
103 void setTargetFrame( const css::uno::Reference< css::frame::XFrame >& _rxFrame )
104 {
105 m_xFrameLoader.set( _rxFrame, css::uno::UNO_QUERY );
106 }
107
115 css::uno::Reference< css::lang::XComponent >
116 createNew(
117 const css::uno::Reference< css::sdbc::XDataSource >& _xDataSource,
118 const ::comphelper::NamedValueCollection& i_rDispatchArgs = ::comphelper::NamedValueCollection()
119 );
120
132 css::uno::Reference< css::lang::XComponent >
134 const css::uno::Any& _aDataSource,
135 const OUString& _rName,
136 const ::comphelper::NamedValueCollection& i_rDispatchArgs
137 );
138 };
139
140 // QueryDesigner
142 {
143 sal_Int32 m_nCommandType;
144
145 virtual void fillDispatchArgs(
146 ::comphelper::NamedValueCollection& i_rDispatchArgs,
147 const css::uno::Any& _aDataSource,
148 const OUString& _rObjectName
149 ) override;
150
151 public:
153 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
154 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
155 const css::uno::Reference< css::frame::XFrame >& _rxParentFrame,
156 bool _bCreateView
157 );
158 };
159
160 // TableDesigner
162 {
163 protected:
164 virtual void fillDispatchArgs(
165 ::comphelper::NamedValueCollection& i_rDispatchArgs,
166 const css::uno::Any& _aDataSource,
167 const OUString& _rObjectName
168 ) override;
169
170 virtual css::uno::Reference< css::lang::XComponent > doCreateView(
171 const css::uno::Any& _rDataSource,
172 const OUString& _rObjectName,
173 const ::comphelper::NamedValueCollection& i_rCreationArgs
174 ) override;
175
176 public:
178 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
179 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
180 const css::uno::Reference< css::frame::XFrame >& _rxParentFrame
181 );
182
183 private:
192 css::uno::Reference< css::uno::XInterface >
193 impl_getConnectionProvidedDesigner_nothrow( const OUString& _rTableName );
194 };
195
196 // ResultSetBrowser
198 {
199 private:
201
202 protected:
203 virtual void fillDispatchArgs(
204 ::comphelper::NamedValueCollection& i_rDispatchArgs,
205 const css::uno::Any& _aDataSource,
206 const OUString& _rQualifiedName
207 ) override;
208
209 public:
211 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
212 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
213 const css::uno::Reference< css::frame::XFrame >& _rxParentFrame,
214 bool _bTable
215 );
216
217 };
218 // RelationDesigner
220 {
221 public:
223 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
224 const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication,
225 const css::uno::Reference< css::frame::XFrame >& _rxParentFrame
226 );
227 };
228} // namespace dbaui
229
230/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
encapsulates access to the view of a database object.
css::uno::Reference< css::lang::XComponent > openExisting(const css::uno::Any &_aDataSource, const OUString &_rName, const ::comphelper::NamedValueCollection &i_rDispatchArgs)
opens a view for an existent object
css::uno::Reference< css::lang::XComponent > doDispatch(const ::comphelper::NamedValueCollection &i_rDispatchArgs)
css::uno::Reference< css::frame::XFrame > m_xParentFrame
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_rDataSource, const OUString &_rObjectName)
css::uno::Reference< css::sdbc::XConnection > getConnection() const
css::uno::Reference< css::lang::XComponent > createNew(const css::uno::Reference< css::sdbc::XDataSource > &_xDataSource, const ::comphelper::NamedValueCollection &i_rDispatchArgs=::comphelper::NamedValueCollection())
opens a view for a to-be-created object
css::uno::Reference< css::frame::XComponentLoader > m_xFrameLoader
css::uno::Reference< css::uno::XComponentContext > m_xORB
css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > m_xApplication
void setTargetFrame(const css::uno::Reference< css::frame::XFrame > &_rxFrame)
sets the target frame into which the view should be loaded.
const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > & getApplicationUI() const
DatabaseObjectView(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, OUString _sComponentURL)
virtual css::uno::Reference< css::lang::XComponent > doCreateView(const css::uno::Any &_rDataSource, const OUString &_rObjectName, const ::comphelper::NamedValueCollection &i_rCreationArgs)
creates the desired view
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rObjectName) override
QueryDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, bool _bCreateView)
RelationDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame)
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rQualifiedName) override
ResultSetBrowser(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame, bool _bTable)
css::uno::Reference< css::uno::XInterface > impl_getConnectionProvidedDesigner_nothrow(const OUString &_rTableName)
retrieves the table designer component as provided by the connection, if any
virtual void fillDispatchArgs(::comphelper::NamedValueCollection &i_rDispatchArgs, const css::uno::Any &_aDataSource, const OUString &_rObjectName) override
TableDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > &_rxApplication, const css::uno::Reference< css::frame::XFrame > &_rxParentFrame)
virtual css::uno::Reference< css::lang::XComponent > doCreateView(const css::uno::Any &_rDataSource, const OUString &_rObjectName, const ::comphelper::NamedValueCollection &i_rCreationArgs) override
creates the desired view