1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_COMMANDDEFINITION_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_COMMANDDEFINITION_HXX
23 #include "commandbase.hxx"
24 #include "apitools.hxx"
25 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <com/sun/star/sdbcx/XRename.hpp>
27 #include <com/sun/star/sdb/XQueryDefinition.hpp>
28 #include "datasettings.hxx"
29 #include "ContentHelper.hxx"
30 #include "ComponentDefinition.hxx"
32 #include <comphelper/propertycontainer.hxx>
33 #include <comphelper/proparrhlp.hxx>
34 #include <comphelper/uno3.hxx>
35 #include <cppuhelper/implbase2.hxx>
40 // OCommandDefinition - a database "document" which describes a query
41 class OCommandDefinition_Impl
: public OComponentDefinition_Impl
47 typedef ::cppu::ImplHelper2
< css::sdbcx::XRename
,
48 css::sdb::XQueryDefinition
49 > OCommandDefinition_Base
;
50 class OCommandDefinition
;
51 typedef ::comphelper::OPropertyArrayUsageHelper
< OCommandDefinition
>
52 OCommandDefinition_PROP
;
54 class OCommandDefinition
: public OComponentDefinition
55 ,public OCommandDefinition_Base
56 ,public OCommandDefinition_PROP
59 virtual ~OCommandDefinition() override
;
62 OCommandDefinition(const css::uno::Reference
< css::uno::XComponentContext
>& ,
63 const css::uno::Reference
< css::uno::XInterface
>& _xParentContainer
,
64 const TContentPtr
& _pImpl
);
67 const css::uno::Reference
< css::uno::XInterface
>& _rxContainer
68 ,const OUString
& _rElementName
69 ,const css::uno::Reference
< css::uno::XComponentContext
>&
70 ,const TContentPtr
& _pImpl
73 virtual css::uno::Sequence
<css::uno::Type
> SAL_CALL
getTypes()
74 throw (css::uno::RuntimeException
, std::exception
) override
;
75 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId()
76 throw (css::uno::RuntimeException
, std::exception
) override
;
78 // css::uno::XInterface
81 // css::lang::XServiceInfo
82 virtual OUString SAL_CALL
getImplementationName( ) throw(css::uno::RuntimeException
, std::exception
) override
;
83 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(css::uno::RuntimeException
, std::exception
) override
;
86 virtual void SAL_CALL
rename( const OUString
& newName
) throw (css::sdbc::SQLException
, css::container::ElementExistException
, css::uno::RuntimeException
, std::exception
) override
;
88 // overrides to resolve ambiguity
89 virtual void SAL_CALL
setPropertyValue(const OUString
& p1
, const css::uno::Any
& p2
) throw(css::beans::UnknownPropertyException
, css::beans::PropertyVetoException
, css::lang::IllegalArgumentException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
90 { OComponentDefinition::setPropertyValue(p1
, p2
); }
91 virtual css::uno::Any SAL_CALL
getPropertyValue(const OUString
& p1
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
92 { return OComponentDefinition::getPropertyValue(p1
); }
93 virtual void SAL_CALL
addPropertyChangeListener(const OUString
& p1
, const css::uno::Reference
<css::beans::XPropertyChangeListener
>& p2
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
94 { OComponentDefinition::addPropertyChangeListener(p1
, p2
); }
95 virtual void SAL_CALL
removePropertyChangeListener(const OUString
& p1
, const css::uno::Reference
<css::beans::XPropertyChangeListener
>& p2
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
96 { OComponentDefinition::removePropertyChangeListener(p1
, p2
); }
97 virtual void SAL_CALL
addVetoableChangeListener(const OUString
& p1
, const css::uno::Reference
<css::beans::XVetoableChangeListener
>& p2
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
98 { OComponentDefinition::addVetoableChangeListener(p1
, p2
); }
99 virtual void SAL_CALL
removeVetoableChangeListener(const OUString
& p1
, const css::uno::Reference
<css::beans::XVetoableChangeListener
>& p2
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
100 { OComponentDefinition::removeVetoableChangeListener(p1
, p2
); }
101 virtual css::uno::Reference
<css::ucb::XContentIdentifier
> SAL_CALL
getIdentifier() throw( css::uno::RuntimeException
, std::exception
) override
102 { return OComponentDefinition::getIdentifier(); }
103 virtual OUString SAL_CALL
getContentType() throw( css::uno::RuntimeException
, std::exception
) override
104 { return OComponentDefinition::getContentType(); }
105 virtual void SAL_CALL
addContentEventListener(const css::uno::Reference
<css::ucb::XContentEventListener
>& p1
) throw( css::uno::RuntimeException
, std::exception
) override
106 { OComponentDefinition::addContentEventListener(p1
); }
107 virtual void SAL_CALL
removeContentEventListener(const css::uno::Reference
<css::ucb::XContentEventListener
>& p1
) throw( css::uno::RuntimeException
, std::exception
) override
108 { OComponentDefinition::removeContentEventListener(p1
); }
109 virtual void SAL_CALL
dispose() throw( css::uno::RuntimeException
, std::exception
) override
110 { OComponentDefinition::dispose(); }
111 virtual void SAL_CALL
addEventListener(const css::uno::Reference
<css::lang::XEventListener
>& p1
) throw( css::uno::RuntimeException
, std::exception
) override
112 { OComponentDefinition::addEventListener(p1
); }
113 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
<css::lang::XEventListener
>& p1
) throw( css::uno::RuntimeException
, std::exception
) override
114 { OComponentDefinition::removeEventListener(p1
); }
116 // OPropertySetHelper
117 virtual css::uno::Reference
<css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
118 throw(css::uno::RuntimeException
, std::exception
) override
;
119 virtual cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
120 virtual cppu::IPropertyArrayHelper
* createArrayHelper() const override
;
125 void registerProperties();
128 } // namespace dbaccess
130 #endif // INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_COMMANDDEFINITION_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */