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