xref: /aoo41x/main/svtools/source/config/helpopt.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svtools.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <svtools/helpopt.hxx>
32*cdf0e10cSrcweir #include <unotools/configmgr.hxx>
33*cdf0e10cSrcweir #include <unotools/configitem.hxx>
34*cdf0e10cSrcweir #include <tools/debug.hxx>
35*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
36*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
37*cdf0e10cSrcweir #include <vcl/help.hxx>
38*cdf0e10cSrcweir #include <osl/mutex.hxx>
39*cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <rtl/logfile.hxx>
42*cdf0e10cSrcweir #include "itemholder2.hxx"
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir using namespace utl;
45*cdf0e10cSrcweir using namespace rtl;
46*cdf0e10cSrcweir using namespace com::sun::star::uno;
47*cdf0e10cSrcweir using namespace com::sun::star;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir static SvtHelpOptions_Impl* pOptions = NULL;
50*cdf0e10cSrcweir static sal_Int32           nRefCount = 0;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir #define EXTENDEDHELP		0
53*cdf0e10cSrcweir #define HELPTIPS			1
54*cdf0e10cSrcweir #define AGENT_ENABLED		2
55*cdf0e10cSrcweir #define AGENT_TIMEOUT		3
56*cdf0e10cSrcweir #define AGENT_RETRYLIMIT	4
57*cdf0e10cSrcweir #define LOCALE				5
58*cdf0e10cSrcweir #define SYSTEM				6
59*cdf0e10cSrcweir #define STYLESHEET          7
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir class SvtHelpOptions_Impl : public utl::ConfigItem
62*cdf0e10cSrcweir {
63*cdf0e10cSrcweir     IdList*         pList;
64*cdf0e10cSrcweir 	sal_Int32		nHelpAgentTimeoutPeriod;
65*cdf0e10cSrcweir 	sal_Int32		nHelpAgentRetryLimit;
66*cdf0e10cSrcweir     sal_Bool        bExtendedHelp;
67*cdf0e10cSrcweir     sal_Bool        bHelpTips;
68*cdf0e10cSrcweir     sal_Bool        bHelpAgentEnabled;
69*cdf0e10cSrcweir     sal_Bool        bWelcomeScreen;
70*cdf0e10cSrcweir 	String			aLocale;
71*cdf0e10cSrcweir 	String			aSystem;
72*cdf0e10cSrcweir     String          sHelpStyleSheet;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir 	DECLARE_STL_USTRINGACCESS_MAP( sal_Int32, MapString2Int );
75*cdf0e10cSrcweir 	MapString2Int	aURLIgnoreCounters;
76*cdf0e10cSrcweir 	::osl::Mutex	aIgnoreCounterSafety;
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     Sequence< OUString > GetPropertyNames();
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir public:
81*cdf0e10cSrcweir                     SvtHelpOptions_Impl();
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     virtual void    Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
84*cdf0e10cSrcweir     void            Load( const ::com::sun::star::uno::Sequence< ::rtl::OUString>& aPropertyNames);
85*cdf0e10cSrcweir     virtual void    Commit();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     void            SetExtendedHelp( sal_Bool b )           { bExtendedHelp= b; SetModified(); }
88*cdf0e10cSrcweir     sal_Bool        IsExtendedHelp() const                  { return bExtendedHelp; }
89*cdf0e10cSrcweir     void            SetHelpTips( sal_Bool b )               { bHelpTips = b; SetModified(); }
90*cdf0e10cSrcweir     sal_Bool        IsHelpTips() const                      { return bHelpTips; }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     void            SetHelpAgentEnabled( sal_Bool b	)		{ bHelpAgentEnabled = b; SetModified(); }
93*cdf0e10cSrcweir     sal_Bool        IsHelpAgentEnabled() const				{ return bHelpAgentEnabled; }
94*cdf0e10cSrcweir 	void			SetHelpAgentTimeoutPeriod( sal_Int32 _nSeconds )	{ nHelpAgentTimeoutPeriod = _nSeconds; SetModified(); }
95*cdf0e10cSrcweir 	sal_Int32		GetHelpAgentTimeoutPeriod( ) const		{ return nHelpAgentTimeoutPeriod; }
96*cdf0e10cSrcweir 	void			SetHelpAgentRetryLimit( sal_Int32 _nTrials )		{ nHelpAgentRetryLimit = _nTrials; SetModified(); }
97*cdf0e10cSrcweir 	sal_Int32		GetHelpAgentRetryLimit( ) const			{ return nHelpAgentRetryLimit; }
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	sal_Int32		getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
100*cdf0e10cSrcweir 	void			decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
101*cdf0e10cSrcweir 	void			resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
102*cdf0e10cSrcweir 	void			resetAgentIgnoreURLCounter();
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir     void            SetWelcomeScreen( sal_Bool b )          { bWelcomeScreen = b; SetModified(); }
105*cdf0e10cSrcweir     sal_Bool        IsWelcomeScreen() const                 { return bWelcomeScreen; }
106*cdf0e10cSrcweir     IdList*         GetPIStarterList()                      { return pList; }
107*cdf0e10cSrcweir     void            AddToPIStarterList( sal_Int32 nId );
108*cdf0e10cSrcweir     void            RemoveFromPIStarterList( sal_Int32 nId );
109*cdf0e10cSrcweir 	String			GetLocale() const						{ return aLocale; }
110*cdf0e10cSrcweir 	String			GetSystem() const						{ return aSystem; }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     const String&   GetHelpStyleSheet()const{return sHelpStyleSheet;}
113*cdf0e10cSrcweir     void            SetHelpStyleSheet(const String& rStyleSheet){sHelpStyleSheet = rStyleSheet; SetModified();}
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir     static ::osl::Mutex & getInitMutex();
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir protected:
118*cdf0e10cSrcweir 	void	implLoadURLCounters();
119*cdf0e10cSrcweir 	void	implSaveURLCounters();
120*cdf0e10cSrcweir 	// to be called with aIgnoreCounterSafety locked
121*cdf0e10cSrcweir 	void	implGetURLCounters( Sequence< ::rtl::OUString >& _rNodeNames, Sequence< Any >& _rURLs, Sequence< Any >& _rCounter );
122*cdf0e10cSrcweir };
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir Sequence< OUString > SvtHelpOptions_Impl::GetPropertyNames()
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir 	static const char* aPropNames[] =
127*cdf0e10cSrcweir 	{
128*cdf0e10cSrcweir         "ExtendedTip",
129*cdf0e10cSrcweir         "Tip",
130*cdf0e10cSrcweir 		"HelpAgent/Enabled",
131*cdf0e10cSrcweir 		"HelpAgent/Timeout",
132*cdf0e10cSrcweir 		"HelpAgent/RetryLimit",
133*cdf0e10cSrcweir 		"Locale",
134*cdf0e10cSrcweir 		"System",
135*cdf0e10cSrcweir         "HelpStyleSheet",
136*cdf0e10cSrcweir //		"HowTo/Show"
137*cdf0e10cSrcweir 	};
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     const int nCount = sizeof( aPropNames ) / sizeof( const char* );
140*cdf0e10cSrcweir 	Sequence< OUString > aNames( nCount );
141*cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
142*cdf0e10cSrcweir 	for ( int i = 0; i < nCount; i++ )
143*cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii( aPropNames[i] );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	return aNames;
146*cdf0e10cSrcweir }
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir ::osl::Mutex & SvtHelpOptions_Impl::getInitMutex()
149*cdf0e10cSrcweir {
150*cdf0e10cSrcweir     static ::osl::Mutex *pMutex = 0;
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir     if( ! pMutex )
153*cdf0e10cSrcweir     {
154*cdf0e10cSrcweir         ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
155*cdf0e10cSrcweir         if( ! pMutex )
156*cdf0e10cSrcweir         {
157*cdf0e10cSrcweir             static ::osl::Mutex mutex;
158*cdf0e10cSrcweir             pMutex = &mutex;
159*cdf0e10cSrcweir         }
160*cdf0e10cSrcweir     }
161*cdf0e10cSrcweir     return *pMutex;
162*cdf0e10cSrcweir }
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir // -----------------------------------------------------------------------
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir SvtHelpOptions_Impl::SvtHelpOptions_Impl()
168*cdf0e10cSrcweir     : ConfigItem( OUString::createFromAscii("Office.Common/Help") )
169*cdf0e10cSrcweir     , pList( 0 )
170*cdf0e10cSrcweir     , bExtendedHelp( sal_False )
171*cdf0e10cSrcweir     , bHelpTips( sal_True )
172*cdf0e10cSrcweir     , bHelpAgentEnabled( sal_False )
173*cdf0e10cSrcweir     , bWelcomeScreen( sal_False )
174*cdf0e10cSrcweir {
175*cdf0e10cSrcweir 	Sequence< OUString > aNames = GetPropertyNames();
176*cdf0e10cSrcweir     Load( aNames );
177*cdf0e10cSrcweir     EnableNotification( aNames );
178*cdf0e10cSrcweir     implLoadURLCounters();
179*cdf0e10cSrcweir }
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir // -----------------------------------------------------------------------
182*cdf0e10cSrcweir static int lcl_MapPropertyName( const ::rtl::OUString rCompare,
183*cdf0e10cSrcweir                 const uno::Sequence< ::rtl::OUString>& aInternalPropertyNames)
184*cdf0e10cSrcweir {
185*cdf0e10cSrcweir     for(int nProp = 0; nProp < aInternalPropertyNames.getLength(); ++nProp)
186*cdf0e10cSrcweir     {
187*cdf0e10cSrcweir         if( aInternalPropertyNames[nProp] == rCompare )
188*cdf0e10cSrcweir             return nProp;
189*cdf0e10cSrcweir     }
190*cdf0e10cSrcweir     return -1;
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir void  SvtHelpOptions_Impl::Load(const uno::Sequence< ::rtl::OUString>& rPropertyNames)
194*cdf0e10cSrcweir {
195*cdf0e10cSrcweir     const uno::Sequence< ::rtl::OUString> aInternalPropertyNames( GetPropertyNames());
196*cdf0e10cSrcweir     Sequence< Any > aValues = GetProperties( rPropertyNames );
197*cdf0e10cSrcweir     const Any* pValues = aValues.getConstArray();
198*cdf0e10cSrcweir     DBG_ASSERT( aValues.getLength() == rPropertyNames.getLength(), "GetProperties failed" );
199*cdf0e10cSrcweir     if ( aValues.getLength() == rPropertyNames.getLength() )
200*cdf0e10cSrcweir     {
201*cdf0e10cSrcweir         for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ )
202*cdf0e10cSrcweir         {
203*cdf0e10cSrcweir             DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
204*cdf0e10cSrcweir             if ( pValues[nProp].hasValue() )
205*cdf0e10cSrcweir             {
206*cdf0e10cSrcweir                 sal_Bool bTmp = sal_Bool();
207*cdf0e10cSrcweir                 ::rtl::OUString aTmpStr;
208*cdf0e10cSrcweir                 sal_Int32 nTmpInt = 0;
209*cdf0e10cSrcweir                 if ( pValues[nProp] >>= bTmp )
210*cdf0e10cSrcweir                 {
211*cdf0e10cSrcweir                     switch ( lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) )
212*cdf0e10cSrcweir                     {
213*cdf0e10cSrcweir                         case EXTENDEDHELP :
214*cdf0e10cSrcweir                             bExtendedHelp = bTmp;
215*cdf0e10cSrcweir                             break;
216*cdf0e10cSrcweir                         case HELPTIPS :
217*cdf0e10cSrcweir                             bHelpTips = bTmp;
218*cdf0e10cSrcweir                             break;
219*cdf0e10cSrcweir                         case AGENT_ENABLED :
220*cdf0e10cSrcweir                             bHelpAgentEnabled = bTmp;
221*cdf0e10cSrcweir                             break;
222*cdf0e10cSrcweir                         default:
223*cdf0e10cSrcweir                             DBG_ERRORFILE( "Wrong Member!" );
224*cdf0e10cSrcweir                             break;
225*cdf0e10cSrcweir                     }
226*cdf0e10cSrcweir                 }
227*cdf0e10cSrcweir                 else if ( pValues[nProp] >>= aTmpStr )
228*cdf0e10cSrcweir                 {
229*cdf0e10cSrcweir                     switch ( nProp )
230*cdf0e10cSrcweir                     {
231*cdf0e10cSrcweir                         case LOCALE:
232*cdf0e10cSrcweir                             aLocale = aTmpStr;
233*cdf0e10cSrcweir                             break;
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir                         case SYSTEM:
236*cdf0e10cSrcweir                             aSystem = aTmpStr;
237*cdf0e10cSrcweir                             break;
238*cdf0e10cSrcweir                         case STYLESHEET :
239*cdf0e10cSrcweir                             sHelpStyleSheet = aTmpStr;
240*cdf0e10cSrcweir                         break;
241*cdf0e10cSrcweir                         default:
242*cdf0e10cSrcweir                             DBG_ERRORFILE( "Wrong Member!" );
243*cdf0e10cSrcweir                             break;
244*cdf0e10cSrcweir                     }
245*cdf0e10cSrcweir                 }
246*cdf0e10cSrcweir                 else if ( pValues[nProp] >>= nTmpInt )
247*cdf0e10cSrcweir                 {
248*cdf0e10cSrcweir                     switch ( nProp )
249*cdf0e10cSrcweir                     {
250*cdf0e10cSrcweir                         case AGENT_TIMEOUT:
251*cdf0e10cSrcweir                             nHelpAgentTimeoutPeriod = nTmpInt;
252*cdf0e10cSrcweir                             break;
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir                         case AGENT_RETRYLIMIT:
255*cdf0e10cSrcweir                             nHelpAgentRetryLimit = nTmpInt;
256*cdf0e10cSrcweir                             break;
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir                         default:
259*cdf0e10cSrcweir                             DBG_ERRORFILE( "Wrong Member!" );
260*cdf0e10cSrcweir                             break;
261*cdf0e10cSrcweir                     }
262*cdf0e10cSrcweir                 }
263*cdf0e10cSrcweir                 else
264*cdf0e10cSrcweir                 {
265*cdf0e10cSrcweir 		    DBG_ERRORFILE( "Wrong Type!" );
266*cdf0e10cSrcweir 		}
267*cdf0e10cSrcweir             }
268*cdf0e10cSrcweir         }
269*cdf0e10cSrcweir         if ( IsHelpTips() != Help::IsQuickHelpEnabled() )
270*cdf0e10cSrcweir             IsHelpTips() ? Help::EnableQuickHelp() : Help::DisableQuickHelp();
271*cdf0e10cSrcweir         if ( IsExtendedHelp() != Help::IsBalloonHelpEnabled() )
272*cdf0e10cSrcweir             IsExtendedHelp() ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp();
273*cdf0e10cSrcweir     }
274*cdf0e10cSrcweir }
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir // -----------------------------------------------------------------------
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir void SvtHelpOptions_Impl::implGetURLCounters( Sequence< ::rtl::OUString >& _rNodeNames, Sequence< Any >& _rURLs, Sequence< Any >& _rCounters )
279*cdf0e10cSrcweir {
280*cdf0e10cSrcweir 	// the ignore counters for the help agent URLs
281*cdf0e10cSrcweir 	const ::rtl::OUString sIgnoreListNodePath = ::rtl::OUString::createFromAscii("HelpAgent/IgnoreList");
282*cdf0e10cSrcweir 	const ::rtl::OUString sPathSeparator = ::rtl::OUString::createFromAscii("/");
283*cdf0e10cSrcweir 	const ::rtl::OUString sURLLocalPath = ::rtl::OUString::createFromAscii("/Name");
284*cdf0e10cSrcweir 	const ::rtl::OUString sCounterLocalPath = ::rtl::OUString::createFromAscii("/Counter");
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir 	// get the names of all the nodes containing ignore counters
287*cdf0e10cSrcweir 	// collect the node names we have to ask
288*cdf0e10cSrcweir 	// first get the node names of all children of HelpAgent/IgnoreList
289*cdf0e10cSrcweir 	_rNodeNames = GetNodeNames(sIgnoreListNodePath);
290*cdf0e10cSrcweir 	const ::rtl::OUString* pIgnoredURLsNodes = _rNodeNames.getConstArray();
291*cdf0e10cSrcweir 	const ::rtl::OUString* pIgnoredURLsNodesEnd = pIgnoredURLsNodes + _rNodeNames.getLength();
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 	// then assemble the two lists (of node paths) for the URLs and the counters
294*cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aIgnoredURLs(_rNodeNames.getLength());
295*cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aIgnoredURLsCounter(_rNodeNames.getLength());
296*cdf0e10cSrcweir 	::rtl::OUString* pIgnoredURLs = aIgnoredURLs.getArray();
297*cdf0e10cSrcweir 	::rtl::OUString* pIgnoredURLsCounter = aIgnoredURLsCounter.getArray();
298*cdf0e10cSrcweir 	for (;pIgnoredURLsNodes != pIgnoredURLsNodesEnd; ++pIgnoredURLsNodes, ++pIgnoredURLs, ++pIgnoredURLsCounter)
299*cdf0e10cSrcweir 	{
300*cdf0e10cSrcweir 		::rtl::OUString sLocalURLAccess = sIgnoreListNodePath;
301*cdf0e10cSrcweir 		sLocalURLAccess += sPathSeparator;
302*cdf0e10cSrcweir 		sLocalURLAccess += *pIgnoredURLsNodes;
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir 		// the path to the URL of this specific entry
305*cdf0e10cSrcweir 		*pIgnoredURLs = sLocalURLAccess;
306*cdf0e10cSrcweir 		*pIgnoredURLs += sURLLocalPath;
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir 		// the path of the counter for that URL
309*cdf0e10cSrcweir 		*pIgnoredURLsCounter = sLocalURLAccess;
310*cdf0e10cSrcweir 		*pIgnoredURLsCounter += sCounterLocalPath;
311*cdf0e10cSrcweir 	}
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir 	// now collect the values
314*cdf0e10cSrcweir 	_rURLs = GetProperties(aIgnoredURLs);
315*cdf0e10cSrcweir 	_rCounters = GetProperties(aIgnoredURLsCounter);
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir 	sal_Int32 nURLs = _rURLs.getLength();
318*cdf0e10cSrcweir 	sal_Int32 nCounters = _rCounters.getLength();
319*cdf0e10cSrcweir 	DBG_ASSERT(nURLs == nCounters, "SvtHelpOptions_Impl::implGetURLCounters: inconsistence while retrieving the visited URLs!");
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir 	// normalize in case something went wrong
322*cdf0e10cSrcweir 	sal_Int32 nKnownURLs = nURLs < nCounters ? nURLs : nCounters;
323*cdf0e10cSrcweir 	if (nURLs < nCounters)
324*cdf0e10cSrcweir 	{
325*cdf0e10cSrcweir 		_rCounters.realloc(nKnownURLs);
326*cdf0e10cSrcweir 		_rNodeNames.realloc(nKnownURLs);
327*cdf0e10cSrcweir 	}
328*cdf0e10cSrcweir 	else if (nURLs > nCounters)
329*cdf0e10cSrcweir 	{
330*cdf0e10cSrcweir 		_rURLs.realloc(nKnownURLs);
331*cdf0e10cSrcweir 		_rNodeNames.realloc(nKnownURLs);
332*cdf0e10cSrcweir 	}
333*cdf0e10cSrcweir }
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir // -----------------------------------------------------------------------
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir void SvtHelpOptions_Impl::implSaveURLCounters()
338*cdf0e10cSrcweir {
339*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir 	const ::rtl::OUString sIgnoreListNodePath = ::rtl::OUString::createFromAscii("HelpAgent/IgnoreList");
342*cdf0e10cSrcweir 	const ::rtl::OUString sPathSeparator = ::rtl::OUString::createFromAscii("/");
343*cdf0e10cSrcweir 	const ::rtl::OUString sURLLocalPath = ::rtl::OUString::createFromAscii("/Name");
344*cdf0e10cSrcweir 	const ::rtl::OUString sCounterLocalPath = ::rtl::OUString::createFromAscii("/Counter");
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir 	// get the current URL/counter pairs (as they're persistent at the moment)
347*cdf0e10cSrcweir 	Sequence< ::rtl::OUString >	aNodeNames;
348*cdf0e10cSrcweir 	Sequence< Any >				aURLs;
349*cdf0e10cSrcweir 	Sequence< Any >				aCounters;
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir 	implGetURLCounters(aNodeNames, aURLs, aCounters);
352*cdf0e10cSrcweir 	sal_Int32 nKnownURLs = aURLs.getLength();
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 	const ::rtl::OUString* pNodeNames	= aNodeNames.getConstArray();
355*cdf0e10cSrcweir 	const Any* pURLs					= aURLs.getConstArray();
356*cdf0e10cSrcweir 	const Any* pCounters				= aCounters.getConstArray();
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 	// check which of them must be deleted/modified
359*cdf0e10cSrcweir 	Sequence< ::rtl::OUString >		aDeleteFromConfig(nKnownURLs);	// names of nodes to be deleted
360*cdf0e10cSrcweir 	::rtl::OUString*				pDeleteFromConfig = aDeleteFromConfig.getArray();
361*cdf0e10cSrcweir 	::std::set< ::rtl::OUString >	aAlreadyPresent;	// URLs currently persistent
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir 	// for modifying already existent nodes
364*cdf0e10cSrcweir 	Sequence< ::rtl::OUString >	aNewCounterNodePaths(nKnownURLs);
365*cdf0e10cSrcweir 	Sequence< Any >				aNewCounterValues(nKnownURLs);
366*cdf0e10cSrcweir 	::rtl::OUString*			pNewCounterNodePaths = aNewCounterNodePaths.getArray();
367*cdf0e10cSrcweir 	Any*						pNewCounterValues = aNewCounterValues.getArray();
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir 	// temporaries needed inside the loop
370*cdf0e10cSrcweir 	::rtl::OUString sCurrentURL, sCurrentURLNodeName;
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 	for (sal_Int32 i=0; i<nKnownURLs; ++i, ++pNodeNames, ++pURLs, ++pCounters)
373*cdf0e10cSrcweir 	{
374*cdf0e10cSrcweir 		if (!((*pURLs) >>= sCurrentURL))
375*cdf0e10cSrcweir 			continue;
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 		ConstMapString2IntIterator aThisURLNewCounter = aURLIgnoreCounters.find(sCurrentURL);
378*cdf0e10cSrcweir 		if (aURLIgnoreCounters.end() == aThisURLNewCounter)
379*cdf0e10cSrcweir 		{	// we do not know anything about this URL anymore.
380*cdf0e10cSrcweir 			// -> have to removed it from the configuration later on
381*cdf0e10cSrcweir 			*pDeleteFromConfig = *pNodeNames;
382*cdf0e10cSrcweir 			++pDeleteFromConfig;
383*cdf0e10cSrcweir 		}
384*cdf0e10cSrcweir 		else
385*cdf0e10cSrcweir 		{	// we know this URL
386*cdf0e10cSrcweir 			sCurrentURLNodeName = sIgnoreListNodePath;
387*cdf0e10cSrcweir 			sCurrentURLNodeName += sPathSeparator;
388*cdf0e10cSrcweir 			sCurrentURLNodeName += *pNodeNames;
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir 			// -> remember this (so we don't need to add a new node for this URL later on)
391*cdf0e10cSrcweir 			aAlreadyPresent.insert(sCurrentURL);
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir 			sal_Int32 nThisURLPersistentCounter = 0;
394*cdf0e10cSrcweir 			(*pCounters) >>= nThisURLPersistentCounter;
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir 			if (aThisURLNewCounter->second != nThisURLPersistentCounter)
397*cdf0e10cSrcweir 			{	// the counter changed
398*cdf0e10cSrcweir 				// -> remember the path and the new counter for the adjustment below
399*cdf0e10cSrcweir 				*pNewCounterNodePaths = sCurrentURLNodeName;
400*cdf0e10cSrcweir 				*pNewCounterNodePaths += sCounterLocalPath;
401*cdf0e10cSrcweir 				++pNewCounterNodePaths;
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir 				(*pNewCounterValues) <<= aThisURLNewCounter->second;
404*cdf0e10cSrcweir 				++pNewCounterValues;
405*cdf0e10cSrcweir 			}
406*cdf0e10cSrcweir 		}
407*cdf0e10cSrcweir 	}
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir 	// delete the nodes which are flagged so ...
410*cdf0e10cSrcweir 	aDeleteFromConfig.realloc(pDeleteFromConfig - aDeleteFromConfig.getArray());
411*cdf0e10cSrcweir 	if (0 != aDeleteFromConfig.getLength())
412*cdf0e10cSrcweir 	{
413*cdf0e10cSrcweir 		ClearNodeElements(sIgnoreListNodePath, aDeleteFromConfig);
414*cdf0e10cSrcweir 	}
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir 	// modify the nodes which need to be
417*cdf0e10cSrcweir 	aNewCounterNodePaths.realloc(pNewCounterNodePaths - aNewCounterNodePaths.getArray());
418*cdf0e10cSrcweir 	aNewCounterValues.realloc(pNewCounterValues - aNewCounterValues.getArray());
419*cdf0e10cSrcweir 	if (0 != aNewCounterNodePaths.getLength())
420*cdf0e10cSrcweir 	{
421*cdf0e10cSrcweir 		PutProperties(aNewCounterNodePaths, aNewCounterValues);
422*cdf0e10cSrcweir 	}
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir 	// and for the new ones ...
425*cdf0e10cSrcweir 	::rtl::OUString sNewNodeName;
426*cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aNewCounterDataNodeNames(2);
427*cdf0e10cSrcweir 	Sequence< Any >				aNewCounterDataValues(2);
428*cdf0e10cSrcweir 	const ::rtl::OUString sNodeNameBase = ::rtl::OUString::createFromAscii("URL");
429*cdf0e10cSrcweir 	for (	ConstMapString2IntIterator aCollectNew = aURLIgnoreCounters.begin();
430*cdf0e10cSrcweir 			aCollectNew != aURLIgnoreCounters.end();
431*cdf0e10cSrcweir 			++aCollectNew
432*cdf0e10cSrcweir 		)
433*cdf0e10cSrcweir 	{
434*cdf0e10cSrcweir 		if (aAlreadyPresent.end() == aAlreadyPresent.find(aCollectNew->first))
435*cdf0e10cSrcweir 		{	// this URL is not persistent, yet
436*cdf0e10cSrcweir 			// -> add a new node
437*cdf0e10cSrcweir 			sNewNodeName = sNodeNameBase;
438*cdf0e10cSrcweir 			if (!getUniqueSetElementName(sIgnoreListNodePath, sNewNodeName))
439*cdf0e10cSrcweir 			{
440*cdf0e10cSrcweir 				DBG_ERRORFILE( "SvtHelpOptions_Impl::implSaveURLCounters: could not get a free name!" );
441*cdf0e10cSrcweir 				continue;
442*cdf0e10cSrcweir 			}
443*cdf0e10cSrcweir 			AddNode(sIgnoreListNodePath, sNewNodeName);
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir 			// and set the URL/counter pair
446*cdf0e10cSrcweir 			aNewCounterDataNodeNames[0] = sIgnoreListNodePath;
447*cdf0e10cSrcweir 			aNewCounterDataNodeNames[0] += sPathSeparator;
448*cdf0e10cSrcweir 			aNewCounterDataNodeNames[0] += sNewNodeName;
449*cdf0e10cSrcweir 			aNewCounterDataNodeNames[0] += sURLLocalPath;
450*cdf0e10cSrcweir 			aNewCounterDataValues[0]	<<= aCollectNew->first;
451*cdf0e10cSrcweir 
452*cdf0e10cSrcweir 			aNewCounterDataNodeNames[1] = sIgnoreListNodePath;
453*cdf0e10cSrcweir 			aNewCounterDataNodeNames[1] += sPathSeparator;
454*cdf0e10cSrcweir 			aNewCounterDataNodeNames[1] += sNewNodeName;
455*cdf0e10cSrcweir 			aNewCounterDataNodeNames[1] += sCounterLocalPath;
456*cdf0e10cSrcweir 			aNewCounterDataValues[1]	<<= aCollectNew->second;
457*cdf0e10cSrcweir 
458*cdf0e10cSrcweir 			PutProperties(aNewCounterDataNodeNames, aNewCounterDataValues);
459*cdf0e10cSrcweir 		}
460*cdf0e10cSrcweir 	}
461*cdf0e10cSrcweir }
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir // -----------------------------------------------------------------------
464*cdf0e10cSrcweir 
465*cdf0e10cSrcweir void SvtHelpOptions_Impl::implLoadURLCounters()
466*cdf0e10cSrcweir {
467*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir 	Sequence< ::rtl::OUString >	aNodeNames;
470*cdf0e10cSrcweir 	Sequence< Any >				aURLs;
471*cdf0e10cSrcweir 	Sequence< Any >				aCounters;
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir 	implGetURLCounters(aNodeNames, aURLs, aCounters);
474*cdf0e10cSrcweir 	sal_Int32 nKnownURLs = aURLs.getLength();
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir 	const Any* pURLs = aURLs.getConstArray();
477*cdf0e10cSrcweir 	const Any* pCounters = aCounters.getConstArray();
478*cdf0e10cSrcweir 
479*cdf0e10cSrcweir 	::rtl::OUString sCurrentURL;
480*cdf0e10cSrcweir 	sal_Int32 nCurrentCounter;
481*cdf0e10cSrcweir 	for (sal_Int32 i=0; i<nKnownURLs; ++i, ++pURLs, ++pCounters)
482*cdf0e10cSrcweir 	{
483*cdf0e10cSrcweir 		(*pURLs) >>= sCurrentURL;
484*cdf0e10cSrcweir 		nCurrentCounter = 0;
485*cdf0e10cSrcweir 		(*pCounters) >>= nCurrentCounter;
486*cdf0e10cSrcweir 		aURLIgnoreCounters[sCurrentURL] = nCurrentCounter;
487*cdf0e10cSrcweir 	}
488*cdf0e10cSrcweir }
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir // -----------------------------------------------------------------------
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir void SvtHelpOptions_Impl::Commit()
493*cdf0e10cSrcweir {
494*cdf0e10cSrcweir 	Sequence< OUString > aNames = GetPropertyNames();
495*cdf0e10cSrcweir 	Sequence< Any > aValues( aNames.getLength() );
496*cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
497*cdf0e10cSrcweir 	for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
498*cdf0e10cSrcweir 	{
499*cdf0e10cSrcweir         switch ( nProp )
500*cdf0e10cSrcweir         {
501*cdf0e10cSrcweir             case EXTENDEDHELP :
502*cdf0e10cSrcweir                 pValues[nProp] <<= bExtendedHelp;
503*cdf0e10cSrcweir                 break;
504*cdf0e10cSrcweir 
505*cdf0e10cSrcweir             case HELPTIPS :
506*cdf0e10cSrcweir                 pValues[nProp] <<= bHelpTips;
507*cdf0e10cSrcweir                 break;
508*cdf0e10cSrcweir 
509*cdf0e10cSrcweir             case AGENT_ENABLED :
510*cdf0e10cSrcweir                 pValues[nProp] <<= bHelpAgentEnabled;
511*cdf0e10cSrcweir                 break;
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir 			case AGENT_TIMEOUT:
514*cdf0e10cSrcweir                 pValues[nProp] <<= nHelpAgentTimeoutPeriod;
515*cdf0e10cSrcweir                 break;
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir 			case AGENT_RETRYLIMIT:
518*cdf0e10cSrcweir                 pValues[nProp] <<= nHelpAgentRetryLimit;
519*cdf0e10cSrcweir                 break;
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir 			case LOCALE:
522*cdf0e10cSrcweir                 pValues[nProp] <<= ::rtl::OUString(aLocale);
523*cdf0e10cSrcweir                 break;
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir 			case SYSTEM:
526*cdf0e10cSrcweir                 pValues[nProp] <<= ::rtl::OUString(aSystem);
527*cdf0e10cSrcweir                 break;
528*cdf0e10cSrcweir             case STYLESHEET :
529*cdf0e10cSrcweir                 pValues[nProp] <<= ::rtl::OUString(sHelpStyleSheet);
530*cdf0e10cSrcweir             break;
531*cdf0e10cSrcweir 
532*cdf0e10cSrcweir         }
533*cdf0e10cSrcweir 	}
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir 	PutProperties( aNames, aValues );
536*cdf0e10cSrcweir 
537*cdf0e10cSrcweir 	implSaveURLCounters();
538*cdf0e10cSrcweir }
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir // -----------------------------------------------------------------------
541*cdf0e10cSrcweir 
542*cdf0e10cSrcweir void SvtHelpOptions_Impl::Notify( const Sequence<rtl::OUString>& aPropertyNames )
543*cdf0e10cSrcweir {
544*cdf0e10cSrcweir     Load( aPropertyNames );
545*cdf0e10cSrcweir }
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir SvtHelpOptions::SvtHelpOptions()
548*cdf0e10cSrcweir {
549*cdf0e10cSrcweir     // Global access, must be guarded (multithreading)
550*cdf0e10cSrcweir     ::osl::MutexGuard aGuard( SvtHelpOptions_Impl::getInitMutex() );
551*cdf0e10cSrcweir     ++nRefCount;
552*cdf0e10cSrcweir     if ( !pOptions )
553*cdf0e10cSrcweir     {
554*cdf0e10cSrcweir         RTL_LOGFILE_CONTEXT(aLog, "svtools ( ??? ) ::SvtHelpOptions_Impl::ctor()");
555*cdf0e10cSrcweir         pOptions = new SvtHelpOptions_Impl;
556*cdf0e10cSrcweir 
557*cdf0e10cSrcweir         ItemHolder2::holdConfigItem(E_HELPOPTIONS);
558*cdf0e10cSrcweir     }
559*cdf0e10cSrcweir     pImp = pOptions;
560*cdf0e10cSrcweir }
561*cdf0e10cSrcweir 
562*cdf0e10cSrcweir // -----------------------------------------------------------------------
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir sal_Int32 SvtHelpOptions_Impl::getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
567*cdf0e10cSrcweir 	ConstMapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL);
568*cdf0e10cSrcweir 	if (aURLIgnoreCounters.end() == aMapPos)
569*cdf0e10cSrcweir 		return GetHelpAgentRetryLimit();
570*cdf0e10cSrcweir 	return aMapPos->second;
571*cdf0e10cSrcweir }
572*cdf0e10cSrcweir 
573*cdf0e10cSrcweir // -----------------------------------------------------------------------
574*cdf0e10cSrcweir 
575*cdf0e10cSrcweir void SvtHelpOptions_Impl::decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
576*cdf0e10cSrcweir {
577*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
578*cdf0e10cSrcweir 	MapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL);
579*cdf0e10cSrcweir 	if (aURLIgnoreCounters.end() == aMapPos)
580*cdf0e10cSrcweir 	{	// nothing known about this URL 'til now
581*cdf0e10cSrcweir 		sal_Int32 nLimit = GetHelpAgentRetryLimit();
582*cdf0e10cSrcweir 		sal_Int32 nIgnoreAgain = nLimit > 0 ? nLimit - 1 : 0;
583*cdf0e10cSrcweir 		aURLIgnoreCounters[_rURL] = nIgnoreAgain;
584*cdf0e10cSrcweir 	}
585*cdf0e10cSrcweir 	else
586*cdf0e10cSrcweir 	{
587*cdf0e10cSrcweir 		sal_Int32& rCounter = aMapPos->second;
588*cdf0e10cSrcweir 		if (rCounter)
589*cdf0e10cSrcweir 			--rCounter;
590*cdf0e10cSrcweir 	}
591*cdf0e10cSrcweir 	SetModified();
592*cdf0e10cSrcweir }
593*cdf0e10cSrcweir 
594*cdf0e10cSrcweir // -----------------------------------------------------------------------
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir void SvtHelpOptions_Impl::resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
597*cdf0e10cSrcweir {
598*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
599*cdf0e10cSrcweir 	MapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL);
600*cdf0e10cSrcweir 	if (aURLIgnoreCounters.end() != aMapPos)
601*cdf0e10cSrcweir 	{
602*cdf0e10cSrcweir 		aURLIgnoreCounters.erase(aMapPos);
603*cdf0e10cSrcweir 		SetModified();
604*cdf0e10cSrcweir 	}
605*cdf0e10cSrcweir }
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir // -----------------------------------------------------------------------
608*cdf0e10cSrcweir 
609*cdf0e10cSrcweir void SvtHelpOptions_Impl::resetAgentIgnoreURLCounter()
610*cdf0e10cSrcweir {
611*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(aIgnoreCounterSafety);
612*cdf0e10cSrcweir 	aURLIgnoreCounters.clear();
613*cdf0e10cSrcweir 	SetModified();
614*cdf0e10cSrcweir }
615*cdf0e10cSrcweir 
616*cdf0e10cSrcweir // -----------------------------------------------------------------------
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir SvtHelpOptions::~SvtHelpOptions()
619*cdf0e10cSrcweir {
620*cdf0e10cSrcweir     // Global access, must be guarded (multithreading)
621*cdf0e10cSrcweir     ::osl::MutexGuard aGuard( SvtHelpOptions_Impl::getInitMutex() );
622*cdf0e10cSrcweir     if ( !--nRefCount )
623*cdf0e10cSrcweir 	{
624*cdf0e10cSrcweir 		if ( pOptions->IsModified() )
625*cdf0e10cSrcweir 			pOptions->Commit();
626*cdf0e10cSrcweir         DELETEZ( pOptions );
627*cdf0e10cSrcweir 	}
628*cdf0e10cSrcweir }
629*cdf0e10cSrcweir 
630*cdf0e10cSrcweir void SvtHelpOptions::SetExtendedHelp( sal_Bool b )
631*cdf0e10cSrcweir {
632*cdf0e10cSrcweir     pImp->SetExtendedHelp( b );
633*cdf0e10cSrcweir }
634*cdf0e10cSrcweir 
635*cdf0e10cSrcweir sal_Bool SvtHelpOptions::IsExtendedHelp() const
636*cdf0e10cSrcweir {
637*cdf0e10cSrcweir     return pImp->IsExtendedHelp();
638*cdf0e10cSrcweir }
639*cdf0e10cSrcweir 
640*cdf0e10cSrcweir void SvtHelpOptions::SetHelpTips( sal_Bool b )
641*cdf0e10cSrcweir {
642*cdf0e10cSrcweir     pImp->SetHelpTips( b );
643*cdf0e10cSrcweir }
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir sal_Bool SvtHelpOptions::IsHelpTips() const
646*cdf0e10cSrcweir {
647*cdf0e10cSrcweir     return pImp->IsHelpTips();
648*cdf0e10cSrcweir }
649*cdf0e10cSrcweir 
650*cdf0e10cSrcweir // -----------------------------------------------------------------------
651*cdf0e10cSrcweir 
652*cdf0e10cSrcweir void SvtHelpOptions::SetHelpAgentRetryLimit( sal_Int32 _nTrials )
653*cdf0e10cSrcweir {
654*cdf0e10cSrcweir     pImp->SetHelpAgentRetryLimit( _nTrials );
655*cdf0e10cSrcweir }
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir // -----------------------------------------------------------------------
658*cdf0e10cSrcweir 
659*cdf0e10cSrcweir sal_Int32 SvtHelpOptions::GetHelpAgentRetryLimit( ) const
660*cdf0e10cSrcweir {
661*cdf0e10cSrcweir     return pImp->GetHelpAgentRetryLimit( );
662*cdf0e10cSrcweir }
663*cdf0e10cSrcweir 
664*cdf0e10cSrcweir // -----------------------------------------------------------------------
665*cdf0e10cSrcweir 
666*cdf0e10cSrcweir void SvtHelpOptions::SetHelpAgentTimeoutPeriod( sal_Int32 _nSeconds )
667*cdf0e10cSrcweir {
668*cdf0e10cSrcweir     pImp->SetHelpAgentTimeoutPeriod( _nSeconds );
669*cdf0e10cSrcweir }
670*cdf0e10cSrcweir 
671*cdf0e10cSrcweir // -----------------------------------------------------------------------
672*cdf0e10cSrcweir 
673*cdf0e10cSrcweir sal_Int32 SvtHelpOptions::GetHelpAgentTimeoutPeriod( ) const
674*cdf0e10cSrcweir {
675*cdf0e10cSrcweir     return pImp->GetHelpAgentTimeoutPeriod( );
676*cdf0e10cSrcweir }
677*cdf0e10cSrcweir 
678*cdf0e10cSrcweir // -----------------------------------------------------------------------
679*cdf0e10cSrcweir 
680*cdf0e10cSrcweir void SvtHelpOptions::SetHelpAgentAutoStartMode( sal_Bool b )
681*cdf0e10cSrcweir {
682*cdf0e10cSrcweir     pImp->SetHelpAgentEnabled( b );
683*cdf0e10cSrcweir }
684*cdf0e10cSrcweir 
685*cdf0e10cSrcweir // -----------------------------------------------------------------------
686*cdf0e10cSrcweir 
687*cdf0e10cSrcweir sal_Bool SvtHelpOptions::IsHelpAgentAutoStartMode() const
688*cdf0e10cSrcweir {
689*cdf0e10cSrcweir     return pImp->IsHelpAgentEnabled();
690*cdf0e10cSrcweir }
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir // -----------------------------------------------------------------------
693*cdf0e10cSrcweir 
694*cdf0e10cSrcweir sal_Int32 SvtHelpOptions::getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
695*cdf0e10cSrcweir {
696*cdf0e10cSrcweir 	return pImp->getAgentIgnoreURLCounter( _rURL );
697*cdf0e10cSrcweir }
698*cdf0e10cSrcweir 
699*cdf0e10cSrcweir // -----------------------------------------------------------------------
700*cdf0e10cSrcweir 
701*cdf0e10cSrcweir void SvtHelpOptions::decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
702*cdf0e10cSrcweir {
703*cdf0e10cSrcweir 	pImp->decAgentIgnoreURLCounter( _rURL );
704*cdf0e10cSrcweir }
705*cdf0e10cSrcweir 
706*cdf0e10cSrcweir // -----------------------------------------------------------------------
707*cdf0e10cSrcweir 
708*cdf0e10cSrcweir void SvtHelpOptions::resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL )
709*cdf0e10cSrcweir {
710*cdf0e10cSrcweir 	pImp->resetAgentIgnoreURLCounter( _rURL );
711*cdf0e10cSrcweir }
712*cdf0e10cSrcweir 
713*cdf0e10cSrcweir // -----------------------------------------------------------------------
714*cdf0e10cSrcweir 
715*cdf0e10cSrcweir void SvtHelpOptions::resetAgentIgnoreURLCounter()
716*cdf0e10cSrcweir {
717*cdf0e10cSrcweir 	pImp->resetAgentIgnoreURLCounter();
718*cdf0e10cSrcweir }
719*cdf0e10cSrcweir 
720*cdf0e10cSrcweir // -----------------------------------------------------------------------
721*cdf0e10cSrcweir 
722*cdf0e10cSrcweir void SvtHelpOptions::SetWelcomeScreen( sal_Bool b )
723*cdf0e10cSrcweir {
724*cdf0e10cSrcweir     pImp->SetWelcomeScreen( b );
725*cdf0e10cSrcweir }
726*cdf0e10cSrcweir 
727*cdf0e10cSrcweir sal_Bool SvtHelpOptions::IsWelcomeScreen() const
728*cdf0e10cSrcweir {
729*cdf0e10cSrcweir     return pImp->IsWelcomeScreen();
730*cdf0e10cSrcweir }
731*cdf0e10cSrcweir 
732*cdf0e10cSrcweir IdList* SvtHelpOptions::GetPIStarterList()
733*cdf0e10cSrcweir {
734*cdf0e10cSrcweir     return pImp->GetPIStarterList();
735*cdf0e10cSrcweir }
736*cdf0e10cSrcweir 
737*cdf0e10cSrcweir void SvtHelpOptions::AddToPIStarterList( sal_Int32 )
738*cdf0e10cSrcweir {
739*cdf0e10cSrcweir }
740*cdf0e10cSrcweir 
741*cdf0e10cSrcweir void SvtHelpOptions::RemoveFromPIStarterList( sal_Int32 )
742*cdf0e10cSrcweir {
743*cdf0e10cSrcweir }
744*cdf0e10cSrcweir 
745*cdf0e10cSrcweir String SvtHelpOptions::GetLocale() const
746*cdf0e10cSrcweir {
747*cdf0e10cSrcweir     return pImp->GetLocale();
748*cdf0e10cSrcweir }
749*cdf0e10cSrcweir 
750*cdf0e10cSrcweir String SvtHelpOptions::GetSystem() const
751*cdf0e10cSrcweir {
752*cdf0e10cSrcweir     return pImp->GetSystem();
753*cdf0e10cSrcweir }
754*cdf0e10cSrcweir 
755*cdf0e10cSrcweir const String&   SvtHelpOptions::GetHelpStyleSheet()const
756*cdf0e10cSrcweir {
757*cdf0e10cSrcweir     return pImp->GetHelpStyleSheet();
758*cdf0e10cSrcweir }
759*cdf0e10cSrcweir 
760*cdf0e10cSrcweir void  SvtHelpOptions::SetHelpStyleSheet(const String& rStyleSheet)
761*cdf0e10cSrcweir {
762*cdf0e10cSrcweir     pImp->SetHelpStyleSheet(rStyleSheet);
763*cdf0e10cSrcweir }
764*cdf0e10cSrcweir 
765