1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_ucb.hxx"
30 
31 /**************************************************************************
32 								TODO
33  **************************************************************************
34 
35  *************************************************************************/
36 #include "ftpcontentidentifier.hxx"
37 #include "ftpcontentprovider.hxx"
38 
39 using namespace ftp;
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::ucb;
42 using namespace com::sun::star::lang;
43 
44 
45 FTPContentIdentifier::FTPContentIdentifier(
46 	const rtl::OUString& ident
47 )
48 	: m_ident(ident)
49 {
50 }
51 
52 
53 FTPContentIdentifier::~FTPContentIdentifier()
54 {
55 }
56 
57 
58 Any SAL_CALL
59 FTPContentIdentifier::queryInterface(
60 	const Type& rType
61 )
62 	throw(
63 		RuntimeException
64 	)
65 {
66 	Any aRet =
67 		::cppu::queryInterface(rType,
68 							   SAL_STATIC_CAST(XTypeProvider*,this),
69 							   SAL_STATIC_CAST(XContentIdentifier*,this));
70 
71 	return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
72 }
73 
74 
75 void SAL_CALL FTPContentIdentifier::acquire( void ) throw() {
76 	OWeakObject::acquire();
77 }
78 
79 
80 void SAL_CALL FTPContentIdentifier::release( void ) throw() {
81 	OWeakObject::release();
82 }
83 
84 
85 Sequence<sal_Int8> SAL_CALL
86 FTPContentIdentifier::getImplementationId()
87 	throw(RuntimeException)
88 {
89 	static cppu::OImplementationId* pId = NULL;
90 	if(!pId)
91     {
92 		osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
93 		if ( !pId )
94 		{
95 			static cppu::OImplementationId id( sal_False );
96 			pId = &id;
97 		}
98     }
99 	return (*pId).getImplementationId();
100 }
101 
102 
103 Sequence<Type> SAL_CALL
104 FTPContentIdentifier::getTypes(
105 	void )
106 	throw(RuntimeException)
107 {
108 	static cppu::OTypeCollection* pCollection = NULL;
109 	if ( !pCollection ) {
110 		osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
111 		if ( !pCollection )
112 		{
113 			static cppu::OTypeCollection collection(
114 				getCppuType(
115 					static_cast<Reference<XTypeProvider>*>(0)),
116 				getCppuType(
117 					static_cast<Reference<XContentIdentifier>*>(0)));
118 			pCollection = &collection;
119 		}
120 	}
121 	return (*pCollection).getTypes();
122 }
123 
124 
125 rtl::OUString SAL_CALL
126 FTPContentIdentifier::getContentIdentifier(
127 )
128 	throw (
129 		com::sun::star::uno::RuntimeException
130 	)
131 {
132 	return m_ident;
133 }
134 
135 
136 rtl::OUString SAL_CALL
137 FTPContentIdentifier::getContentProviderScheme(
138 )
139 	throw (
140 		com::sun::star::uno::RuntimeException
141 	)
142 {
143 	return rtl::OUString::createFromAscii("ftp");
144 }
145 
146 
147 
148 
149 
150 
151