1f8e2c85aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3f8e2c85aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4f8e2c85aSAndrew Rist * or more contributor license agreements. See the NOTICE file
5f8e2c85aSAndrew Rist * distributed with this work for additional information
6f8e2c85aSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7f8e2c85aSAndrew Rist * to you under the Apache License, Version 2.0 (the
8f8e2c85aSAndrew Rist * "License"); you may not use this file except in compliance
9f8e2c85aSAndrew Rist * with the License. You may obtain a copy of the License at
10f8e2c85aSAndrew Rist *
11f8e2c85aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12f8e2c85aSAndrew Rist *
13f8e2c85aSAndrew Rist * Unless required by applicable law or agreed to in writing,
14f8e2c85aSAndrew Rist * software distributed under the License is distributed on an
15f8e2c85aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e2c85aSAndrew Rist * KIND, either express or implied. See the License for the
17f8e2c85aSAndrew Rist * specific language governing permissions and limitations
18f8e2c85aSAndrew Rist * under the License.
19f8e2c85aSAndrew Rist *
20f8e2c85aSAndrew Rist *************************************************************/
21f8e2c85aSAndrew Rist
22f8e2c85aSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_shell.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "rtl/ustrbuf.hxx"
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include "wininetbackend.hxx"
30cdf0e10cSrcweir
31cdf0e10cSrcweir #if defined _MSC_VER
32cdf0e10cSrcweir #pragma warning(push, 1)
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <windows.h>
35cdf0e10cSrcweir #include <wininet.h>
36cdf0e10cSrcweir #include <sal/alloca.h>
37cdf0e10cSrcweir #if defined _MSC_VER
38cdf0e10cSrcweir #pragma warning(pop)
39cdf0e10cSrcweir #endif
40cdf0e10cSrcweir
41cdf0e10cSrcweir #define WININET_DLL_NAME "wininet.dll"
42cdf0e10cSrcweir #define EQUAL_SIGN '='
43cdf0e10cSrcweir #define COLON ':'
44cdf0e10cSrcweir #define SPACE ' '
45cdf0e10cSrcweir #define SEMI_COLON ';'
46cdf0e10cSrcweir
47cdf0e10cSrcweir namespace {
48cdf0e10cSrcweir
49cdf0e10cSrcweir struct Library {
50cdf0e10cSrcweir HMODULE module;
51cdf0e10cSrcweir
Library__anond7d67ec30111::Library52cdf0e10cSrcweir Library(HMODULE theModule): module(theModule) {}
53cdf0e10cSrcweir
~Library__anond7d67ec30111::Library54cdf0e10cSrcweir ~Library() { if (module) FreeLibrary(module); }
55cdf0e10cSrcweir };
56cdf0e10cSrcweir
57cdf0e10cSrcweir }
58cdf0e10cSrcweir
59cdf0e10cSrcweir typedef struct
60cdf0e10cSrcweir {
61cdf0e10cSrcweir rtl::OUString Server;
62cdf0e10cSrcweir rtl::OUString Port;
63cdf0e10cSrcweir } ProxyEntry;
64cdf0e10cSrcweir
65cdf0e10cSrcweir //------------------------------------------------------------------------
66cdf0e10cSrcweir // helper functions
67cdf0e10cSrcweir //------------------------------------------------------------------------
68cdf0e10cSrcweir
69cdf0e10cSrcweir namespace // private
70cdf0e10cSrcweir {
ReadProxyEntry(const rtl::OUString & aProxy,sal_Int32 & i)71cdf0e10cSrcweir ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i)
72cdf0e10cSrcweir {
73cdf0e10cSrcweir ProxyEntry aProxyEntry;
74cdf0e10cSrcweir
75cdf0e10cSrcweir aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
76cdf0e10cSrcweir if ( i > -1 )
77cdf0e10cSrcweir aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
78cdf0e10cSrcweir
79cdf0e10cSrcweir return aProxyEntry;
80cdf0e10cSrcweir }
81cdf0e10cSrcweir
FindProxyEntry(const rtl::OUString & aProxyList,const rtl::OUString & aType)82cdf0e10cSrcweir ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType)
83cdf0e10cSrcweir {
84cdf0e10cSrcweir sal_Int32 nIndex = 0;
85cdf0e10cSrcweir
86cdf0e10cSrcweir do
87cdf0e10cSrcweir {
88cdf0e10cSrcweir // get the next token, e.g. ftp=server:port
89cdf0e10cSrcweir rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
90cdf0e10cSrcweir
91cdf0e10cSrcweir // split the next token again into the parts separated
92cdf0e10cSrcweir // through '=', e.g. ftp=server:port -> ftp and server:port
93cdf0e10cSrcweir sal_Int32 i = 0;
94cdf0e10cSrcweir if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
95cdf0e10cSrcweir {
96cdf0e10cSrcweir if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
97cdf0e10cSrcweir return ReadProxyEntry(nextToken, i);
98cdf0e10cSrcweir }
99cdf0e10cSrcweir else if( aType.getLength() == 0)
100cdf0e10cSrcweir return ReadProxyEntry(nextToken, i);
101cdf0e10cSrcweir
102cdf0e10cSrcweir } while ( nIndex >= 0 );
103cdf0e10cSrcweir
104cdf0e10cSrcweir return ProxyEntry();
105cdf0e10cSrcweir }
106cdf0e10cSrcweir
107cdf0e10cSrcweir } // end private namespace
108cdf0e10cSrcweir
109cdf0e10cSrcweir //------------------------------------------------------------------------------
110cdf0e10cSrcweir
WinInetBackend()111cdf0e10cSrcweir WinInetBackend::WinInetBackend()
112cdf0e10cSrcweir {
113cdf0e10cSrcweir Library hWinInetDll( LoadLibrary( WININET_DLL_NAME ) );
114cdf0e10cSrcweir if( hWinInetDll.module )
115cdf0e10cSrcweir {
116cdf0e10cSrcweir typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD );
117cdf0e10cSrcweir
118cdf0e10cSrcweir InternetQueryOption_Proc_T lpfnInternetQueryOption =
119cdf0e10cSrcweir reinterpret_cast< InternetQueryOption_Proc_T >(
120cdf0e10cSrcweir GetProcAddress( hWinInetDll.module, "InternetQueryOptionA" ) );
121cdf0e10cSrcweir if (lpfnInternetQueryOption)
122cdf0e10cSrcweir {
123cdf0e10cSrcweir LPINTERNET_PROXY_INFO lpi = NULL;
124cdf0e10cSrcweir
125*86e1cf34SPedro Giffuni // query for the necessary space
126cdf0e10cSrcweir DWORD dwLength = 0;
127cdf0e10cSrcweir BOOL bRet = lpfnInternetQueryOption(
128cdf0e10cSrcweir NULL,
129cdf0e10cSrcweir INTERNET_OPTION_PROXY,
130cdf0e10cSrcweir (LPVOID)lpi,
131cdf0e10cSrcweir &dwLength );
132cdf0e10cSrcweir
133cdf0e10cSrcweir // allocate sufficient space on the heap
134cdf0e10cSrcweir // insufficient space on the heap results
135cdf0e10cSrcweir // in a stack overflow exception, we assume
136cdf0e10cSrcweir // this never happens, because of the relatively
137cdf0e10cSrcweir // small amount of memory we need
138cdf0e10cSrcweir // alloca is nice because it is fast and we don't
139cdf0e10cSrcweir // have to free the allocated memory, it will be
140cdf0e10cSrcweir // automatically done
141cdf0e10cSrcweir lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
142cdf0e10cSrcweir alloca( dwLength ) );
143cdf0e10cSrcweir
144cdf0e10cSrcweir bRet = lpfnInternetQueryOption(
145cdf0e10cSrcweir NULL,
146cdf0e10cSrcweir INTERNET_OPTION_PROXY,
147cdf0e10cSrcweir (LPVOID)lpi,
148cdf0e10cSrcweir &dwLength );
149cdf0e10cSrcweir
150cdf0e10cSrcweir // if a proxy is disabled, InternetQueryOption returns
151cdf0e10cSrcweir // an empty proxy list, so we don't have to check if
152cdf0e10cSrcweir // proxy is enabled or not
153cdf0e10cSrcweir
154cdf0e10cSrcweir rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy );
155cdf0e10cSrcweir rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
156cdf0e10cSrcweir
157cdf0e10cSrcweir // override default for ProxyType, which is "0" meaning "No proxies".
158cdf0e10cSrcweir sal_Int32 nProperties = 1;
159cdf0e10cSrcweir
160cdf0e10cSrcweir valueProxyType_.IsPresent = true;
161cdf0e10cSrcweir valueProxyType_.Value <<= nProperties;
162cdf0e10cSrcweir
163cdf0e10cSrcweir // fill proxy bypass list
164cdf0e10cSrcweir if( aProxyBypassList.getLength() > 0 )
165cdf0e10cSrcweir {
166cdf0e10cSrcweir rtl::OUStringBuffer aReverseList;
167cdf0e10cSrcweir sal_Int32 nIndex = 0;
168cdf0e10cSrcweir do
169cdf0e10cSrcweir {
170cdf0e10cSrcweir rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex );
171cdf0e10cSrcweir if ( aProxyList.indexOf( aToken ) == -1 )
172cdf0e10cSrcweir {
173cdf0e10cSrcweir if ( aReverseList.getLength() )
174cdf0e10cSrcweir {
175cdf0e10cSrcweir aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) );
176cdf0e10cSrcweir aReverseList.insert( 0, aToken );
177cdf0e10cSrcweir }
178cdf0e10cSrcweir else
179cdf0e10cSrcweir aReverseList = aToken;
180cdf0e10cSrcweir }
181cdf0e10cSrcweir }
182cdf0e10cSrcweir while ( nIndex >= 0 );
183cdf0e10cSrcweir
184cdf0e10cSrcweir aProxyBypassList = aReverseList.makeStringAndClear();
185cdf0e10cSrcweir
186cdf0e10cSrcweir valueNoProxy_.IsPresent = true;
187cdf0e10cSrcweir valueNoProxy_.Value <<= aProxyBypassList.replace( SPACE, SEMI_COLON );
188cdf0e10cSrcweir }
189cdf0e10cSrcweir
190cdf0e10cSrcweir if( aProxyList.getLength() > 0 )
191cdf0e10cSrcweir {
192cdf0e10cSrcweir //-------------------------------------------------
193cdf0e10cSrcweir // this implementation follows the algorithm
194cdf0e10cSrcweir // of the internet explorer
195cdf0e10cSrcweir // if there are type-dependent proxy settings
196cdf0e10cSrcweir // and type independent proxy settings in the
197cdf0e10cSrcweir // registry the internet explorer chooses the
198cdf0e10cSrcweir // type independent proxy for all settings
199cdf0e10cSrcweir // e.g. imagine the following registry entry
200cdf0e10cSrcweir // ftp=server:port;http=server:port;server:port
201cdf0e10cSrcweir // the last token server:port is type independent
202cdf0e10cSrcweir // so the ie chooses this proxy server
203cdf0e10cSrcweir
204cdf0e10cSrcweir // if there is no port specified for a type independent
205cdf0e10cSrcweir // server the ie uses the port of an http server if
206cdf0e10cSrcweir // there is one and it has a port
207cdf0e10cSrcweir //-------------------------------------------------
208cdf0e10cSrcweir
209cdf0e10cSrcweir ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
210cdf0e10cSrcweir ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
211cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
212cdf0e10cSrcweir ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
213cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
214cdf0e10cSrcweir
215cdf0e10cSrcweir ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
216cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
217cdf0e10cSrcweir
218cdf0e10cSrcweir if( aTypeIndepProxy.Server.getLength() )
219cdf0e10cSrcweir {
220cdf0e10cSrcweir aHttpProxy.Server = aTypeIndepProxy.Server;
221cdf0e10cSrcweir aHttpsProxy.Server = aTypeIndepProxy.Server;
222cdf0e10cSrcweir aFtpProxy.Server = aTypeIndepProxy.Server;
223cdf0e10cSrcweir
224cdf0e10cSrcweir if( aTypeIndepProxy.Port.getLength() )
225cdf0e10cSrcweir {
226cdf0e10cSrcweir aHttpProxy.Port = aTypeIndepProxy.Port;
227cdf0e10cSrcweir aHttpsProxy.Port = aTypeIndepProxy.Port;
228cdf0e10cSrcweir aFtpProxy.Port = aTypeIndepProxy.Port;
229cdf0e10cSrcweir }
230cdf0e10cSrcweir else
231cdf0e10cSrcweir {
232cdf0e10cSrcweir aFtpProxy.Port = aHttpProxy.Port;
233cdf0e10cSrcweir aHttpsProxy.Port = aHttpProxy.Port;
234cdf0e10cSrcweir }
235cdf0e10cSrcweir }
236cdf0e10cSrcweir
237cdf0e10cSrcweir // http proxy name
238cdf0e10cSrcweir if( aHttpProxy.Server.getLength() > 0 )
239cdf0e10cSrcweir {
240cdf0e10cSrcweir valueHttpProxyName_.IsPresent = true;
241cdf0e10cSrcweir valueHttpProxyName_.Value <<= aHttpProxy.Server;
242cdf0e10cSrcweir }
243cdf0e10cSrcweir
244cdf0e10cSrcweir // http proxy port
245cdf0e10cSrcweir if( aHttpProxy.Port.getLength() > 0 )
246cdf0e10cSrcweir {
247cdf0e10cSrcweir valueHttpProxyPort_.IsPresent = true;
248cdf0e10cSrcweir valueHttpProxyPort_.Value <<= aHttpProxy.Port.toInt32();
249cdf0e10cSrcweir }
250cdf0e10cSrcweir
251cdf0e10cSrcweir // https proxy name
252cdf0e10cSrcweir if( aHttpsProxy.Server.getLength() > 0 )
253cdf0e10cSrcweir {
254cdf0e10cSrcweir valueHttpsProxyName_.IsPresent = true;
255cdf0e10cSrcweir valueHttpsProxyName_.Value <<= aHttpsProxy.Server;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir
258cdf0e10cSrcweir // https proxy port
259cdf0e10cSrcweir if( aHttpsProxy.Port.getLength() > 0 )
260cdf0e10cSrcweir {
261cdf0e10cSrcweir valueHttpsProxyPort_.IsPresent = true;
262cdf0e10cSrcweir valueHttpsProxyPort_.Value <<= aHttpsProxy.Port.toInt32();
263cdf0e10cSrcweir }
264cdf0e10cSrcweir
265cdf0e10cSrcweir // ftp proxy name
266cdf0e10cSrcweir if( aFtpProxy.Server.getLength() > 0 )
267cdf0e10cSrcweir {
268cdf0e10cSrcweir valueFtpProxyName_.IsPresent = true;
269cdf0e10cSrcweir valueFtpProxyName_.Value <<= aFtpProxy.Server;
270cdf0e10cSrcweir }
271cdf0e10cSrcweir
272cdf0e10cSrcweir // ftp proxy port
273cdf0e10cSrcweir if( aFtpProxy.Port.getLength() > 0 )
274cdf0e10cSrcweir {
275cdf0e10cSrcweir valueFtpProxyPort_.IsPresent = true;
276cdf0e10cSrcweir valueFtpProxyPort_.Value <<= aFtpProxy.Port.toInt32();
277cdf0e10cSrcweir }
278cdf0e10cSrcweir }
279cdf0e10cSrcweir }
280cdf0e10cSrcweir }
281cdf0e10cSrcweir }
282cdf0e10cSrcweir
283cdf0e10cSrcweir //------------------------------------------------------------------------------
284cdf0e10cSrcweir
~WinInetBackend(void)285cdf0e10cSrcweir WinInetBackend::~WinInetBackend(void)
286cdf0e10cSrcweir {
287cdf0e10cSrcweir }
288cdf0e10cSrcweir
289cdf0e10cSrcweir //------------------------------------------------------------------------------
290cdf0e10cSrcweir
createInstance()291cdf0e10cSrcweir WinInetBackend* WinInetBackend::createInstance()
292cdf0e10cSrcweir {
293cdf0e10cSrcweir return new WinInetBackend;
294cdf0e10cSrcweir }
295cdf0e10cSrcweir
296cdf0e10cSrcweir // ---------------------------------------------------------------------------------------
297cdf0e10cSrcweir
setPropertyValue(rtl::OUString const &,css::uno::Any const &)298cdf0e10cSrcweir void WinInetBackend::setPropertyValue(
299cdf0e10cSrcweir rtl::OUString const &, css::uno::Any const &)
300cdf0e10cSrcweir throw (
301cdf0e10cSrcweir css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
302cdf0e10cSrcweir css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
303cdf0e10cSrcweir css::uno::RuntimeException)
304cdf0e10cSrcweir {
305cdf0e10cSrcweir throw css::lang::IllegalArgumentException(
306cdf0e10cSrcweir rtl::OUString(
307cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
308cdf0e10cSrcweir static_cast< cppu::OWeakObject * >(this), -1);
309cdf0e10cSrcweir }
310cdf0e10cSrcweir
getPropertyValue(rtl::OUString const & PropertyName)311cdf0e10cSrcweir css::uno::Any WinInetBackend::getPropertyValue(
312cdf0e10cSrcweir rtl::OUString const & PropertyName)
313cdf0e10cSrcweir throw (
314cdf0e10cSrcweir css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
315cdf0e10cSrcweir css::uno::RuntimeException)
316cdf0e10cSrcweir {
317cdf0e10cSrcweir if (PropertyName.equalsAsciiL(
318cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
319cdf0e10cSrcweir {
320cdf0e10cSrcweir return css::uno::makeAny(valueFtpProxyName_);
321cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
322cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
323cdf0e10cSrcweir {
324cdf0e10cSrcweir return css::uno::makeAny(valueFtpProxyPort_);
325cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
326cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
327cdf0e10cSrcweir {
328cdf0e10cSrcweir return css::uno::makeAny(valueHttpProxyName_);
329cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
330cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
331cdf0e10cSrcweir {
332cdf0e10cSrcweir return css::uno::makeAny(valueHttpProxyPort_);
333cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
334cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
335cdf0e10cSrcweir {
336cdf0e10cSrcweir return css::uno::makeAny(valueHttpsProxyName_);
337cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
338cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
339cdf0e10cSrcweir {
340cdf0e10cSrcweir return css::uno::makeAny(valueHttpsProxyPort_);
341cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
342cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")))
343cdf0e10cSrcweir {
344cdf0e10cSrcweir return css::uno::makeAny(valueNoProxy_);
345cdf0e10cSrcweir } else if (PropertyName.equalsAsciiL(
346cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
347cdf0e10cSrcweir {
348cdf0e10cSrcweir return css::uno::makeAny(valueProxyType_);
349cdf0e10cSrcweir } else {
350cdf0e10cSrcweir throw css::beans::UnknownPropertyException(
351cdf0e10cSrcweir PropertyName, static_cast< cppu::OWeakObject * >(this));
352cdf0e10cSrcweir }
353cdf0e10cSrcweir }
354cdf0e10cSrcweir
355cdf0e10cSrcweir //------------------------------------------------------------------------------
356cdf0e10cSrcweir
getBackendName(void)357cdf0e10cSrcweir rtl::OUString SAL_CALL WinInetBackend::getBackendName(void) {
358cdf0e10cSrcweir return rtl::OUString::createFromAscii("com.sun.star.comp.configuration.backend.WinInetBackend") ;
359cdf0e10cSrcweir }
360cdf0e10cSrcweir
361cdf0e10cSrcweir //------------------------------------------------------------------------------
362cdf0e10cSrcweir
getImplementationName(void)363cdf0e10cSrcweir rtl::OUString SAL_CALL WinInetBackend::getImplementationName(void)
364cdf0e10cSrcweir throw (uno::RuntimeException)
365cdf0e10cSrcweir {
366cdf0e10cSrcweir return getBackendName() ;
367cdf0e10cSrcweir }
368cdf0e10cSrcweir
369cdf0e10cSrcweir //------------------------------------------------------------------------------
370cdf0e10cSrcweir
getBackendServiceNames(void)371cdf0e10cSrcweir uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void)
372cdf0e10cSrcweir {
373cdf0e10cSrcweir uno::Sequence<rtl::OUString> aServiceNameList(1);
374cdf0e10cSrcweir aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.WinInetBackend")) ;
375cdf0e10cSrcweir
376cdf0e10cSrcweir return aServiceNameList ;
377cdf0e10cSrcweir }
378cdf0e10cSrcweir
379cdf0e10cSrcweir //------------------------------------------------------------------------------
380cdf0e10cSrcweir
supportsService(const rtl::OUString & aServiceName)381cdf0e10cSrcweir sal_Bool SAL_CALL WinInetBackend::supportsService(const rtl::OUString& aServiceName)
382cdf0e10cSrcweir throw (uno::RuntimeException)
383cdf0e10cSrcweir {
384cdf0e10cSrcweir uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
385cdf0e10cSrcweir
386cdf0e10cSrcweir for(sal_Int32 i = 0; i < svc.getLength(); ++i )
387cdf0e10cSrcweir if(svc[i] == aServiceName)
388cdf0e10cSrcweir return true;
389cdf0e10cSrcweir
390cdf0e10cSrcweir return false;
391cdf0e10cSrcweir }
392cdf0e10cSrcweir
393cdf0e10cSrcweir //------------------------------------------------------------------------------
394cdf0e10cSrcweir
getSupportedServiceNames(void)395cdf0e10cSrcweir uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getSupportedServiceNames(void)
396cdf0e10cSrcweir throw (uno::RuntimeException)
397cdf0e10cSrcweir {
398cdf0e10cSrcweir return getBackendServiceNames() ;
399cdf0e10cSrcweir }
400