12f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32f86921cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42f86921cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52f86921cSAndrew Rist  * distributed with this work for additional information
62f86921cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72f86921cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
82f86921cSAndrew Rist  * "License"); you may not use this file except in compliance
92f86921cSAndrew Rist  * with the License.  You may obtain a copy of the License at
102f86921cSAndrew Rist  *
112f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
122f86921cSAndrew Rist  *
132f86921cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
142f86921cSAndrew Rist  * software distributed under the License is distributed on an
152f86921cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162f86921cSAndrew Rist  * KIND, either express or implied.  See the License for the
172f86921cSAndrew Rist  * specific language governing permissions and limitations
182f86921cSAndrew Rist  * under the License.
192f86921cSAndrew Rist  *
202f86921cSAndrew Rist  *************************************************************/
212f86921cSAndrew Rist 
222f86921cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25*421ed02eSdamjan #include "precompiled_ftp.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir /**************************************************************************
28cdf0e10cSrcweir 								TODO
29cdf0e10cSrcweir  **************************************************************************
30cdf0e10cSrcweir 
31cdf0e10cSrcweir  *************************************************************************/
32cdf0e10cSrcweir #include "ftpcontentidentifier.hxx"
33cdf0e10cSrcweir #include "ftpcontentprovider.hxx"
34cdf0e10cSrcweir 
35cdf0e10cSrcweir using namespace ftp;
36cdf0e10cSrcweir using namespace com::sun::star::uno;
37cdf0e10cSrcweir using namespace com::sun::star::ucb;
38cdf0e10cSrcweir using namespace com::sun::star::lang;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 
FTPContentIdentifier(const rtl::OUString & ident)41cdf0e10cSrcweir FTPContentIdentifier::FTPContentIdentifier(
42cdf0e10cSrcweir 	const rtl::OUString& ident
43cdf0e10cSrcweir )
44cdf0e10cSrcweir 	: m_ident(ident)
45cdf0e10cSrcweir {
46cdf0e10cSrcweir }
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
~FTPContentIdentifier()49cdf0e10cSrcweir FTPContentIdentifier::~FTPContentIdentifier()
50cdf0e10cSrcweir {
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 
54cdf0e10cSrcweir Any SAL_CALL
queryInterface(const Type & rType)55cdf0e10cSrcweir FTPContentIdentifier::queryInterface(
56cdf0e10cSrcweir 	const Type& rType
57cdf0e10cSrcweir )
58cdf0e10cSrcweir 	throw(
59cdf0e10cSrcweir 		RuntimeException
60cdf0e10cSrcweir 	)
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	Any aRet =
63cdf0e10cSrcweir 		::cppu::queryInterface(rType,
64cdf0e10cSrcweir 							   SAL_STATIC_CAST(XTypeProvider*,this),
65cdf0e10cSrcweir 							   SAL_STATIC_CAST(XContentIdentifier*,this));
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
68cdf0e10cSrcweir }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
acquire(void)71cdf0e10cSrcweir void SAL_CALL FTPContentIdentifier::acquire( void ) throw() {
72cdf0e10cSrcweir 	OWeakObject::acquire();
73cdf0e10cSrcweir }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 
release(void)76cdf0e10cSrcweir void SAL_CALL FTPContentIdentifier::release( void ) throw() {
77cdf0e10cSrcweir 	OWeakObject::release();
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 
81cdf0e10cSrcweir Sequence<sal_Int8> SAL_CALL
getImplementationId()82cdf0e10cSrcweir FTPContentIdentifier::getImplementationId()
83cdf0e10cSrcweir 	throw(RuntimeException)
84cdf0e10cSrcweir {
85cdf0e10cSrcweir 	static cppu::OImplementationId* pId = NULL;
86cdf0e10cSrcweir 	if(!pId)
87cdf0e10cSrcweir     {
88cdf0e10cSrcweir 		osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
89cdf0e10cSrcweir 		if ( !pId )
90cdf0e10cSrcweir 		{
91cdf0e10cSrcweir 			static cppu::OImplementationId id( sal_False );
92cdf0e10cSrcweir 			pId = &id;
93cdf0e10cSrcweir 		}
94cdf0e10cSrcweir     }
95cdf0e10cSrcweir 	return (*pId).getImplementationId();
96cdf0e10cSrcweir }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 
99cdf0e10cSrcweir Sequence<Type> SAL_CALL
getTypes(void)100cdf0e10cSrcweir FTPContentIdentifier::getTypes(
101cdf0e10cSrcweir 	void )
102cdf0e10cSrcweir 	throw(RuntimeException)
103cdf0e10cSrcweir {
104cdf0e10cSrcweir 	static cppu::OTypeCollection* pCollection = NULL;
105cdf0e10cSrcweir 	if ( !pCollection ) {
106cdf0e10cSrcweir 		osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
107cdf0e10cSrcweir 		if ( !pCollection )
108cdf0e10cSrcweir 		{
109cdf0e10cSrcweir 			static cppu::OTypeCollection collection(
110cdf0e10cSrcweir 				getCppuType(
111cdf0e10cSrcweir 					static_cast<Reference<XTypeProvider>*>(0)),
112cdf0e10cSrcweir 				getCppuType(
113cdf0e10cSrcweir 					static_cast<Reference<XContentIdentifier>*>(0)));
114cdf0e10cSrcweir 			pCollection = &collection;
115cdf0e10cSrcweir 		}
116cdf0e10cSrcweir 	}
117cdf0e10cSrcweir 	return (*pCollection).getTypes();
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 
121cdf0e10cSrcweir rtl::OUString SAL_CALL
getContentIdentifier()122cdf0e10cSrcweir FTPContentIdentifier::getContentIdentifier(
123cdf0e10cSrcweir )
124cdf0e10cSrcweir 	throw (
125cdf0e10cSrcweir 		com::sun::star::uno::RuntimeException
126cdf0e10cSrcweir 	)
127cdf0e10cSrcweir {
128cdf0e10cSrcweir 	return m_ident;
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 
132cdf0e10cSrcweir rtl::OUString SAL_CALL
getContentProviderScheme()133cdf0e10cSrcweir FTPContentIdentifier::getContentProviderScheme(
134cdf0e10cSrcweir )
135cdf0e10cSrcweir 	throw (
136cdf0e10cSrcweir 		com::sun::star::uno::RuntimeException
137cdf0e10cSrcweir 	)
138cdf0e10cSrcweir {
139cdf0e10cSrcweir 	return rtl::OUString::createFromAscii("ftp");
140cdf0e10cSrcweir }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 
147