23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/beans/PropertyAttribute.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/sdb/CommandType.hpp>
27#include <com/sun/star/sdbc/XConnection.hpp>
28#include <com/sun/star/sdbc/XResultSet.hpp>
29#include <com/sun/star/sdb/XDataAccessDescriptorFactory.hpp>
30#include <com/sun/star/uno/XComponentContext.hpp>
42 using ::com::sun::star::uno::Reference;
43 using ::com::sun::star::uno::Any;
44 using ::com::sun::star::uno::Sequence;
45 using ::com::sun::star::lang::XServiceInfo;
46 using ::com::sun::star::beans::XPropertySetInfo;
47 using ::com::sun::star::beans::Property;
48 using ::com::sun::star::sdbc::XConnection;
49 using ::com::sun::star::sdbc::XResultSet;
50 using ::com::sun::star::beans::XPropertySet;
51 using ::com::sun::star::beans::PropertyValue;
53 namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
54 namespace CommandType = ::com::sun::star::sdb::CommandType;
59 typedef ::cppu::WeakImplHelper< XServiceInfo
60 > DataAccessDescriptor_TypeBase;
64 class DataAccessDescriptor :
public DataAccessDescriptor_MutexBase
65 ,
public DataAccessDescriptor_TypeBase
66 ,
public DataAccessDescriptor_PropertyBase
70 DataAccessDescriptor();
74 DECLARE_XTYPEPROVIDER()
77 virtual OUString SAL_CALL getImplementationName( ) override;
78 virtual
sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
79 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
82 virtual ~DataAccessDescriptor() override;
86 virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
87 virtual ::
cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
90 virtual ::
cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
94 OUString m_sDataSourceName;
95 OUString m_sDatabaseLocation;
96 OUString m_sConnectionResource;
97 Sequence< PropertyValue > m_aConnectionInfo;
98 Reference< XConnection > m_xActiveConnection;
103 OUString m_sHavingClause;
105 bool m_bEscapeProcessing;
106 Reference< XResultSet > m_xResultSet;
108 bool m_bBookmarkSelection;
109 OUString m_sColumnName;
110 Reference< XPropertySet > m_xColumn;
114 DataAccessDescriptor::DataAccessDescriptor()
115 :DataAccessDescriptor_PropertyBase( m_aBHelper )
117 ,m_bEscapeProcessing( true )
118 ,m_bBookmarkSelection( true )
139 DataAccessDescriptor::~DataAccessDescriptor()
147 OUString SAL_CALL DataAccessDescriptor::getImplementationName()
149 return "com.sun.star.comp.dba.DataAccessDescriptor";
152 sal_Bool SAL_CALL DataAccessDescriptor::supportsService(
const OUString& rServiceName )
157 Sequence< OUString > SAL_CALL DataAccessDescriptor::getSupportedServiceNames( )
159 return {
"com.sun.star.sdb.DataAccessDescriptor" };
162 Reference< XPropertySetInfo > SAL_CALL DataAccessDescriptor::getPropertySetInfo()
164 Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
175 Sequence< Property > aProps;
176 describeProperties( aProps );
177 return new ::cppu::OPropertyArrayHelper( aProps );
181 class DataAccessDescriptorFactory:
public ::cppu::WeakImplHelper<XServiceInfo, css::sdb::XDataAccessDescriptorFactory>
190 virtual Reference< XPropertySet > SAL_CALL createDataAccessDescriptor( )
override;
192 DataAccessDescriptorFactory();
195 DataAccessDescriptorFactory::DataAccessDescriptorFactory()
199 OUString SAL_CALL DataAccessDescriptorFactory::getImplementationName()
201 return "com.sun.star.comp.dba.DataAccessDescriptorFactory";
204 sal_Bool SAL_CALL DataAccessDescriptorFactory::supportsService(
const OUString& rServiceName )
209 Sequence< OUString > SAL_CALL DataAccessDescriptorFactory::getSupportedServiceNames()
211 return {
"com.sun.star.sdb.DataAccessDescriptorFactory" };
214 Reference< XPropertySet > SAL_CALL DataAccessDescriptorFactory::createDataAccessDescriptor( )
216 return new DataAccessDescriptor();
221extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
223 css::uno::XComponentContext *,
224 css::uno::Sequence<css::uno::Any>
const &)
226 return cppu::acquire(
new DataAccessDescriptorFactory());
::cppu::IPropertyArrayHelper * getArrayHelper()
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_dba_DataAccessDescriptorFactory(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(OStatement, OStatementBase, OStatement_IFACE)
IMPLEMENT_FORWARD_XINTERFACE2(OStatement, OStatementBase, OStatement_IFACE)
#define PROPERTY_ID_ACTIVE_CONNECTION
#define PROPERTY_ID_DATABASE_LOCATION
#define PROPERTY_ID_HAVING_CLAUSE
#define PROPERTY_ID_RESULT_SET
#define PROPERTY_ID_ESCAPE_PROCESSING
#define PROPERTY_ID_DATASOURCENAME
#define PROPERTY_ID_COLUMN
#define PROPERTY_ID_SELECTION
#define PROPERTY_ID_FILTER
#define PROPERTY_ID_COMMAND
#define PROPERTY_ID_CONNECTION_INFO
#define PROPERTY_ID_ORDER
#define PROPERTY_ID_GROUP_BY
#define PROPERTY_ID_CONNECTION_RESOURCE
#define PROPERTY_ID_COLUMN_NAME
#define PROPERTY_ID_BOOKMARK_SELECTION
#define PROPERTY_ID_COMMAND_TYPE
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_CONNECTION_RESOURCE(u"ConnectionResource")
constexpr OUStringLiteral PROPERTY_HAVING_CLAUSE(u"HavingClause")
constexpr OUStringLiteral PROPERTY_BOOKMARK_SELECTION(u"BookmarkSelection")
constexpr OUStringLiteral PROPERTY_COLUMN(u"Column")
constexpr OUStringLiteral PROPERTY_CONNECTION_INFO(u"ConnectionInfo")
constexpr OUStringLiteral PROPERTY_RESULT_SET(u"ResultSet")
constexpr OUStringLiteral PROPERTY_GROUP_BY(u"GroupBy")
constexpr OUStringLiteral PROPERTY_SELECTION(u"Selection")
constexpr OUStringLiteral PROPERTY_FILTER(u"Filter")
constexpr OUStringLiteral PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection")
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral PROPERTY_DATABASE_LOCATION(u"DatabaseLocation")
constexpr OUStringLiteral PROPERTY_COLUMN_NAME(u"ColumnName")
constexpr OUStringLiteral PROPERTY_DATASOURCENAME(u"DataSourceName")
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE(u"CommandType")
constexpr OUStringLiteral PROPERTY_ORDER(u"Order")
#define DECLARE_XINTERFACE()