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 INCLUDED_UCB_SOURCE_UCP_CMIS_CMIS_REPO_CONTENT_HXX
11 #define INCLUDED_UCB_SOURCE_UCP_CMIS_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
) SAL_OVERRIDE
;
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
) SAL_OVERRIDE
;
93 virtual OUString
getParentURL() SAL_OVERRIDE
;
96 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
)
97 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual void SAL_CALL
acquire()
100 virtual void SAL_CALL
release()
101 throw() SAL_OVERRIDE
;
103 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
104 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes()
106 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual OUString SAL_CALL
109 getImplementationName()
110 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
113 getSupportedServiceNames()
114 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 virtual OUString SAL_CALL
118 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
120 virtual com::sun::star::uno::Any SAL_CALL
121 execute( const com::sun::star::ucb::Command
& aCommand
,
123 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
)
124 throw( com::sun::star::uno::Exception
, com::sun::star::ucb::CommandAbortedException
, com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
126 virtual void SAL_CALL
abort( sal_Int32 CommandId
)
127 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 virtual std::list
< com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> > getChildren( ) SAL_OVERRIDE
;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */