1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpcontent.hxx,v $
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>
40 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{
45 namespace com
{ namespace sun
{ namespace star
{ namespace sdbc
{
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
68 : bIsDocument( sal_True
), bIsFolder( sal_False
) {}
71 //=========================================================================
73 class FTPContentProvider
;
75 //=========================================================================
78 : public ::ucbhelper::ContentImplHelper
,
79 public com::sun::star::ucb::XContentCreator
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();
116 virtual rtl::OUString SAL_CALL
118 throw( com::sun::star::uno::RuntimeException
);
121 virtual com::sun::star::uno::Any SAL_CALL
122 execute( const com::sun::star::ucb::Command
& aCommand
,
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
);
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
);
147 virtual ::com::sun::star::uno::Reference
<
148 ::com::sun::star::uno::XInterface
> SAL_CALL
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
);
161 FTPContentProvider
*m_pFCP
;
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
>
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
>
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
>&);