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/repository.hxx>
27 namespace com
{ namespace sun
{ namespace star
{
44 #define CMIS_REPO_TYPE "application/vnd.libreoffice.cmis-repository"
46 class ContentProvider
;
47 class RepoContent
: public ::ucbhelper::ContentImplHelper
,
48 public ChildrenProvider
51 ContentProvider
* m_pProvider
;
53 OUString m_sRepositoryId
;
55 std::list
< libcmis::RepositoryPtr
> m_aRepositories
;
59 com::sun::star::uno::Any
getBadArgExcept();
61 com::sun::star::uno::Reference
< com::sun::star::sdbc::XRow
>
63 const com::sun::star::uno::Sequence
< com::sun::star::beans::Property
>& rProperties
,
64 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
67 * Call me to ensure the repositories have been fetched
69 void getRepositories( const com::sun::star::uno::Reference
<
70 com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
72 libcmis::RepositoryPtr
getRepository( const com::sun::star::uno::Reference
<
73 com::sun::star::ucb::XCommandEnvironment
>& xEnv
);
76 RepoContent( const com::sun::star::uno::Reference
<
77 com::sun::star::uno::XComponentContext
>& rxContext
, ContentProvider
*pProvider
,
78 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& Identifier
,
79 std::list
< libcmis::RepositoryPtr
> aRepos
= std::list
< libcmis::RepositoryPtr
> ( ) )
80 throw ( com::sun::star::ucb::ContentCreationException
);
82 virtual ~RepoContent();
84 virtual com::sun::star::uno::Sequence
< com::sun::star::beans::Property
>
85 getProperties( const com::sun::star::uno::Reference
<
86 com::sun::star::ucb::XCommandEnvironment
> & xEnv
);
88 virtual com::sun::star::uno::Sequence
< com::sun::star::ucb::CommandInfo
>
89 getCommands( const com::sun::star::uno::Reference
<
90 com::sun::star::ucb::XCommandEnvironment
> & xEnv
);
92 virtual OUString
getParentURL();
98 virtual OUString SAL_CALL
99 getImplementationName()
100 throw( com::sun::star::uno::RuntimeException
);
102 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
103 getSupportedServiceNames()
104 throw( com::sun::star::uno::RuntimeException
);
106 virtual OUString SAL_CALL
108 throw( com::sun::star::uno::RuntimeException
);
110 virtual com::sun::star::uno::Any SAL_CALL
111 execute( const com::sun::star::ucb::Command
& aCommand
,
113 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
)
114 throw( com::sun::star::uno::Exception
, com::sun::star::ucb::CommandAbortedException
, com::sun::star::uno::RuntimeException
);
116 virtual void SAL_CALL
abort( sal_Int32 CommandId
)
117 throw( com::sun::star::uno::RuntimeException
);
119 virtual std::list
< com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> > getChildren( );
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */