1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #include "precompiled_shell.hxx"
25*b1cdbd2cSJim Jagielski #include "sal/config.h"
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski #include "com/sun/star/uno/Any.hxx"
28*b1cdbd2cSJim Jagielski #include "cppu/unotype.hxx"
29*b1cdbd2cSJim Jagielski #include "osl/diagnose.h"
30*b1cdbd2cSJim Jagielski #include "osl/file.h"
31*b1cdbd2cSJim Jagielski #include "rtl/string.h"
32*b1cdbd2cSJim Jagielski #include "rtl/ustring.hxx"
33*b1cdbd2cSJim Jagielski 
34*b1cdbd2cSJim Jagielski #include "kde_headers.h"
35*b1cdbd2cSJim Jagielski 
36*b1cdbd2cSJim Jagielski #include "kdeaccess.hxx"
37*b1cdbd2cSJim Jagielski 
38*b1cdbd2cSJim Jagielski #define SPACE      ' '
39*b1cdbd2cSJim Jagielski #define COMMA      ','
40*b1cdbd2cSJim Jagielski #define SEMI_COLON ';'
41*b1cdbd2cSJim Jagielski 
42*b1cdbd2cSJim Jagielski namespace kdeaccess {
43*b1cdbd2cSJim Jagielski 
44*b1cdbd2cSJim Jagielski namespace {
45*b1cdbd2cSJim Jagielski 
46*b1cdbd2cSJim Jagielski namespace css = com::sun::star ;
47*b1cdbd2cSJim Jagielski namespace uno = css::uno ;
48*b1cdbd2cSJim Jagielski 
49*b1cdbd2cSJim Jagielski }
50*b1cdbd2cSJim Jagielski 
getValue(rtl::OUString const & id)51*b1cdbd2cSJim Jagielski css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) {
52*b1cdbd2cSJim Jagielski     if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) {
53*b1cdbd2cSJim Jagielski         KEMailSettings aEmailSettings;
54*b1cdbd2cSJim Jagielski         QString aClientProgram;
55*b1cdbd2cSJim Jagielski         ::rtl::OUString sClientProgram;
56*b1cdbd2cSJim Jagielski 
57*b1cdbd2cSJim Jagielski         aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
58*b1cdbd2cSJim Jagielski         if ( aClientProgram.isEmpty() )
59*b1cdbd2cSJim Jagielski             aClientProgram = "kmail";
60*b1cdbd2cSJim Jagielski         else
61*b1cdbd2cSJim Jagielski             aClientProgram = aClientProgram.section(SPACE, 0, 0);
62*b1cdbd2cSJim Jagielski         sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
63*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
64*b1cdbd2cSJim Jagielski             true, uno::makeAny( sClientProgram ) );
65*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
66*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")))
67*b1cdbd2cSJim Jagielski     {
68*b1cdbd2cSJim Jagielski         QFont aFixedFont;
69*b1cdbd2cSJim Jagielski         short nFontHeight;
70*b1cdbd2cSJim Jagielski 
71*b1cdbd2cSJim Jagielski         aFixedFont = KGlobalSettings::fixedFont();
72*b1cdbd2cSJim Jagielski         nFontHeight = aFixedFont.pointSize();
73*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
74*b1cdbd2cSJim Jagielski             true, uno::makeAny( nFontHeight ) );
75*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
76*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")))
77*b1cdbd2cSJim Jagielski     {
78*b1cdbd2cSJim Jagielski         QFont aFixedFont;
79*b1cdbd2cSJim Jagielski         QString aFontName;
80*b1cdbd2cSJim Jagielski         :: rtl::OUString sFontName;
81*b1cdbd2cSJim Jagielski 
82*b1cdbd2cSJim Jagielski         aFixedFont = KGlobalSettings::fixedFont();
83*b1cdbd2cSJim Jagielski         aFontName = aFixedFont.family();
84*b1cdbd2cSJim Jagielski         sFontName = (const sal_Unicode *) aFontName.ucs2();
85*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
86*b1cdbd2cSJim Jagielski             true, uno::makeAny( sFontName ) );
87*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
88*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")))
89*b1cdbd2cSJim Jagielski     {
90*b1cdbd2cSJim Jagielski         /* does not make much sense without an accessibility bridge */
91*b1cdbd2cSJim Jagielski         sal_Bool ATToolSupport = sal_False;
92*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
93*b1cdbd2cSJim Jagielski             true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) );
94*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
95*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
96*b1cdbd2cSJim Jagielski     {
97*b1cdbd2cSJim Jagielski         QString aDocumentsDir( KGlobalSettings::documentPath() );
98*b1cdbd2cSJim Jagielski         rtl::OUString sDocumentsDir;
99*b1cdbd2cSJim Jagielski         rtl::OUString sDocumentsURL;
100*b1cdbd2cSJim Jagielski         if ( aDocumentsDir.endsWith(QChar('/')) )
101*b1cdbd2cSJim Jagielski             aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
102*b1cdbd2cSJim Jagielski         sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
103*b1cdbd2cSJim Jagielski         osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
104*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
105*b1cdbd2cSJim Jagielski             true, uno::makeAny( sDocumentsURL ) );
106*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
107*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
108*b1cdbd2cSJim Jagielski     {
109*b1cdbd2cSJim Jagielski         QString aFTPProxy;
110*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
111*b1cdbd2cSJim Jagielski         {
112*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
113*b1cdbd2cSJim Jagielski             aFTPProxy = KProtocolManager::proxyFor( "FTP" );
114*b1cdbd2cSJim Jagielski             break;
115*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
116*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
117*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
118*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
119*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
120*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
121*b1cdbd2cSJim Jagielski             aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
122*b1cdbd2cSJim Jagielski             break;
123*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
124*b1cdbd2cSJim Jagielski             break;
125*b1cdbd2cSJim Jagielski         }
126*b1cdbd2cSJim Jagielski         if ( !aFTPProxy.isEmpty() )
127*b1cdbd2cSJim Jagielski         {
128*b1cdbd2cSJim Jagielski             KURL aProxy(aFTPProxy);
129*b1cdbd2cSJim Jagielski             ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
130*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
131*b1cdbd2cSJim Jagielski                 true, uno::makeAny( sProxy ) );
132*b1cdbd2cSJim Jagielski         }
133*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
134*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
135*b1cdbd2cSJim Jagielski     {
136*b1cdbd2cSJim Jagielski         QString aFTPProxy;
137*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
138*b1cdbd2cSJim Jagielski         {
139*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
140*b1cdbd2cSJim Jagielski             aFTPProxy = KProtocolManager::proxyFor( "FTP" );
141*b1cdbd2cSJim Jagielski             break;
142*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
143*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
144*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
145*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
146*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
147*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
148*b1cdbd2cSJim Jagielski             aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
149*b1cdbd2cSJim Jagielski             break;
150*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
151*b1cdbd2cSJim Jagielski             break;
152*b1cdbd2cSJim Jagielski         }
153*b1cdbd2cSJim Jagielski         if ( !aFTPProxy.isEmpty() )
154*b1cdbd2cSJim Jagielski         {
155*b1cdbd2cSJim Jagielski             KURL aProxy(aFTPProxy);
156*b1cdbd2cSJim Jagielski             sal_Int32 nPort = aProxy.port();
157*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
158*b1cdbd2cSJim Jagielski                 true, uno::makeAny( nPort ) );
159*b1cdbd2cSJim Jagielski         }
160*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
161*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
162*b1cdbd2cSJim Jagielski     {
163*b1cdbd2cSJim Jagielski         QString aHTTPProxy;
164*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
165*b1cdbd2cSJim Jagielski         {
166*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
167*b1cdbd2cSJim Jagielski             aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
168*b1cdbd2cSJim Jagielski             break;
169*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
170*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
171*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
172*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
173*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
174*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
175*b1cdbd2cSJim Jagielski             aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
176*b1cdbd2cSJim Jagielski             break;
177*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
178*b1cdbd2cSJim Jagielski             break;
179*b1cdbd2cSJim Jagielski         }
180*b1cdbd2cSJim Jagielski         if ( !aHTTPProxy.isEmpty() )
181*b1cdbd2cSJim Jagielski         {
182*b1cdbd2cSJim Jagielski             KURL aProxy(aHTTPProxy);
183*b1cdbd2cSJim Jagielski             ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
184*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
185*b1cdbd2cSJim Jagielski                 true, uno::makeAny( sProxy ) );
186*b1cdbd2cSJim Jagielski         }
187*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
188*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
189*b1cdbd2cSJim Jagielski     {
190*b1cdbd2cSJim Jagielski         QString aHTTPProxy;
191*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
192*b1cdbd2cSJim Jagielski         {
193*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
194*b1cdbd2cSJim Jagielski             aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
195*b1cdbd2cSJim Jagielski             break;
196*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
197*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
198*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
199*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
200*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
201*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
202*b1cdbd2cSJim Jagielski             aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
203*b1cdbd2cSJim Jagielski             break;
204*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
205*b1cdbd2cSJim Jagielski             break;
206*b1cdbd2cSJim Jagielski         }
207*b1cdbd2cSJim Jagielski         if ( !aHTTPProxy.isEmpty() )
208*b1cdbd2cSJim Jagielski         {
209*b1cdbd2cSJim Jagielski             KURL aProxy(aHTTPProxy);
210*b1cdbd2cSJim Jagielski             sal_Int32 nPort = aProxy.port();
211*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
212*b1cdbd2cSJim Jagielski                 true, uno::makeAny( nPort ) );
213*b1cdbd2cSJim Jagielski         }
214*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
215*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
216*b1cdbd2cSJim Jagielski     {
217*b1cdbd2cSJim Jagielski         QString aHTTPSProxy;
218*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
219*b1cdbd2cSJim Jagielski         {
220*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
221*b1cdbd2cSJim Jagielski             aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
222*b1cdbd2cSJim Jagielski             break;
223*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
224*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
225*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
226*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
227*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
228*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
229*b1cdbd2cSJim Jagielski             aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
230*b1cdbd2cSJim Jagielski             break;
231*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
232*b1cdbd2cSJim Jagielski             break;
233*b1cdbd2cSJim Jagielski         }
234*b1cdbd2cSJim Jagielski         if ( !aHTTPSProxy.isEmpty() )
235*b1cdbd2cSJim Jagielski         {
236*b1cdbd2cSJim Jagielski             KURL aProxy(aHTTPSProxy);
237*b1cdbd2cSJim Jagielski             ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
238*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
239*b1cdbd2cSJim Jagielski                 true, uno::makeAny( sProxy ) );
240*b1cdbd2cSJim Jagielski         }
241*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(
242*b1cdbd2cSJim Jagielski                    RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
243*b1cdbd2cSJim Jagielski     {
244*b1cdbd2cSJim Jagielski         QString aHTTPSProxy;
245*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
246*b1cdbd2cSJim Jagielski         {
247*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
248*b1cdbd2cSJim Jagielski             aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
249*b1cdbd2cSJim Jagielski             break;
250*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
251*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
252*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
253*b1cdbd2cSJim Jagielski // In such cases, the proxy address is not stored in KDE, but determined dynamically.
254*b1cdbd2cSJim Jagielski // The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
255*b1cdbd2cSJim Jagielski // The best we can do here is to ask the current value for a given address.
256*b1cdbd2cSJim Jagielski             aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
257*b1cdbd2cSJim Jagielski             break;
258*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
259*b1cdbd2cSJim Jagielski             break;
260*b1cdbd2cSJim Jagielski         }
261*b1cdbd2cSJim Jagielski         if ( !aHTTPSProxy.isEmpty() )
262*b1cdbd2cSJim Jagielski         {
263*b1cdbd2cSJim Jagielski             KURL aProxy(aHTTPSProxy);
264*b1cdbd2cSJim Jagielski             sal_Int32 nPort = aProxy.port();
265*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
266*b1cdbd2cSJim Jagielski                 true, uno::makeAny( nPort ) );
267*b1cdbd2cSJim Jagielski         }
268*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) {
269*b1cdbd2cSJim Jagielski         QString aNoProxyFor;
270*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
271*b1cdbd2cSJim Jagielski         {
272*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
273*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
274*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
275*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
276*b1cdbd2cSJim Jagielski             aNoProxyFor = KProtocolManager::noProxyFor();
277*b1cdbd2cSJim Jagielski             break;
278*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
279*b1cdbd2cSJim Jagielski             break;
280*b1cdbd2cSJim Jagielski         }
281*b1cdbd2cSJim Jagielski         if ( !aNoProxyFor.isEmpty() )
282*b1cdbd2cSJim Jagielski         {
283*b1cdbd2cSJim Jagielski             ::rtl::OUString sNoProxyFor;
284*b1cdbd2cSJim Jagielski 
285*b1cdbd2cSJim Jagielski             aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
286*b1cdbd2cSJim Jagielski             sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
287*b1cdbd2cSJim Jagielski             return css::beans::Optional< css::uno::Any >(
288*b1cdbd2cSJim Jagielski                 true, uno::makeAny( sNoProxyFor ) );
289*b1cdbd2cSJim Jagielski         }
290*b1cdbd2cSJim Jagielski     } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) {
291*b1cdbd2cSJim Jagielski         int nProxyType;
292*b1cdbd2cSJim Jagielski         switch ( KProtocolManager::proxyType() )
293*b1cdbd2cSJim Jagielski         {
294*b1cdbd2cSJim Jagielski         case KProtocolManager::ManualProxy: // Proxies are manually configured
295*b1cdbd2cSJim Jagielski         case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
296*b1cdbd2cSJim Jagielski         case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
297*b1cdbd2cSJim Jagielski         case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
298*b1cdbd2cSJim Jagielski             nProxyType = 1;
299*b1cdbd2cSJim Jagielski             break;
300*b1cdbd2cSJim Jagielski         default:                            // No proxy is used
301*b1cdbd2cSJim Jagielski             nProxyType = 0;
302*b1cdbd2cSJim Jagielski         }
303*b1cdbd2cSJim Jagielski         return css::beans::Optional< css::uno::Any >(
304*b1cdbd2cSJim Jagielski             true, uno::makeAny( (sal_Int32) nProxyType ) );
305*b1cdbd2cSJim Jagielski     } else {
306*b1cdbd2cSJim Jagielski         OSL_ASSERT(false); // this cannot happen
307*b1cdbd2cSJim Jagielski     }
308*b1cdbd2cSJim Jagielski     return css::beans::Optional< css::uno::Any >();
309*b1cdbd2cSJim Jagielski }
310*b1cdbd2cSJim Jagielski 
311*b1cdbd2cSJim Jagielski }
312