merge the formfield patch from ooo-build
[ooovba.git] / ucb / source / ucp / ftp / ftpcontent.hxx
blob0d8cd8e4257f5de26e768f9e996682b3ef1e1321
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpcontent.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _FTP_FTPCONTENT_HXX
32 #define _FTP_FTPCONTENT_HXX
34 #include <ucbhelper/contenthelper.hxx>
35 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
36 #include <com/sun/star/ucb/XContentCreator.hpp>
37 #include "ftpurl.hxx"
40 namespace com { namespace sun { namespace star { namespace beans {
41 struct Property;
42 struct PropertyValue;
43 } } } }
45 namespace com { namespace sun { namespace star { namespace sdbc {
46 class XRow;
47 } } } }
50 namespace ftp
53 //=========================================================================
55 // UNO service name for the content.
56 #define FTP_CONTENT_SERVICE_NAME "com.sun.star.ucb.FTPContent"
58 //=========================================================================
60 struct ContentProperties
62 ::rtl::OUString aTitle; // Title
63 ::rtl::OUString aContentType; // ContentType
64 sal_Bool bIsDocument; // IsDocument
65 sal_Bool bIsFolder; // IsFolder
67 ContentProperties()
68 : bIsDocument( sal_True ), bIsFolder( sal_False ) {}
71 //=========================================================================
73 class FTPContentProvider;
75 //=========================================================================
77 class FTPContent
78 : public ::ucbhelper::ContentImplHelper,
79 public com::sun::star::ucb::XContentCreator
81 public:
83 FTPContent( const ::com::sun::star::uno::Reference<
84 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
85 FTPContentProvider* pProvider,
86 const ::com::sun::star::uno::Reference<
87 ::com::sun::star::ucb::XContentIdentifier >& Identifier);
89 FTPContent( const ::com::sun::star::uno::Reference<
90 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
91 FTPContentProvider* pProvider,
92 const ::com::sun::star::uno::Reference<
93 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
94 const FTPURL& FtpUrl);
96 FTPContent( const ::com::sun::star::uno::Reference<
97 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
98 FTPContentProvider* pProvider,
99 const ::com::sun::star::uno::Reference<
100 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
101 const com::sun::star::ucb::ContentInfo& aInfo);
104 virtual ~FTPContent();
106 // XInterface
107 XINTERFACE_DECL()
109 // XTypeProvider
110 XTYPEPROVIDER_DECL()
112 // XServiceInfo
113 XSERVICEINFO_DECL()
115 // XContent
116 virtual rtl::OUString SAL_CALL
117 getContentType()
118 throw( com::sun::star::uno::RuntimeException );
120 // XCommandProcessor
121 virtual com::sun::star::uno::Any SAL_CALL
122 execute( const com::sun::star::ucb::Command& aCommand,
123 sal_Int32 CommandId,
124 const com::sun::star::uno::Reference<
125 com::sun::star::ucb::XCommandEnvironment >& Environment )
126 throw( com::sun::star::uno::Exception,
127 com::sun::star::ucb::CommandAbortedException,
128 com::sun::star::uno::RuntimeException );
130 virtual void SAL_CALL
131 abort(sal_Int32 CommandId)
132 throw( com::sun::star::uno::RuntimeException);
134 // XContentCreator
135 virtual com::sun::star::uno::Sequence<
136 com::sun::star::ucb::ContentInfo > SAL_CALL
137 queryCreatableContentsInfo( )
138 throw (com::sun::star::uno::RuntimeException);
140 virtual com::sun::star::uno::Reference<
141 com::sun::star::ucb::XContent > SAL_CALL
142 createNewContent( const com::sun::star::ucb::ContentInfo& Info )
143 throw (com::sun::star::uno::RuntimeException);
145 // XChild
147 virtual ::com::sun::star::uno::Reference<
148 ::com::sun::star::uno::XInterface > SAL_CALL
149 getParent( )
150 throw (::com::sun::star::uno::RuntimeException);
152 virtual void SAL_CALL
153 setParent( const ::com::sun::star::uno::Reference<
154 ::com::sun::star::uno::XInterface >& Parent )
155 throw (::com::sun::star::lang::NoSupportException,
156 ::com::sun::star::uno::RuntimeException);
159 private:
161 FTPContentProvider *m_pFCP;
162 FTPURL m_aFTPURL;
163 bool m_bInserted;
164 bool m_bTitleSet;
165 com::sun::star::ucb::ContentInfo m_aInfo;
167 virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
168 getProperties( const com::sun::star::uno::Reference<
169 com::sun::star::ucb::XCommandEnvironment > & xEnv );
172 virtual com::sun::star::uno::Sequence<
173 com::sun::star::ucb::CommandInfo>
174 getCommands(const com::sun::star::uno::Reference<
175 com::sun::star::ucb::XCommandEnvironment > & xEnv);
178 virtual ::rtl::OUString getParentURL();
180 com::sun::star::uno::Reference<com::sun::star::sdbc::XRow>
181 getPropertyValues(
182 const com::sun::star::uno::Sequence<
183 com::sun::star::beans::Property>& seqProp,
184 const com::sun::star::uno::Reference<
185 com::sun::star::ucb::XCommandEnvironment >& Environment
188 com::sun::star::uno::Sequence<com::sun::star::uno::Any>
189 setPropertyValues(
190 const ::com::sun::star::uno::Sequence<
191 ::com::sun::star::beans::PropertyValue>& seqPropVal);
193 void insert(const com::sun::star::ucb::InsertCommandArgument&,
194 const com::sun::star::uno::Reference<
195 com::sun::star::ucb::XCommandEnvironment>&);
200 #endif