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: ftpcontentprovider.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_FTPCONTENTPROVIDER_HXX_
32 #define _FTP_FTPCONTENTPROVIDER_HXX_
35 #include <osl/mutex.hxx>
36 #include <ucbhelper/macros.hxx>
37 #include <ucbhelper/proxydecider.hxx>
38 #include <ucbhelper/providerhelper.hxx>
39 #include <com/sun/star/ucb/XContentProviderManager.hpp>
40 #include "ftphandleprovider.hxx"
43 // UNO service name for the provider. This name will be used by the UCB to
44 // create instances of the provider.
46 #define FTP_CONTENT_PROVIDER_SERVICE_NAME "com.sun.star.ucb.FTPContentProvider"
47 #define FTP_CONTENT_TYPE "application/ftp-content"
51 * Definition of ftpcontentprovider
59 class FTPLoaderThread
;
62 class FTPContentProvider
:
63 public ::ucbhelper::ContentProviderImplHelper
,
64 public FTPHandleProvider
69 const com::sun::star::uno::Reference
<
70 com::sun::star::lang::XMultiServiceFactory
>& xMSF
);
72 ~FTPContentProvider();
84 virtual com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> SAL_CALL
86 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
>& Identifier
)
87 throw( com::sun::star::ucb::IllegalIdentifierException
,
88 com::sun::star::uno::RuntimeException
);
92 virtual CURL
* handle();
94 virtual bool forHost(const rtl::OUString
& host
,
95 const rtl::OUString
& port
,
96 const rtl::OUString
& username
,
97 rtl::OUString
& password
,
98 rtl::OUString
& account
);
100 virtual bool setHost(const rtl::OUString
& host
,
101 const rtl::OUString
& port
,
102 const rtl::OUString
& username
,
103 const rtl::OUString
& password
,
104 const rtl::OUString
& account
);
110 rtl::OUString username
;
111 rtl::OUString password
;
112 rtl::OUString account
;
118 FTPLoaderThread
*m_ftpLoaderThread
;
119 ucbhelper::InternetProxyDecider
*m_pProxyDecider
;
120 std::vector
<ServerInfo
> m_ServerInfo
;
124 com::sun::star::uno::Reference
<com::sun::star::ucb::XContentProvider
>
126 throw(com::sun::star::uno::RuntimeException
);
128 }; // end class FTPContentProvider
130 } // end namespace ftp