Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / ucb / source / ucp / cmis / cmis_repo_content.hxx
blob176df1b5f6cfd3696098302ed20c9ccb3aa755eb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Version: MPL 1.1 / GPLv3+ / LGPLv3+
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License or as specified alternatively below. You may obtain a copy of
8 * the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * Major Contributor(s):
16 * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
18 * All Rights Reserved.
20 * For minor contributions see the git repository.
22 * Alternatively, the contents of this file may be used under the terms of
23 * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 * instead of those above.
29 #ifndef CMIS_REPO_CONTENT_HXX
30 #define CMIS_REPO_CONTENT_HXX
32 #include "cmis_url.hxx"
33 #include "children_provider.hxx"
35 #include <com/sun/star/io/XInputStream.hpp>
36 #include <com/sun/star/io/XOutputStream.hpp>
37 #include <com/sun/star/ucb/ContentCreationException.hpp>
38 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
39 #include <com/sun/star/ucb/TransferInfo.hpp>
40 #include <com/sun/star/ucb/XContentCreator.hpp>
41 #include <ucbhelper/contenthelper.hxx>
42 #include <libcmis/repository.hxx>
44 #include <list>
46 namespace com { namespace sun { namespace star {
47 namespace beans {
48 struct Property;
49 struct PropertyValue;
51 namespace sdbc {
52 class XRow;
54 }}}
55 namespace ucbhelper
57 class Content;
61 namespace cmis
63 #define CMIS_REPO_TYPE "application/vnd.libreoffice.cmis-repository"
65 class ContentProvider;
66 class RepoContent : public ::ucbhelper::ContentImplHelper,
67 public ChildrenProvider
69 private:
70 ContentProvider* m_pProvider;
71 URL m_aURL;
72 rtl::OUString m_sRepositoryId;
74 std::list< libcmis::RepositoryPtr > m_aRepositories;
76 private:
78 com::sun::star::uno::Any getBadArgExcept();
80 com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
81 getPropertyValues(
82 const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& rProperties,
83 const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv );
86 * Call me to ensure the repositories have been fetched
88 void getRepositories( const com::sun::star::uno::Reference<
89 com::sun::star::ucb::XCommandEnvironment >& xEnv );
91 libcmis::RepositoryPtr getRepository( const com::sun::star::uno::Reference<
92 com::sun::star::ucb::XCommandEnvironment >& xEnv );
94 public:
95 RepoContent( const com::sun::star::uno::Reference<
96 com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider,
97 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier,
98 std::list< libcmis::RepositoryPtr > aRepos = std::list< libcmis::RepositoryPtr > ( ) )
99 throw ( com::sun::star::ucb::ContentCreationException );
101 virtual ~RepoContent();
103 virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
104 getProperties( const com::sun::star::uno::Reference<
105 com::sun::star::ucb::XCommandEnvironment > & xEnv );
107 virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
108 getCommands( const com::sun::star::uno::Reference<
109 com::sun::star::ucb::XCommandEnvironment > & xEnv );
111 virtual ::rtl::OUString getParentURL();
113 XINTERFACE_DECL()
115 XTYPEPROVIDER_DECL()
117 virtual ::rtl::OUString SAL_CALL
118 getImplementationName()
119 throw( com::sun::star::uno::RuntimeException );
121 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
122 getSupportedServiceNames()
123 throw( com::sun::star::uno::RuntimeException );
125 virtual rtl::OUString SAL_CALL
126 getContentType()
127 throw( com::sun::star::uno::RuntimeException );
129 virtual com::sun::star::uno::Any SAL_CALL
130 execute( const com::sun::star::ucb::Command& aCommand,
131 sal_Int32 CommandId,
132 const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& Environment )
133 throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException );
135 virtual void SAL_CALL abort( sal_Int32 CommandId )
136 throw( com::sun::star::uno::RuntimeException );
138 virtual std::list< com::sun::star::uno::Reference< com::sun::star::ucb::XContent > > getChildren( );
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */