fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / ucb / source / ucp / gvfs / gvfs_content.hxx
blobbae3fca3b82357227dad54150cd2c586854a280f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_CONTENT_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_CONTENT_HXX
22 #include <memory>
23 #include <list>
24 #include <rtl/ref.hxx>
25 #include <com/sun/star/ucb/ContentCreationException.hpp>
26 #include <com/sun/star/ucb/XContentCreator.hpp>
27 #include <ucbhelper/contenthelper.hxx>
29 #include <glib.h>
30 #include <libgnomevfs/gnome-vfs-ops.h>
31 #include <libgnomevfs/gnome-vfs-directory.h>
33 namespace com { namespace sun { namespace star { namespace beans {
34 struct Property;
35 struct PropertyValue;
36 } } } }
38 namespace com { namespace sun { namespace star { namespace io {
39 class XInputStream;
40 class XOutputStream;
41 } } } }
43 namespace com { namespace sun { namespace star { namespace sdbc {
44 class XRow;
45 } } } }
47 namespace com { namespace sun { namespace star { namespace ucb {
48 struct TransferInfo;
49 } } } }
51 namespace gvfs
54 class ContentProvider;
56 // Random made up names - AFAICS
57 #define GVFS_FILE_TYPE "application/vnd.sun.staroffice.gvfs-file"
58 #define GVFS_FOLDER_TYPE "application/vnd.sun.staroffice.gvfs-folder"
60 class Authentication
62 public:
63 // Helper class to make exceptions pleasant
64 Authentication( const com::sun::star::uno::Reference<
65 com::sun::star::ucb::XCommandEnvironment > & xEnv );
66 ~Authentication();
69 class Content : public ::ucbhelper::ContentImplHelper,
70 public com::sun::star::ucb::XContentCreator
73 // Internals
75 private:
76 typedef rtl::Reference< Content > ContentRef;
77 typedef std::list< ContentRef > ContentRefList;
79 // Instance data
80 ContentProvider *m_pProvider; // No need for a ref, base class holds object
81 sal_Bool m_bTransient; // A non-existent (as yet) item
82 GnomeVFSFileInfo m_info; // cached status information
84 // Internal helpers
85 void queryChildren ( ContentRefList& rChildren );
86 ::com::sun::star::uno::Any getBadArgExcept ();
87 GnomeVFSResult getInfo ( const ::com::sun::star::uno::Reference<
88 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
89 sal_Bool isFolder ( const ::com::sun::star::uno::Reference<
90 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
91 sal_Bool exchangeIdentity( const ::com::sun::star::uno::Reference<
92 ::com::sun::star::ucb::XContentIdentifier >& xNewId);
93 GnomeVFSResult doSetFileInfo ( const GnomeVFSFileInfo *newInfo,
94 GnomeVFSSetFileInfoMask setMask,
95 const ::com::sun::star::uno::Reference<
96 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
97 OUString makeNewURL ( const char *newName );
98 // End Internal helpers
100 // For ucbhelper
101 virtual OUString getParentURL() SAL_OVERRIDE;
102 // For ucbhelper
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 ) SAL_OVERRIDE;
106 // For ucbhelper
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 ) SAL_OVERRIDE;
111 public:
112 // Command "getPropertyValues"
113 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
114 getPropertyValues( const ::com::sun::star::uno::Sequence<
115 ::com::sun::star::beans::Property >& rProperties,
116 const ::com::sun::star::uno::Reference<
117 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
119 private:
120 // Command "setPropertyValues"
121 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
122 setPropertyValues( const ::com::sun::star::uno::Sequence<
123 ::com::sun::star::beans::PropertyValue >& rValues,
124 const ::com::sun::star::uno::Reference<
125 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
127 // Command "insert"
128 void insert( const ::com::sun::star::uno::Reference<
129 ::com::sun::star::io::XInputStream > & xInputStream,
130 sal_Bool bReplaceExisting,
131 const com::sun::star::uno::Reference<
132 com::sun::star::ucb::XCommandEnvironment >& xEnv )
133 throw( ::com::sun::star::uno::Exception );
135 // Command "transfer"
136 void transfer( const ::com::sun::star::ucb::TransferInfo & rArgs,
137 const com::sun::star::uno::Reference<
138 com::sun::star::ucb::XCommandEnvironment >& xEnv )
139 throw( ::com::sun::star::uno::Exception );
141 // Command "delete"
142 void destroy( sal_Bool bDeletePhysical )
143 throw( ::com::sun::star::uno::Exception );
145 // "open" helpers
146 void copyData( ::com::sun::star::uno::Reference<
147 ::com::sun::star::io::XInputStream > xIn,
148 ::com::sun::star::uno::Reference<
149 ::com::sun::star::io::XOutputStream > xOut );
151 ::com::sun::star::uno::Reference<
152 ::com::sun::star::io::XInputStream >
153 createTempStream( const ::com::sun::star::uno::Reference<
154 com::sun::star::ucb::XCommandEnvironment >& xEnv )
155 throw( ::com::sun::star::uno::Exception );
156 ::com::sun::star::uno::Reference<
157 ::com::sun::star::io::XInputStream >
158 createInputStream( const ::com::sun::star::uno::Reference<
159 com::sun::star::ucb::XCommandEnvironment >& xEnv )
160 throw( ::com::sun::star::uno::Exception );
161 sal_Bool feedSink( ::com::sun::star::uno::Reference<
162 ::com::sun::star::uno::XInterface> aSink,
163 const ::com::sun::star::uno::Reference<
164 com::sun::star::ucb::XCommandEnvironment >& xEnv );
166 ::com::sun::star::uno::Any mapVFSException( const GnomeVFSResult result,
167 sal_Bool bWrite );
169 void cancelCommandExecution(const GnomeVFSResult result,
170 const ::com::sun::star::uno::Reference<
171 com::sun::star::ucb::XCommandEnvironment > & xEnv,
172 sal_Bool bWrite = sal_False )
173 throw( ::com::sun::star::uno::Exception );
176 public:
177 // Non-interface bits
178 char *getURI ();
179 OString getOURI ();
180 OUString getOUURI ();
183 // Externals
185 public:
187 Content( const ::com::sun::star::uno::Reference<
188 ::com::sun::star::uno::XComponentContext >& rxContext,
189 ContentProvider *pProvider,
190 const ::com::sun::star::uno::Reference<
191 ::com::sun::star::ucb::XContentIdentifier >& Identifier)
192 throw ( ::com::sun::star::ucb::ContentCreationException );
193 Content( const ::com::sun::star::uno::Reference<
194 ::com::sun::star::uno::XComponentContext >& rxContext,
195 ContentProvider *pProvider,
196 const ::com::sun::star::uno::Reference<
197 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
198 sal_Bool isFolder)
199 throw ( ::com::sun::star::ucb::ContentCreationException );
200 virtual ~Content();
202 // XInterface
203 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
204 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
205 virtual void SAL_CALL acquire()
206 throw() SAL_OVERRIDE;
207 virtual void SAL_CALL release()
208 throw() SAL_OVERRIDE;
210 // XTypeProvider
211 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
212 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
213 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
214 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
216 // XServiceInfo
217 virtual OUString SAL_CALL getImplementationName()
218 throw( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
219 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
220 getSupportedServiceNames()
221 throw( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
223 // XContent
224 virtual OUString SAL_CALL
225 getContentType()
226 throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
228 // XCommandProcessor
229 virtual com::sun::star::uno::Any SAL_CALL
230 execute( const com::sun::star::ucb::Command& aCommand,
231 sal_Int32 CommandId,
232 const com::sun::star::uno::Reference<
233 com::sun::star::ucb::XCommandEnvironment >& xEnv )
234 throw( com::sun::star::uno::Exception,
235 com::sun::star::ucb::CommandAbortedException,
236 com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
237 virtual void SAL_CALL
238 abort( sal_Int32 CommandId )
239 throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
242 // Additional interfaces
245 // XContentCreator
246 virtual com::sun::star::uno::Sequence<
247 com::sun::star::ucb::ContentInfo > SAL_CALL
248 queryCreatableContentsInfo()
249 throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
250 virtual com::sun::star::uno::Reference<
251 com::sun::star::ucb::XContent > SAL_CALL
252 createNewContent( const com::sun::star::ucb::ContentInfo& Info )
253 throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
256 com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo >
257 queryCreatableContentsInfo(
258 const com::sun::star::uno::Reference<
259 com::sun::star::ucb::XCommandEnvironment >& xEnv)
260 throw( com::sun::star::uno::RuntimeException );
265 extern "C" {
266 extern GPrivate *auth_queue;
267 extern void auth_queue_destroy( gpointer data );
270 #endif
272 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */