LibreOffice Module ucbhelper (master)  1
resultsethelper.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 #ifndef INCLUDED_UCBHELPER_RESULTSETHELPER_HXX
21 #define INCLUDED_UCBHELPER_RESULTSETHELPER_HXX
22 
23 #include <memory>
24 #include <osl/mutex.hxx>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/ucb/XDynamicResultSet.hpp>
27 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
28 #include <cppuhelper/implbase.hxx>
30 
31 namespace com::sun::star::uno { class XComponentContext; }
32 
33 namespace cppu {
34  class OInterfaceContainerHelper;
35 }
36 
37 namespace ucbhelper {
38 
39 
40 #define DYNAMICRESULTSET_SERVICE_NAME "com.sun.star.ucb.DynamicResultSet"
41 
42 
53  public cppu::WeakImplHelper<
54  css::lang::XServiceInfo,
55  css::ucb::XDynamicResultSet>
56 {
57  std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners;
58  bool m_bStatic;
60 
61 protected:
62  osl::Mutex m_aMutex;
63  css::ucb::OpenCommandArgument2 m_aCommand;
64  css::uno::Reference< css::uno::XComponentContext > m_xContext;
65  // Resultset #1
66  css::uno::Reference< css::sdbc::XResultSet > m_xResultSet1;
67  // Resultset #2
68  css::uno::Reference< css::sdbc::XResultSet > m_xResultSet2;
69  // Resultset changes listener.
70  css::uno::Reference< css::ucb::XDynamicResultSetListener > m_xListener;
71 
72 private:
73  UCBHELPER_DLLPRIVATE void init( bool bStatic );
74 
89  UCBHELPER_DLLPRIVATE virtual void initStatic() = 0;
90 
109  UCBHELPER_DLLPRIVATE virtual void initDynamic() = 0;
110 
111 public:
120  const css::uno::Reference<
121  css::uno::XComponentContext >& rxContext,
122  const css::ucb::OpenCommandArgument2& rCommand );
123 
127  virtual ~ResultSetImplHelper() override;
128 
129  // XServiceInfo
130  virtual OUString SAL_CALL getImplementationName() override;
131  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
132  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
133 
134  // XComponent ( base class of XDynamicResultSet )
135  virtual void SAL_CALL
136  dispose() override;
137  virtual void SAL_CALL
138  addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) override;
139  virtual void SAL_CALL
140  removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) override;
141 
142  // XDynamicResultSet
143  virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
144  getStaticResultSet() override;
145  virtual void SAL_CALL
146  setListener( const css::uno::Reference< css::ucb::XDynamicResultSetListener >& Listener ) override;
147  virtual void SAL_CALL
148  connectToCache( const css::uno::Reference< css::ucb::XDynamicResultSet > & xCache ) override;
149 
154  virtual sal_Int16 SAL_CALL
155  getCapabilities() override;
156 
157 };
158 
159 }
160 
161 #endif /* ! INCLUDED_UCBHELPER_RESULTSETHELPER_HXX */
162 
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define UCBHELPER_DLLPRIVATE
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet2
css::ucb::OpenCommandArgument2 m_aCommand
css::uno::Reference< css::ucb::XDynamicResultSetListener > m_xListener
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
std::unique_ptr< cppu::OInterfaceContainerHelper > m_pDisposeEventListeners
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
This is an abstract base class for implementations of the service com.sun.star.ucb.DynamicResultSet, which is the result of the command "open" executed at a UCB folder content.
css::uno::Reference< css::uno::XComponentContext > m_xContext
unsigned char sal_Bool
FILE * init(int, char **)
#define UCBHELPER_DLLPUBLIC
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet1
void dispose()