LibreOffice Module ucb (master)  1
cmis_repo_content.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 
10 #pragma once
11 
12 #include "cmis_url.hxx"
13 #include "children_provider.hxx"
14 
15 #include <com/sun/star/io/XInputStream.hpp>
16 #include <com/sun/star/io/XOutputStream.hpp>
17 #include <com/sun/star/ucb/ContentCreationException.hpp>
18 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
19 #include <com/sun/star/ucb/TransferInfo.hpp>
20 #include <com/sun/star/ucb/XContentCreator.hpp>
22 #include <libcmis/libcmis.hxx>
23 
24 #include <vector>
25 #include <list>
26 
27 namespace com::sun::star {
28  namespace beans {
29  struct Property;
30  struct PropertyValue;
31  }
32  namespace sdbc {
33  class XRow;
34  }
35 }
36 namespace ucbhelper
37 {
38  class Content;
39 }
40 
41 
42 namespace cmis
43 {
44 inline constexpr OUStringLiteral CMIS_REPO_TYPE = u"application/vnd.libreoffice.cmis-repository";
45 
46 class ContentProvider;
48  public ChildrenProvider
49 {
50 private:
53  OUString m_sRepositoryId;
54 
55  std::vector< libcmis::RepositoryPtr > m_aRepositories;
56 
57 private:
58 
59  css::uno::Any getBadArgExcept();
60 
61  css::uno::Reference< css::sdbc::XRow >
63  const css::uno::Sequence< css::beans::Property >& rProperties,
64  const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv );
65 
66  /*
67  * Call me to ensure the repositories have been fetched
68  */
69  void getRepositories( const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv );
70 
71  libcmis::RepositoryPtr getRepository( const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv );
72 
73 public:
75  RepoContent( const css::uno::Reference<
76  css::uno::XComponentContext >& rxContext, ContentProvider *pProvider,
77  const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier,
78  std::vector< libcmis::RepositoryPtr > && aRepos = std::vector< libcmis::RepositoryPtr > ( ) );
79 
80  virtual ~RepoContent() override;
81 
82  virtual css::uno::Sequence< css::beans::Property >
83  getProperties( const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv ) override;
84 
85  virtual css::uno::Sequence< css::ucb::CommandInfo >
86  getCommands( const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv ) override;
87 
88  virtual OUString getParentURL() override;
89 
90  // XInterface
91 
92  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
93  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
94 
95  virtual OUString SAL_CALL
96  getImplementationName() override;
97 
98  virtual css::uno::Sequence< OUString > SAL_CALL
99  getSupportedServiceNames() override;
100 
101  virtual OUString SAL_CALL
102  getContentType() override;
103 
104  virtual css::uno::Any SAL_CALL
105  execute( const css::ucb::Command& aCommand,
106  sal_Int32 CommandId,
107  const css::uno::Reference< css::ucb::XCommandEnvironment >& Environment ) override;
108 
109  virtual void SAL_CALL abort( sal_Int32 CommandId ) override;
110 
111  virtual std::vector< css::uno::Reference< css::ucb::XContent > > getChildren( ) override;
112 };
113 
114 }
115 
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
exports com.sun.star. sdbc
RepoContent(const css::uno::Reference< css::uno::XComponentContext > &rxContext, ContentProvider *pProvider, const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier, std::vector< libcmis::RepositoryPtr > &&aRepos=std::vector< libcmis::RepositoryPtr >())
ContentProvider * m_pProvider
std::vector< libcmis::RepositoryPtr > m_aRepositories
libcmis::RepositoryPtr getRepository(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
virtual OUString SAL_CALL getContentType() override
constexpr OUStringLiteral CMIS_REPO_TYPE
virtual void SAL_CALL abort(sal_Int32 CommandId) override
virtual ~RepoContent() override
css::uno::Any getBadArgExcept()
css::uno::Reference< css::sdbc::XRow > getPropertyValues(const css::uno::Sequence< css::beans::Property > &rProperties, const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
virtual OUString getParentURL() override
virtual css::uno::Any SAL_CALL execute(const css::ucb::Command &aCommand, sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &Environment) override
virtual std::vector< css::uno::Reference< css::ucb::XContent > > getChildren() override
virtual css::uno::Sequence< css::ucb::CommandInfo > getCommands(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv) override
float u
virtual OUString SAL_CALL getImplementationName() override
exports com.sun.star. beans
virtual css::uno::Sequence< css::beans::Property > getProperties(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
void getRepositories(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override