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/.
10 #ifndef CMIS_REPO_CONTENT_HXX
11 #define CMIS_REPO_CONTENT_HXX
13 #include "cmis_url.hxx"
14 #include "children_provider.hxx"
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>
22 #include <ucbhelper/contenthelper.hxx>
23 #include <libcmis/libcmis.hxx>
28 namespace com
{ namespace sun
{ namespace star
{
45 #define CMIS_REPO_TYPE "application/vnd.libreoffice.cmis-repository"
47 class ContentProvider
;
48 class RepoContent
: public ::ucbhelper::ContentImplHelper
,
49 public ChildrenProvider
52 ContentProvider
* m_pProvider
;
54 OUString m_sRepositoryId
;
56 std::vector
< libcmis::RepositoryPtr
> m_aRepositories
;
60 com::sun::star::uno::Any
getBadArgExcept();
62 com::sun::star::uno::Reference
< com::sun::star::sdbc::XRow
>
64 const com::sun::star::uno::Sequence
< com::sun::star::beans::Property
>& rProperties
,
65 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
68 * Call me to ensure the repositories have been fetched
70 void getRepositories( const com::sun::star::uno::Reference
<
71 com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
73 libcmis::RepositoryPtr
getRepository( const com::sun::star::uno::Reference
<
74 com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
77 RepoContent( const com::sun::star::uno::Reference
<
78 com::sun::star::uno::XComponentContext
>& rxContext
, ContentProvider
*pProvider
,
79 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& Identifier
,
80 std::vector
< libcmis::RepositoryPtr
> aRepos
= std::vector
< libcmis::RepositoryPtr
> ( ) )
81 throw ( com::sun::star::ucb::ContentCreationException
);
83 virtual ~RepoContent();
85 virtual com::sun::star::uno::Sequence
< com::sun::star::beans::Property
>
86 getProperties( const com::sun::star::uno::Reference
<
87 com::sun::star::ucb::XCommandEnvironment
> & xEnv
);
89 virtual com::sun::star::uno::Sequence
< com::sun::star::ucb::CommandInfo
>
90 getCommands( const com::sun::star::uno::Reference
<
91 com::sun::star::ucb::XCommandEnvironment
> & xEnv
);
93 virtual OUString
getParentURL();
99 virtual OUString SAL_CALL
100 getImplementationName()
101 throw( com::sun::star::uno::RuntimeException
);
103 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
104 getSupportedServiceNames()
105 throw( com::sun::star::uno::RuntimeException
);
107 virtual OUString SAL_CALL
109 throw( com::sun::star::uno::RuntimeException
);
111 virtual com::sun::star::uno::Any SAL_CALL
112 execute( const com::sun::star::ucb::Command
& aCommand
,
114 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
)
115 throw( com::sun::star::uno::Exception
, com::sun::star::ucb::CommandAbortedException
, com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
abort( sal_Int32 CommandId
)
118 throw( com::sun::star::uno::RuntimeException
);
120 virtual std::list
< com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> > getChildren( );
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */