LibreOffice Module extensions (master) 1
sqlcommanddesign.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/XMultiComponentFactory.hpp>
23#include <com/sun/star/beans/XPropertyChangeListener.hpp>
24#include <com/sun/star/frame/XController.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
26
28#include <tools/link.hxx>
30#include <rtl/ref.hxx>
32
33
34namespace pcr
35{
36
37
38 class ISQLCommandAdapter;
39
40 //= SQLCommandDesigner
41
42 typedef ::cppu::WeakImplHelper < css::beans::XPropertyChangeListener
48 {
49 private:
50 css::uno::Reference< css::uno::XComponentContext > m_xContext;
51 css::uno::Reference< css::lang::XMultiComponentFactory > m_xORB;
53 css::uno::Reference< css::frame::XController > m_xDesigner;
56
57 public:
73 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
74 const ::rtl::Reference< ISQLCommandAdapter >& _rxPropertyAdapter,
75 ::dbtools::SharedConnection _aConnection,
76 const Link<SQLCommandDesigner&,void>& _rCloseLink
77 );
78
82 bool isActive() const { return m_xDesigner.is(); }
83
86 const ::rtl::Reference< ISQLCommandAdapter >& getPropertyAdapter() const { return m_xObjectAdapter; }
87
94 void raise() const;
95
102 bool suspend() const;
103
106 void dispose();
107
108 private:
109 // XPropertyChangeListener
110 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
111
112 // XEventListener
113 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
114
115 virtual ~SQLCommandDesigner() override;
116
124
127 void impl_raise_nothrow() const;
128
131 bool impl_isDisposed() const
132 {
133 return !m_xContext.is();
134 }
139 void impl_checkDisposed_throw() const;
140
145 css::uno::Reference< css::frame::XFrame >
147
155
163
166 };
167
168
169 //= ISQLCommandAdapter
170
174 {
175 public:
177 virtual OUString getSQLCommand() const = 0;
179 virtual bool getEscapeProcessing() const = 0;
180
182 virtual void setSQLCommand( const OUString& _rCommand ) const = 0;
184 virtual void setEscapeProcessing( const bool _bEscapeProcessing ) const = 0;
185
186 virtual ~ISQLCommandAdapter() override;
187 };
188
189
190} // namespace pcr
191
192
193/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
an adapter to forward changed SQL command property values to a component
virtual OUString getSQLCommand() const =0
retrieves the current SQL command of the component
virtual void setSQLCommand(const OUString &_rCommand) const =0
sets a new SQL command
virtual ~ISQLCommandAdapter() override
virtual bool getEscapeProcessing() const =0
retrieves the current value of the EscapeProcessing property of the component
virtual void setEscapeProcessing(const bool _bEscapeProcessing) const =0
sets a new EscapeProcessing property value
encapsulates the code for calling and managing a query design frame, used for interactively designing...
css::uno::Reference< css::frame::XFrame > impl_createEmptyParentlessTask_nothrow() const
create an empty top-level frame, which does not belong to the desktop's frame list @precond ->m_xORB ...
css::uno::Reference< css::frame::XController > m_xDesigner
void impl_checkDisposed_throw() const
checks whether we are already disposed
virtual ~SQLCommandDesigner() override
::dbtools::SharedConnection m_xConnection
SQLCommandDesigner & operator=(const SQLCommandDesigner &)=delete
void impl_closeDesigner_nothrow()
closes the component denoted by m_xDesigner @precond our designer component is actually active (->isA...
bool impl_trySuspendDesigner_nothrow() const
suspends our designer component @precond the designer component is actually active (->isActive)
css::uno::Reference< css::lang::XMultiComponentFactory > m_xORB
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void impl_doOpenDesignerFrame_nothrow()
opens a new frame for interactively designing an SQL command @precond the designer is not currently a...
const ::rtl::Reference< ISQLCommandAdapter > & getPropertyAdapter() const
returns the property adapter used by the instance
::rtl::Reference< ISQLCommandAdapter > m_xObjectAdapter
Link< SQLCommandDesigner &, void > m_aCloseLink
SQLCommandDesigner(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const ::rtl::Reference< ISQLCommandAdapter > &_rxPropertyAdapter, ::dbtools::SharedConnection _aConnection, const Link< SQLCommandDesigner &, void > &_rCloseLink)
creates the instance, and immediately opens the SQL command design frame
bool impl_isDisposed() const
determines whether we are already disposed
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
SQLCommandDesigner(const SQLCommandDesigner &)=delete
bool suspend() const
suspends the designer @precond the designer is active (->isActive) @precond the instance is not dispo...
void impl_raise_nothrow() const
impl-version of ->raise
css::uno::Reference< css::uno::XComponentContext > m_xContext
void raise() const
raises the designer window to top @precond the designer is active (->isActive) @precond the instance ...
bool isActive() const
determines whether the SQL Command designer is currently active, i.e.
void dispose()
disposes the instance so that it becomes non-functional
a property handler for any virtual string properties
Definition: browserline.cxx:39
::cppu::WeakImplHelper< css::beans::XPropertyChangeListener > SQLCommandDesigner_Base