1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: inetoptions.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVTOOLS_INETOPTIONS_HXX_
32 #define _SVTOOLS_INETOPTIONS_HXX_
34 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
35 #include <com/sun/star/uno/Reference.hxx>
37 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
38 #include <com/sun/star/uno/Sequence.hxx>
41 #include <sal/types.h>
43 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
44 #include <bf_svtools/options.hxx>
47 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{
48 class XPropertiesChangeListener
;
50 namespace rtl
{ class OUString
; }
55 //============================================================================
56 /** The names of all the properties (options) accessible through
59 @descr These names are used in the methods
60 SvtInetOptions::addPropertiesChangeListener()
62 #define SVT_INET_OPTION_PROXY_NO_PROXY "Inet/Proxy/NoProxy"
63 #define SVT_INET_OPTION_PROXY_TYPE "Inet/Proxy/Type"
64 #define SVT_INET_OPTION_PROXY_FTP_NAME "Inet/Proxy/FTP/Name"
65 #define SVT_INET_OPTION_PROXY_FTP_PORT "Inet/Proxy/FTP/Port"
66 #define SVT_INET_OPTION_PROXY_HTTP_NAME "Inet/Proxy/HTTP/Name"
67 #define SVT_INET_OPTION_PROXY_HTTP_PORT "Inet/Proxy/HTTP/Port"
69 //============================================================================
70 /** Interface to access those configuration database entries that are related
71 to the various Internet services.
73 @descr The Set...() methods all have a second parameter bFlush. If false
74 is passed (the default), the new value is not written back directly, but
75 only cached within this class. If the value in the configuration database
76 is also changed, the cached change will get lost. If, on the other hand,
77 true is passed, the new value is instantly written back to the
78 configuration database.
80 class SvtInetOptions
: public Options
85 virtual ~SvtInetOptions();
87 enum ProxyType
{ NONE
, AUTOMATIC
, MANUAL
};
89 rtl::OUString
GetProxyNoProxy() const;
91 sal_Int32
GetProxyType() const;
93 rtl::OUString
GetProxyFtpName() const;
95 sal_Int32
GetProxyFtpPort() const;
97 rtl::OUString
GetProxyHttpName() const;
99 sal_Int32
GetProxyHttpPort() const;
101 void SetProxyNoProxy(rtl::OUString
const & rValue
, bool bFlush
= false);
103 void SetProxyType(ProxyType eValue
, bool bFlush
= false);
105 void SetProxyFtpName(rtl::OUString
const & rValue
, bool bFlush
= false);
107 void SetProxyFtpPort(sal_Int32 nValue
, bool bFlush
= false);
109 void SetProxyHttpName(rtl::OUString
const & rValue
, bool bFlush
= false);
111 void SetProxyHttpPort(sal_Int32 nValue
, bool bFlush
= false);
113 /** Add a listener on changes of certain properties (options).
115 @param rPropertyNames The names of the properties (options). If an
116 empty sequence is used, nothing is done.
118 @param rListener A listener. If the listener is already registered
119 on other properties, it continues to also get notifications about
120 changes of those properties. The
121 com::sun::star::beans::PropertyChangeEvents supplied to the listener
122 will have void OldValue and NewValue slots.
125 addPropertiesChangeListener(
126 com::sun::star::uno::Sequence
< rtl::OUString
> const & rPropertyNames
,
127 com::sun::star::uno::Reference
<
128 com::sun::star::beans::XPropertiesChangeListener
> const &
133 static Impl
* m_pImpl
;
138 #endif // _SVTOOLS_INETOPTIONS_HXX_