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