update credits
[LibreOffice.git] / ucb / source / ucp / ftp / ftpcontentprovider.hxx
blob3ec371cd39980b4213fd914f64a172ef1100a1dd
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 .
20 #ifndef _FTP_FTPCONTENTPROVIDER_HXX_
21 #define _FTP_FTPCONTENTPROVIDER_HXX_
23 #include <vector>
24 #include <osl/mutex.hxx>
25 #include <ucbhelper/macros.hxx>
26 #include <ucbhelper/proxydecider.hxx>
27 #include <ucbhelper/providerhelper.hxx>
28 #include <com/sun/star/ucb/XContentProviderManager.hpp>
29 #include "ftphandleprovider.hxx"
30 #include "ftpurl.hxx"
32 // UNO service name for the provider. This name will be used by the UCB to
33 // create instances of the provider.
35 #define FTP_CONTENT_PROVIDER_SERVICE_NAME "com.sun.star.ucb.FTPContentProvider"
36 #define FTP_CONTENT_TYPE "application/ftp-content"
39 /**
40 * Definition of ftpcontentprovider
45 namespace ftp {
48 class FTPLoaderThread;
51 class FTPContentProvider:
52 public ::ucbhelper::ContentProviderImplHelper,
53 public FTPHandleProvider
55 public:
57 FTPContentProvider(
58 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
60 ~FTPContentProvider();
62 // XInterface
63 XINTERFACE_DECL()
65 // XTypeProvider
66 XTYPEPROVIDER_DECL()
68 // XServiceInfo
69 XSERVICEINFO_DECL()
71 // XContentProvider
72 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > SAL_CALL
73 queryContent(
74 const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier )
75 throw( com::sun::star::ucb::IllegalIdentifierException,
76 com::sun::star::uno::RuntimeException );
78 // FTPHandleProvider.
80 virtual CURL* handle();
82 virtual bool forHost(const OUString& host,
83 const OUString& port,
84 const OUString& username,
85 OUString& password,
86 OUString& account);
88 virtual bool setHost(const OUString& host,
89 const OUString& port,
90 const OUString& username,
91 const OUString& password,
92 const OUString& account);
95 struct ServerInfo {
96 OUString host;
97 OUString port;
98 OUString username;
99 OUString password;
100 OUString account;
103 private:
105 osl::Mutex m_aMutex;
106 FTPLoaderThread *m_ftpLoaderThread;
107 ucbhelper::InternetProxyDecider *m_pProxyDecider;
108 std::vector<ServerInfo> m_ServerInfo;
110 void init();
112 com::sun::star::uno::Reference<com::sun::star::ucb::XContentProvider>
113 getHttpProvider()
114 throw(com::sun::star::uno::RuntimeException);
116 }; // end class FTPContentProvider
118 } // end namespace ftp
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */