LibreOffice Module dbaccess (master) 1
query.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 "querydescriptor.hxx"
24#include <rtl/ref.hxx>
25#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
26#include <com/sun/star/beans/XPropertyChangeListener.hpp>
27#include <com/sun/star/sdbc/XConnection.hpp>
28#include <com/sun/star/sdbcx/XRename.hpp>
29#include <ContentHelper.hxx>
30
31#include <map>
32
33namespace dbtools
34{
35 class WarningsContainer;
36}
37
38namespace dbaccess
39{
40
41// OQuery - an object implementing the sdb.Query service
42typedef ::cppu::ImplHelper3 < css::sdbcx::XDataDescriptorFactory,
43 css::beans::XPropertyChangeListener,
44 css::sdbcx::XRename
46class OQuery;
47class OColumn;
48typedef ::comphelper::OPropertyArrayUsageHelper< OQuery > OQuery_ArrayHelperBase;
49
52 ,public OQuery_Base
54 ,public ODataSettings
55{
56 friend struct TRelease;
57
58protected:
59 css::uno::Reference< css::beans::XPropertySet > m_xCommandDefinition;
60 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
61 css::uno::Reference< css::beans::XPropertySetInfo > m_xCommandPropInfo;
64
65 // possible actions on our "aggregate"
66 enum class AggregateAction { NONE, SettingProperties };
68
71 class OAutoActionReset; // just for the following friend declaration
72 friend class OAutoActionReset;
74 {
76 public:
77 explicit OAutoActionReset(OQuery& _rActor) : m_rActor(_rActor) { }
79 };
80
81protected:
82 virtual ~OQuery() override;
83
84// OPropertyArrayUsageHelper
85 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
87
88public:
89 OQuery(
90 const css::uno::Reference< css::beans::XPropertySet >& _rxCommandDefinition,
91 const css::uno::Reference< css::sdbc::XConnection >& _rxConn,
92 const css::uno::Reference< css::uno::XComponentContext >& _xORB
93 );
94
95 virtual css::uno::Sequence<css::uno::Type> SAL_CALL getTypes() override;
96 virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override;
97
98// css::uno::XInterface
100
101// css::beans::XPropertySet
102 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
103
104// OPropertySetHelper
105 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
106
107// css::lang::XServiceInfo
109
110// css::sdbcx::XDataDescriptorFactory
111 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
112
113// css::beans::XPropertyChangeListener
114 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
115
116// css::lang::XEventListener
117 virtual void SAL_CALL disposing( const css::lang::EventObject& _rSource ) override;
118
119// OPropertySetHelper
120 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
121 sal_Int32 nHandle,
122 const css::uno::Any& rValue ) override;
123
124public:
125 // the caller is responsible for the lifetime!
126 void setWarningsContainer( ::dbtools::WarningsContainer* _pWarnings ) { m_pWarnings = _pWarnings; }
127
128 // XRename
129 virtual void SAL_CALL rename( const OUString& newName ) override;
130
131protected:
132 virtual void SAL_CALL disposing() override;
133
134 virtual rtl::Reference<OColumn> createColumn(const OUString& _rName) const override;
135
136 virtual void rebuildColumns( ) override;
137
138 // OContentHelper overridables
139 virtual OUString determineContentType() const override;
140
141private:
142 void registerProperties();
143};
144
145} // namespace dbaccess
146
147/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::cppu::IPropertyArrayHelper * getArrayHelper()
OAutoActionReset(OQuery &_rActor)
Definition: query.hxx:77
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
Definition: query.cxx:235
::dbtools::WarningsContainer * m_pWarnings
Definition: query.hxx:63
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override
Definition: query.cxx:279
AggregateAction m_eDoingCurrently
Definition: query.hxx:67
void registerProperties()
Definition: query.cxx:350
css::uno::Reference< css::beans::XPropertySetInfo > m_xCommandPropInfo
Definition: query.hxx:61
friend struct TRelease
Definition: query.hxx:56
virtual OUString determineContentType() const override
Definition: query.cxx:376
::rtl::Reference< OContainerMediator > m_pColumnMediator
Definition: query.hxx:62
virtual void rebuildColumns() override
rebuild our columns set
Definition: query.cxx:120
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: query.cxx:104
virtual void SAL_CALL disposing() override
Definition: query.cxx:285
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: query.cxx:328
OQuery(const css::uno::Reference< css::beans::XPropertySet > &_rxCommandDefinition, const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const css::uno::Reference< css::uno::XComponentContext > &_xORB)
Definition: query.cxx:65
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: query.cxx:298
virtual ~OQuery() override
Definition: query.cxx:100
virtual void SAL_CALL rename(const OUString &newName) override
Definition: query.cxx:341
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: query.hxx:60
virtual rtl::Reference< OColumn > createColumn(const OUString &_rName) const override
creates an OColumn object which should represent the column with a given name
Definition: query.cxx:336
css::uno::Reference< css::beans::XPropertySet > m_xCommandDefinition
Definition: query.hxx:59
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: query.cxx:109
void setWarningsContainer(::dbtools::WarningsContainer *_pWarnings)
Definition: query.hxx:126
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: query.cxx:323
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: query.cxx:318
NONE
::cppu::ImplHelper3< css::sdbcx::XDataDescriptorFactory, css::beans::XPropertyChangeListener, css::sdbcx::XRename > OQuery_Base
Definition: query.hxx:45
::comphelper::OPropertyArrayUsageHelper< OQuery > OQuery_ArrayHelperBase
Definition: query.hxx:47
#define DECLARE_XINTERFACE()