1*b5088357SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*b5088357SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*b5088357SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*b5088357SAndrew Rist * distributed with this work for additional information
6*b5088357SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*b5088357SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*b5088357SAndrew Rist * "License"); you may not use this file except in compliance
9*b5088357SAndrew Rist * with the License. You may obtain a copy of the License at
10*b5088357SAndrew Rist *
11*b5088357SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*b5088357SAndrew Rist *
13*b5088357SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*b5088357SAndrew Rist * software distributed under the License is distributed on an
15*b5088357SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b5088357SAndrew Rist * KIND, either express or implied. See the License for the
17*b5088357SAndrew Rist * specific language governing permissions and limitations
18*b5088357SAndrew Rist * under the License.
19*b5088357SAndrew Rist *
20*b5088357SAndrew Rist *************************************************************/
21*b5088357SAndrew Rist
22*b5088357SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_unotools.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <unotools/useroptions.hxx>
28cdf0e10cSrcweir #include <unotools/useroptions_const.hxx>
29cdf0e10cSrcweir
30cdf0e10cSrcweir #include <unotools/configmgr.hxx>
31cdf0e10cSrcweir #include <tools/debug.hxx>
32cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
33cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
34cdf0e10cSrcweir #include <vos/mutex.hxx>
35cdf0e10cSrcweir #include <rtl/instance.hxx>
36cdf0e10cSrcweir #include <rtl/logfile.hxx>
37cdf0e10cSrcweir #include "itemholder1.hxx"
38cdf0e10cSrcweir
39cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp>
40cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
41cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
42cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
43cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
44cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
45cdf0e10cSrcweir #include <com/sun/star/util/XChangesListener.hpp>
46cdf0e10cSrcweir #include <com/sun/star/util/XChangesNotifier.hpp>
47cdf0e10cSrcweir #include <com/sun/star/util/ChangesEvent.hpp>
48cdf0e10cSrcweir #include <comphelper/configurationhelper.hxx>
49cdf0e10cSrcweir #include <unotools/processfactory.hxx>
50cdf0e10cSrcweir #include <unotools/loghelper.hxx>
51cdf0e10cSrcweir
52cdf0e10cSrcweir using namespace utl;
53cdf0e10cSrcweir using namespace rtl;
54cdf0e10cSrcweir using namespace com::sun::star;
55cdf0e10cSrcweir using namespace com::sun::star::uno;
56cdf0e10cSrcweir
57cdf0e10cSrcweir namespace css = ::com::sun::star;
58cdf0e10cSrcweir
59cdf0e10cSrcweir // class SvtUserOptions_Impl ---------------------------------------------
60cdf0e10cSrcweir class SvtUserOptions_Impl;
61cdf0e10cSrcweir class SvtUserConfigChangeListener_Impl : public cppu::WeakImplHelper1
62cdf0e10cSrcweir <
63cdf0e10cSrcweir com::sun::star::util::XChangesListener
64cdf0e10cSrcweir >
65cdf0e10cSrcweir {
66cdf0e10cSrcweir SvtUserOptions_Impl& m_rParent;
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl& rParent);
69cdf0e10cSrcweir ~SvtUserConfigChangeListener_Impl();
70cdf0e10cSrcweir
71cdf0e10cSrcweir //XChangesListener
72cdf0e10cSrcweir virtual void SAL_CALL changesOccurred( const util::ChangesEvent& Event ) throw(RuntimeException);
73cdf0e10cSrcweir //XEventListener
74cdf0e10cSrcweir virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw(RuntimeException);
75cdf0e10cSrcweir };
76cdf0e10cSrcweir
77cdf0e10cSrcweir class SvtUserOptions_Impl : public utl::ConfigurationBroadcaster
78cdf0e10cSrcweir {
79cdf0e10cSrcweir public:
80cdf0e10cSrcweir SvtUserOptions_Impl();
81cdf0e10cSrcweir ~SvtUserOptions_Impl();
82cdf0e10cSrcweir
83cdf0e10cSrcweir // get the user token
84cdf0e10cSrcweir ::rtl::OUString GetCompany() const;
85cdf0e10cSrcweir ::rtl::OUString GetFirstName() const;
86cdf0e10cSrcweir ::rtl::OUString GetLastName() const;
87cdf0e10cSrcweir ::rtl::OUString GetID() const;
88cdf0e10cSrcweir ::rtl::OUString GetStreet() const;
89cdf0e10cSrcweir ::rtl::OUString GetCity() const;
90cdf0e10cSrcweir ::rtl::OUString GetState() const;
91cdf0e10cSrcweir ::rtl::OUString GetZip() const;
92cdf0e10cSrcweir ::rtl::OUString GetCountry() const;
93cdf0e10cSrcweir ::rtl::OUString GetPosition() const;
94cdf0e10cSrcweir ::rtl::OUString GetTitle() const;
95cdf0e10cSrcweir ::rtl::OUString GetTelephoneHome() const;
96cdf0e10cSrcweir ::rtl::OUString GetTelephoneWork() const;
97cdf0e10cSrcweir ::rtl::OUString GetFax() const;
98cdf0e10cSrcweir ::rtl::OUString GetEmail() const;
99cdf0e10cSrcweir ::rtl::OUString GetCustomerNumber() const;
100cdf0e10cSrcweir ::rtl::OUString GetFathersName() const;
101cdf0e10cSrcweir ::rtl::OUString GetApartment() const;
102cdf0e10cSrcweir
103cdf0e10cSrcweir ::rtl::OUString GetFullName() const;
GetLocale() const104cdf0e10cSrcweir ::rtl::OUString GetLocale() const { return m_aLocale; }
105cdf0e10cSrcweir
106cdf0e10cSrcweir // set the address token
107cdf0e10cSrcweir void SetCompany( const ::rtl::OUString& rNewToken );
108cdf0e10cSrcweir void SetFirstName( const ::rtl::OUString& rNewToken );
109cdf0e10cSrcweir void SetLastName( const ::rtl::OUString& rNewToken );
110cdf0e10cSrcweir void SetID( const ::rtl::OUString& rNewToken );
111cdf0e10cSrcweir void SetStreet( const ::rtl::OUString& rNewToken );
112cdf0e10cSrcweir void SetCity( const ::rtl::OUString& rNewToken );
113cdf0e10cSrcweir void SetState( const ::rtl::OUString& rNewToken );
114cdf0e10cSrcweir void SetZip( const ::rtl::OUString& rNewToken );
115cdf0e10cSrcweir void SetCountry( const ::rtl::OUString& rNewToken );
116cdf0e10cSrcweir void SetPosition( const ::rtl::OUString& rNewToken );
117cdf0e10cSrcweir void SetTitle( const ::rtl::OUString& rNewToken );
118cdf0e10cSrcweir void SetTelephoneHome( const ::rtl::OUString& rNewToken );
119cdf0e10cSrcweir void SetTelephoneWork( const ::rtl::OUString& rNewToken );
120cdf0e10cSrcweir void SetFax( const ::rtl::OUString& rNewToken );
121cdf0e10cSrcweir void SetEmail( const ::rtl::OUString& rNewToken );
122cdf0e10cSrcweir void SetCustomerNumber( const ::rtl::OUString& rNewToken );
123cdf0e10cSrcweir void SetFathersName( const ::rtl::OUString& rNewToken );
124cdf0e10cSrcweir void SetApartment( const ::rtl::OUString& rNewToken );
125cdf0e10cSrcweir
126cdf0e10cSrcweir sal_Bool IsTokenReadonly( sal_uInt16 nToken ) const;
127cdf0e10cSrcweir ::rtl::OUString GetToken(sal_uInt16 nToken) const;
128cdf0e10cSrcweir void Notify();
129cdf0e10cSrcweir
130cdf0e10cSrcweir private:
131cdf0e10cSrcweir uno::Reference< util::XChangesListener > m_xChangeListener;
132cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > m_xCfg;
133cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > m_xData;
134cdf0e10cSrcweir ::rtl::OUString m_aLocale;
135cdf0e10cSrcweir };
136cdf0e10cSrcweir
137cdf0e10cSrcweir // global ----------------------------------------------------------------
138cdf0e10cSrcweir
139cdf0e10cSrcweir static SvtUserOptions_Impl* pOptions = NULL;
140cdf0e10cSrcweir static sal_Int32 nRefCount = 0;
141cdf0e10cSrcweir
142cdf0e10cSrcweir #define READONLY_DEFAULT sal_False
143cdf0e10cSrcweir
144cdf0e10cSrcweir /*-- 16.06.2009 14:22:56---------------------------------------------------
145cdf0e10cSrcweir
146cdf0e10cSrcweir -----------------------------------------------------------------------*/
SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl & rParent)147cdf0e10cSrcweir SvtUserConfigChangeListener_Impl::SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl& rParent) :
148cdf0e10cSrcweir m_rParent( rParent )
149cdf0e10cSrcweir {
150cdf0e10cSrcweir }
151cdf0e10cSrcweir /*-- 16.06.2009 14:22:56---------------------------------------------------
152cdf0e10cSrcweir
153cdf0e10cSrcweir -----------------------------------------------------------------------*/
~SvtUserConfigChangeListener_Impl()154cdf0e10cSrcweir SvtUserConfigChangeListener_Impl::~SvtUserConfigChangeListener_Impl()
155cdf0e10cSrcweir {
156cdf0e10cSrcweir }
157cdf0e10cSrcweir /*-- 16.06.2009 14:22:56---------------------------------------------------
158cdf0e10cSrcweir
159cdf0e10cSrcweir -----------------------------------------------------------------------*/
changesOccurred(const util::ChangesEvent & rEvent)160cdf0e10cSrcweir void SvtUserConfigChangeListener_Impl::changesOccurred( const util::ChangesEvent& rEvent ) throw(RuntimeException)
161cdf0e10cSrcweir {
162cdf0e10cSrcweir if(rEvent.Changes.getLength())
163cdf0e10cSrcweir m_rParent.Notify();
164cdf0e10cSrcweir }
165cdf0e10cSrcweir /*-- 16.06.2009 14:22:56---------------------------------------------------
166cdf0e10cSrcweir
167cdf0e10cSrcweir -----------------------------------------------------------------------*/
disposing(const lang::EventObject & rSource)168cdf0e10cSrcweir void SvtUserConfigChangeListener_Impl::disposing( const lang::EventObject& rSource ) throw(RuntimeException)
169cdf0e10cSrcweir {
170cdf0e10cSrcweir try
171cdf0e10cSrcweir {
172cdf0e10cSrcweir uno::Reference< util::XChangesNotifier > xChgNot( rSource.Source, UNO_QUERY_THROW);
173cdf0e10cSrcweir xChgNot->removeChangesListener(this);
174cdf0e10cSrcweir }
175cdf0e10cSrcweir catch(Exception& )
176cdf0e10cSrcweir {
177cdf0e10cSrcweir }
178cdf0e10cSrcweir }
179cdf0e10cSrcweir
180cdf0e10cSrcweir // class SvtUserOptions_Impl ---------------------------------------------
181cdf0e10cSrcweir
182cdf0e10cSrcweir // -----------------------------------------------------------------------
SvtUserOptions_Impl()183cdf0e10cSrcweir SvtUserOptions_Impl::SvtUserOptions_Impl() :
184cdf0e10cSrcweir m_xChangeListener( new SvtUserConfigChangeListener_Impl(*this) )
185cdf0e10cSrcweir {
186cdf0e10cSrcweir try
187cdf0e10cSrcweir {
188cdf0e10cSrcweir m_xCfg = Reference< css::container::XNameAccess > (
189cdf0e10cSrcweir ::comphelper::ConfigurationHelper::openConfig(
190cdf0e10cSrcweir utl::getProcessServiceFactory(),
191cdf0e10cSrcweir s_sData,
192cdf0e10cSrcweir ::comphelper::ConfigurationHelper::E_STANDARD),
193cdf0e10cSrcweir css::uno::UNO_QUERY );
194cdf0e10cSrcweir
195cdf0e10cSrcweir m_xData = css::uno::Reference< css::beans::XPropertySet >(m_xCfg, css::uno::UNO_QUERY);
196cdf0e10cSrcweir uno::Reference< util::XChangesNotifier > xChgNot( m_xCfg, UNO_QUERY);
197cdf0e10cSrcweir try
198cdf0e10cSrcweir {
199cdf0e10cSrcweir xChgNot->addChangesListener( m_xChangeListener );
200cdf0e10cSrcweir }
201cdf0e10cSrcweir catch(RuntimeException& )
202cdf0e10cSrcweir {
203cdf0e10cSrcweir }
204cdf0e10cSrcweir }
205cdf0e10cSrcweir catch(const css::uno::Exception& ex)
206cdf0e10cSrcweir {
207cdf0e10cSrcweir m_xCfg.clear();
208cdf0e10cSrcweir LogHelper::logIt(ex);
209cdf0e10cSrcweir }
210cdf0e10cSrcweir
211cdf0e10cSrcweir Any aAny = ConfigManager::GetConfigManager()->GetDirectConfigProperty( ConfigManager::LOCALE );
212cdf0e10cSrcweir ::rtl::OUString aLocale;
213cdf0e10cSrcweir if ( aAny >>= aLocale )
214cdf0e10cSrcweir m_aLocale = aLocale;
215cdf0e10cSrcweir else
216cdf0e10cSrcweir {
217cdf0e10cSrcweir DBG_ERRORFILE( "SvtUserOptions_Impl::SvtUserOptions_Impl(): no locale found" );
218cdf0e10cSrcweir }
219cdf0e10cSrcweir }
220cdf0e10cSrcweir
221cdf0e10cSrcweir // -----------------------------------------------------------------------
222cdf0e10cSrcweir
~SvtUserOptions_Impl()223cdf0e10cSrcweir SvtUserOptions_Impl::~SvtUserOptions_Impl()
224cdf0e10cSrcweir {
225cdf0e10cSrcweir }
226cdf0e10cSrcweir
GetCompany() const227cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetCompany() const
228cdf0e10cSrcweir {
229cdf0e10cSrcweir ::rtl::OUString sCompany;
230cdf0e10cSrcweir
231cdf0e10cSrcweir try
232cdf0e10cSrcweir {
233cdf0e10cSrcweir m_xData->getPropertyValue(s_so) >>= sCompany;
234cdf0e10cSrcweir }
235cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
236cdf0e10cSrcweir {
237cdf0e10cSrcweir LogHelper::logIt(ex);
238cdf0e10cSrcweir }
239cdf0e10cSrcweir
240cdf0e10cSrcweir return sCompany;
241cdf0e10cSrcweir }
242cdf0e10cSrcweir
GetFirstName() const243cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetFirstName() const
244cdf0e10cSrcweir {
245cdf0e10cSrcweir ::rtl::OUString sFirstName;
246cdf0e10cSrcweir
247cdf0e10cSrcweir try
248cdf0e10cSrcweir {
249cdf0e10cSrcweir m_xData->getPropertyValue(s_sgivenname) >>= sFirstName;
250cdf0e10cSrcweir }
251cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
252cdf0e10cSrcweir {
253cdf0e10cSrcweir LogHelper::logIt(ex);
254cdf0e10cSrcweir }
255cdf0e10cSrcweir
256cdf0e10cSrcweir return sFirstName;
257cdf0e10cSrcweir }
258cdf0e10cSrcweir
GetLastName() const259cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetLastName() const
260cdf0e10cSrcweir {
261cdf0e10cSrcweir ::rtl::OUString sLastName;
262cdf0e10cSrcweir
263cdf0e10cSrcweir try
264cdf0e10cSrcweir {
265cdf0e10cSrcweir m_xData->getPropertyValue(s_ssn) >>= sLastName;
266cdf0e10cSrcweir }
267cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
268cdf0e10cSrcweir {
269cdf0e10cSrcweir LogHelper::logIt(ex);
270cdf0e10cSrcweir }
271cdf0e10cSrcweir
272cdf0e10cSrcweir return sLastName;
273cdf0e10cSrcweir }
274cdf0e10cSrcweir
GetID() const275cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetID() const
276cdf0e10cSrcweir {
277cdf0e10cSrcweir ::rtl::OUString sID;
278cdf0e10cSrcweir
279cdf0e10cSrcweir try
280cdf0e10cSrcweir {
281cdf0e10cSrcweir m_xData->getPropertyValue(s_sinitials) >>= sID;
282cdf0e10cSrcweir }
283cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
284cdf0e10cSrcweir {
285cdf0e10cSrcweir LogHelper::logIt(ex);
286cdf0e10cSrcweir }
287cdf0e10cSrcweir
288cdf0e10cSrcweir return sID;
289cdf0e10cSrcweir }
290cdf0e10cSrcweir
GetStreet() const291cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetStreet() const
292cdf0e10cSrcweir {
293cdf0e10cSrcweir ::rtl::OUString sStreet;
294cdf0e10cSrcweir
295cdf0e10cSrcweir try
296cdf0e10cSrcweir {
297cdf0e10cSrcweir m_xData->getPropertyValue(s_sstreet) >>= sStreet;
298cdf0e10cSrcweir }
299cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
300cdf0e10cSrcweir {
301cdf0e10cSrcweir LogHelper::logIt(ex);
302cdf0e10cSrcweir }
303cdf0e10cSrcweir
304cdf0e10cSrcweir return sStreet;
305cdf0e10cSrcweir }
306cdf0e10cSrcweir
GetCity() const307cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetCity() const
308cdf0e10cSrcweir {
309cdf0e10cSrcweir ::rtl::OUString sCity;
310cdf0e10cSrcweir
311cdf0e10cSrcweir try
312cdf0e10cSrcweir {
313cdf0e10cSrcweir m_xData->getPropertyValue(s_sl) >>= sCity;
314cdf0e10cSrcweir }
315cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
316cdf0e10cSrcweir {
317cdf0e10cSrcweir LogHelper::logIt(ex);
318cdf0e10cSrcweir }
319cdf0e10cSrcweir
320cdf0e10cSrcweir return sCity;
321cdf0e10cSrcweir }
322cdf0e10cSrcweir
GetState() const323cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetState() const
324cdf0e10cSrcweir {
325cdf0e10cSrcweir ::rtl::OUString sState;
326cdf0e10cSrcweir
327cdf0e10cSrcweir try
328cdf0e10cSrcweir {
329cdf0e10cSrcweir m_xData->getPropertyValue(s_sst) >>= sState;
330cdf0e10cSrcweir }
331cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
332cdf0e10cSrcweir {
333cdf0e10cSrcweir LogHelper::logIt(ex);
334cdf0e10cSrcweir }
335cdf0e10cSrcweir
336cdf0e10cSrcweir return sState;
337cdf0e10cSrcweir }
338cdf0e10cSrcweir
GetZip() const339cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetZip() const
340cdf0e10cSrcweir {
341cdf0e10cSrcweir ::rtl::OUString sZip;
342cdf0e10cSrcweir
343cdf0e10cSrcweir try
344cdf0e10cSrcweir {
345cdf0e10cSrcweir m_xData->getPropertyValue(s_spostalcode) >>= sZip;
346cdf0e10cSrcweir }
347cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
348cdf0e10cSrcweir {
349cdf0e10cSrcweir LogHelper::logIt(ex);
350cdf0e10cSrcweir }
351cdf0e10cSrcweir
352cdf0e10cSrcweir return sZip;
353cdf0e10cSrcweir }
354cdf0e10cSrcweir
GetCountry() const355cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetCountry() const
356cdf0e10cSrcweir {
357cdf0e10cSrcweir ::rtl::OUString sCountry;
358cdf0e10cSrcweir
359cdf0e10cSrcweir try
360cdf0e10cSrcweir {
361cdf0e10cSrcweir m_xData->getPropertyValue(s_sc) >>= sCountry;
362cdf0e10cSrcweir }
363cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
364cdf0e10cSrcweir {
365cdf0e10cSrcweir LogHelper::logIt(ex);
366cdf0e10cSrcweir }
367cdf0e10cSrcweir
368cdf0e10cSrcweir return sCountry;
369cdf0e10cSrcweir }
370cdf0e10cSrcweir
GetPosition() const371cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetPosition() const
372cdf0e10cSrcweir {
373cdf0e10cSrcweir ::rtl::OUString sPosition;
374cdf0e10cSrcweir
375cdf0e10cSrcweir try
376cdf0e10cSrcweir {
377cdf0e10cSrcweir m_xData->getPropertyValue(s_sposition) >>= sPosition;
378cdf0e10cSrcweir }
379cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
380cdf0e10cSrcweir {
381cdf0e10cSrcweir LogHelper::logIt(ex);
382cdf0e10cSrcweir }
383cdf0e10cSrcweir
384cdf0e10cSrcweir return sPosition;
385cdf0e10cSrcweir }
386cdf0e10cSrcweir
GetTitle() const387cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetTitle() const
388cdf0e10cSrcweir {
389cdf0e10cSrcweir ::rtl::OUString sTitle;
390cdf0e10cSrcweir
391cdf0e10cSrcweir try
392cdf0e10cSrcweir {
393cdf0e10cSrcweir m_xData->getPropertyValue(s_stitle) >>= sTitle;
394cdf0e10cSrcweir }
395cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
396cdf0e10cSrcweir {
397cdf0e10cSrcweir LogHelper::logIt(ex);
398cdf0e10cSrcweir }
399cdf0e10cSrcweir
400cdf0e10cSrcweir return sTitle;
401cdf0e10cSrcweir }
402cdf0e10cSrcweir
GetTelephoneHome() const403cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetTelephoneHome() const
404cdf0e10cSrcweir {
405cdf0e10cSrcweir ::rtl::OUString sTelephoneHome;
406cdf0e10cSrcweir
407cdf0e10cSrcweir try
408cdf0e10cSrcweir {
409cdf0e10cSrcweir m_xData->getPropertyValue(s_shomephone) >>= sTelephoneHome;
410cdf0e10cSrcweir }
411cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
412cdf0e10cSrcweir {
413cdf0e10cSrcweir LogHelper::logIt(ex);
414cdf0e10cSrcweir }
415cdf0e10cSrcweir
416cdf0e10cSrcweir return sTelephoneHome;
417cdf0e10cSrcweir }
418cdf0e10cSrcweir
GetTelephoneWork() const419cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetTelephoneWork() const
420cdf0e10cSrcweir {
421cdf0e10cSrcweir ::rtl::OUString sTelephoneWork;
422cdf0e10cSrcweir
423cdf0e10cSrcweir try
424cdf0e10cSrcweir {
425cdf0e10cSrcweir m_xData->getPropertyValue(s_stelephonenumber) >>= sTelephoneWork;
426cdf0e10cSrcweir }
427cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
428cdf0e10cSrcweir {
429cdf0e10cSrcweir LogHelper::logIt(ex);
430cdf0e10cSrcweir }
431cdf0e10cSrcweir
432cdf0e10cSrcweir return sTelephoneWork;
433cdf0e10cSrcweir }
434cdf0e10cSrcweir
GetFax() const435cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetFax() const
436cdf0e10cSrcweir {
437cdf0e10cSrcweir ::rtl::OUString sFax;
438cdf0e10cSrcweir
439cdf0e10cSrcweir try
440cdf0e10cSrcweir {
441cdf0e10cSrcweir m_xData->getPropertyValue(s_sfacsimiletelephonenumber) >>= sFax;
442cdf0e10cSrcweir }
443cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
444cdf0e10cSrcweir {
445cdf0e10cSrcweir LogHelper::logIt(ex);
446cdf0e10cSrcweir }
447cdf0e10cSrcweir
448cdf0e10cSrcweir return sFax;
449cdf0e10cSrcweir }
450cdf0e10cSrcweir
GetEmail() const451cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetEmail() const
452cdf0e10cSrcweir {
453cdf0e10cSrcweir ::rtl::OUString sEmail;
454cdf0e10cSrcweir
455cdf0e10cSrcweir try
456cdf0e10cSrcweir {
457cdf0e10cSrcweir m_xData->getPropertyValue(s_smail) >>= sEmail;
458cdf0e10cSrcweir }
459cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
460cdf0e10cSrcweir {
461cdf0e10cSrcweir LogHelper::logIt(ex);
462cdf0e10cSrcweir }
463cdf0e10cSrcweir
464cdf0e10cSrcweir return sEmail;
465cdf0e10cSrcweir }
466cdf0e10cSrcweir
GetCustomerNumber() const467cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetCustomerNumber() const
468cdf0e10cSrcweir {
469cdf0e10cSrcweir ::rtl::OUString sCustomerNumber;
470cdf0e10cSrcweir
471cdf0e10cSrcweir try
472cdf0e10cSrcweir {
473cdf0e10cSrcweir m_xData->getPropertyValue(s_scustomernumber) >>= sCustomerNumber;
474cdf0e10cSrcweir }
475cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
476cdf0e10cSrcweir {
477cdf0e10cSrcweir LogHelper::logIt(ex);
478cdf0e10cSrcweir }
479cdf0e10cSrcweir
480cdf0e10cSrcweir return sCustomerNumber;
481cdf0e10cSrcweir }
482cdf0e10cSrcweir
GetFathersName() const483cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetFathersName() const
484cdf0e10cSrcweir {
485cdf0e10cSrcweir ::rtl::OUString sFathersName;
486cdf0e10cSrcweir
487cdf0e10cSrcweir try
488cdf0e10cSrcweir {
489cdf0e10cSrcweir m_xData->getPropertyValue(s_sfathersname) >>= sFathersName;
490cdf0e10cSrcweir }
491cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
492cdf0e10cSrcweir {
493cdf0e10cSrcweir LogHelper::logIt(ex);
494cdf0e10cSrcweir }
495cdf0e10cSrcweir
496cdf0e10cSrcweir return sFathersName;
497cdf0e10cSrcweir }
498cdf0e10cSrcweir
GetApartment() const499cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetApartment() const
500cdf0e10cSrcweir {
501cdf0e10cSrcweir ::rtl::OUString sApartment;
502cdf0e10cSrcweir
503cdf0e10cSrcweir try
504cdf0e10cSrcweir {
505cdf0e10cSrcweir m_xData->getPropertyValue(s_sapartment) >>= sApartment;
506cdf0e10cSrcweir }
507cdf0e10cSrcweir catch ( const css::uno::Exception& ex )
508cdf0e10cSrcweir {
509cdf0e10cSrcweir LogHelper::logIt(ex);
510cdf0e10cSrcweir }
511cdf0e10cSrcweir
512cdf0e10cSrcweir return sApartment;
513cdf0e10cSrcweir }
514cdf0e10cSrcweir
SetCompany(const::rtl::OUString & sCompany)515cdf0e10cSrcweir void SvtUserOptions_Impl::SetCompany( const ::rtl::OUString& sCompany )
516cdf0e10cSrcweir {
517cdf0e10cSrcweir try
518cdf0e10cSrcweir {
519cdf0e10cSrcweir m_xData->setPropertyValue(s_so, css::uno::makeAny(::rtl::OUString(sCompany)));
520cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
521cdf0e10cSrcweir }
522cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
523cdf0e10cSrcweir {
524cdf0e10cSrcweir LogHelper::logIt(ex);
525cdf0e10cSrcweir }
526cdf0e10cSrcweir }
527cdf0e10cSrcweir
SetFirstName(const::rtl::OUString & sFirstName)528cdf0e10cSrcweir void SvtUserOptions_Impl::SetFirstName( const ::rtl::OUString& sFirstName )
529cdf0e10cSrcweir {
530cdf0e10cSrcweir try
531cdf0e10cSrcweir {
532cdf0e10cSrcweir m_xData->setPropertyValue(s_sgivenname, css::uno::makeAny(::rtl::OUString(sFirstName)));
533cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
534cdf0e10cSrcweir }
535cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
536cdf0e10cSrcweir {
537cdf0e10cSrcweir LogHelper::logIt(ex);
538cdf0e10cSrcweir }
539cdf0e10cSrcweir }
540cdf0e10cSrcweir
SetLastName(const::rtl::OUString & sLastName)541cdf0e10cSrcweir void SvtUserOptions_Impl::SetLastName( const ::rtl::OUString& sLastName )
542cdf0e10cSrcweir {
543cdf0e10cSrcweir try
544cdf0e10cSrcweir {
545cdf0e10cSrcweir m_xData->setPropertyValue(s_ssn, css::uno::makeAny(::rtl::OUString(sLastName)));
546cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
547cdf0e10cSrcweir }
548cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
549cdf0e10cSrcweir {
550cdf0e10cSrcweir LogHelper::logIt(ex);
551cdf0e10cSrcweir }
552cdf0e10cSrcweir }
SetID(const::rtl::OUString & sID)553cdf0e10cSrcweir void SvtUserOptions_Impl::SetID( const ::rtl::OUString& sID )
554cdf0e10cSrcweir {
555cdf0e10cSrcweir try
556cdf0e10cSrcweir {
557cdf0e10cSrcweir m_xData->setPropertyValue(s_sinitials, css::uno::makeAny(::rtl::OUString(sID)));
558cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
559cdf0e10cSrcweir }
560cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
561cdf0e10cSrcweir {
562cdf0e10cSrcweir LogHelper::logIt(ex);
563cdf0e10cSrcweir }
564cdf0e10cSrcweir }
565cdf0e10cSrcweir
SetStreet(const::rtl::OUString & sStreet)566cdf0e10cSrcweir void SvtUserOptions_Impl::SetStreet( const ::rtl::OUString& sStreet )
567cdf0e10cSrcweir {
568cdf0e10cSrcweir try
569cdf0e10cSrcweir {
570cdf0e10cSrcweir m_xData->setPropertyValue(s_sstreet, css::uno::makeAny(::rtl::OUString(sStreet)));
571cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
572cdf0e10cSrcweir }
573cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
574cdf0e10cSrcweir {
575cdf0e10cSrcweir LogHelper::logIt(ex);
576cdf0e10cSrcweir }
577cdf0e10cSrcweir }
578cdf0e10cSrcweir
SetCity(const::rtl::OUString & sCity)579cdf0e10cSrcweir void SvtUserOptions_Impl::SetCity( const ::rtl::OUString& sCity )
580cdf0e10cSrcweir {
581cdf0e10cSrcweir try
582cdf0e10cSrcweir {
583cdf0e10cSrcweir m_xData->setPropertyValue(s_sl, css::uno::makeAny(::rtl::OUString(sCity)));
584cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
585cdf0e10cSrcweir }
586cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
587cdf0e10cSrcweir {
588cdf0e10cSrcweir LogHelper::logIt(ex);
589cdf0e10cSrcweir }
590cdf0e10cSrcweir }
591cdf0e10cSrcweir
SetState(const::rtl::OUString & sState)592cdf0e10cSrcweir void SvtUserOptions_Impl::SetState( const ::rtl::OUString& sState )
593cdf0e10cSrcweir {
594cdf0e10cSrcweir try
595cdf0e10cSrcweir {
596cdf0e10cSrcweir m_xData->setPropertyValue(s_sst, css::uno::makeAny(::rtl::OUString(sState)));
597cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
598cdf0e10cSrcweir }
599cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
600cdf0e10cSrcweir {
601cdf0e10cSrcweir LogHelper::logIt(ex);
602cdf0e10cSrcweir }
603cdf0e10cSrcweir }
604cdf0e10cSrcweir
SetZip(const::rtl::OUString & sZip)605cdf0e10cSrcweir void SvtUserOptions_Impl::SetZip( const ::rtl::OUString& sZip )
606cdf0e10cSrcweir {
607cdf0e10cSrcweir try
608cdf0e10cSrcweir {
609cdf0e10cSrcweir m_xData->setPropertyValue(s_spostalcode, css::uno::makeAny(::rtl::OUString(sZip)));
610cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
611cdf0e10cSrcweir }
612cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
613cdf0e10cSrcweir {
614cdf0e10cSrcweir LogHelper::logIt(ex);
615cdf0e10cSrcweir }
616cdf0e10cSrcweir }
617cdf0e10cSrcweir
SetCountry(const::rtl::OUString & sCountry)618cdf0e10cSrcweir void SvtUserOptions_Impl::SetCountry( const ::rtl::OUString& sCountry )
619cdf0e10cSrcweir {
620cdf0e10cSrcweir try
621cdf0e10cSrcweir {
622cdf0e10cSrcweir m_xData->setPropertyValue(s_sc, css::uno::makeAny(::rtl::OUString(sCountry)));
623cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
624cdf0e10cSrcweir }
625cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
626cdf0e10cSrcweir {
627cdf0e10cSrcweir LogHelper::logIt(ex);
628cdf0e10cSrcweir }
629cdf0e10cSrcweir }
630cdf0e10cSrcweir
SetPosition(const::rtl::OUString & sPosition)631cdf0e10cSrcweir void SvtUserOptions_Impl::SetPosition( const ::rtl::OUString& sPosition )
632cdf0e10cSrcweir {
633cdf0e10cSrcweir try
634cdf0e10cSrcweir {
635cdf0e10cSrcweir m_xData->setPropertyValue(s_sposition, css::uno::makeAny(::rtl::OUString(sPosition)));
636cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
637cdf0e10cSrcweir }
638cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
639cdf0e10cSrcweir {
640cdf0e10cSrcweir LogHelper::logIt(ex);
641cdf0e10cSrcweir }
642cdf0e10cSrcweir }
643cdf0e10cSrcweir
SetTitle(const::rtl::OUString & sTitle)644cdf0e10cSrcweir void SvtUserOptions_Impl::SetTitle( const ::rtl::OUString& sTitle )
645cdf0e10cSrcweir {
646cdf0e10cSrcweir try
647cdf0e10cSrcweir {
648cdf0e10cSrcweir m_xData->setPropertyValue(s_stitle, css::uno::makeAny(::rtl::OUString(sTitle)));
649cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
650cdf0e10cSrcweir }
651cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
652cdf0e10cSrcweir {
653cdf0e10cSrcweir LogHelper::logIt(ex);
654cdf0e10cSrcweir }
655cdf0e10cSrcweir }
656cdf0e10cSrcweir
SetTelephoneHome(const::rtl::OUString & sTelephoneHome)657cdf0e10cSrcweir void SvtUserOptions_Impl::SetTelephoneHome( const ::rtl::OUString& sTelephoneHome )
658cdf0e10cSrcweir {
659cdf0e10cSrcweir try
660cdf0e10cSrcweir {
661cdf0e10cSrcweir m_xData->setPropertyValue(s_shomephone, css::uno::makeAny(::rtl::OUString(sTelephoneHome)));
662cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
663cdf0e10cSrcweir }
664cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
665cdf0e10cSrcweir {
666cdf0e10cSrcweir LogHelper::logIt(ex);
667cdf0e10cSrcweir }
668cdf0e10cSrcweir }
669cdf0e10cSrcweir
SetTelephoneWork(const::rtl::OUString & sTelephoneWork)670cdf0e10cSrcweir void SvtUserOptions_Impl::SetTelephoneWork( const ::rtl::OUString& sTelephoneWork )
671cdf0e10cSrcweir {
672cdf0e10cSrcweir try
673cdf0e10cSrcweir {
674cdf0e10cSrcweir m_xData->setPropertyValue(s_stelephonenumber, css::uno::makeAny(::rtl::OUString(sTelephoneWork)));
675cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
676cdf0e10cSrcweir }
677cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
678cdf0e10cSrcweir {
679cdf0e10cSrcweir LogHelper::logIt(ex);
680cdf0e10cSrcweir }
681cdf0e10cSrcweir }
682cdf0e10cSrcweir
SetFax(const::rtl::OUString & sFax)683cdf0e10cSrcweir void SvtUserOptions_Impl::SetFax( const ::rtl::OUString& sFax )
684cdf0e10cSrcweir {
685cdf0e10cSrcweir try
686cdf0e10cSrcweir {
687cdf0e10cSrcweir m_xData->setPropertyValue(s_sfacsimiletelephonenumber, css::uno::makeAny(::rtl::OUString(sFax)));
688cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
689cdf0e10cSrcweir }
690cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
691cdf0e10cSrcweir {
692cdf0e10cSrcweir LogHelper::logIt(ex);
693cdf0e10cSrcweir }
694cdf0e10cSrcweir }
695cdf0e10cSrcweir
SetEmail(const::rtl::OUString & sEmail)696cdf0e10cSrcweir void SvtUserOptions_Impl::SetEmail( const ::rtl::OUString& sEmail )
697cdf0e10cSrcweir {
698cdf0e10cSrcweir try
699cdf0e10cSrcweir {
700cdf0e10cSrcweir m_xData->setPropertyValue(s_smail, css::uno::makeAny(::rtl::OUString(sEmail)));
701cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
702cdf0e10cSrcweir }
703cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
704cdf0e10cSrcweir {
705cdf0e10cSrcweir LogHelper::logIt(ex);
706cdf0e10cSrcweir }
707cdf0e10cSrcweir }
708cdf0e10cSrcweir
SetCustomerNumber(const::rtl::OUString & sCustomerNumber)709cdf0e10cSrcweir void SvtUserOptions_Impl::SetCustomerNumber( const ::rtl::OUString& sCustomerNumber )
710cdf0e10cSrcweir {
711cdf0e10cSrcweir try
712cdf0e10cSrcweir {
713cdf0e10cSrcweir m_xData->setPropertyValue(s_scustomernumber, css::uno::makeAny(::rtl::OUString(sCustomerNumber)));
714cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
715cdf0e10cSrcweir }
716cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
717cdf0e10cSrcweir {
718cdf0e10cSrcweir LogHelper::logIt(ex);
719cdf0e10cSrcweir }
720cdf0e10cSrcweir }
721cdf0e10cSrcweir
SetFathersName(const::rtl::OUString & sFathersName)722cdf0e10cSrcweir void SvtUserOptions_Impl::SetFathersName( const ::rtl::OUString& sFathersName )
723cdf0e10cSrcweir {
724cdf0e10cSrcweir try
725cdf0e10cSrcweir {
726cdf0e10cSrcweir m_xData->setPropertyValue(s_sfathersname, css::uno::makeAny(::rtl::OUString(sFathersName)));
727cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
728cdf0e10cSrcweir }
729cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
730cdf0e10cSrcweir {
731cdf0e10cSrcweir LogHelper::logIt(ex);
732cdf0e10cSrcweir }
733cdf0e10cSrcweir }
734cdf0e10cSrcweir
SetApartment(const::rtl::OUString & sApartment)735cdf0e10cSrcweir void SvtUserOptions_Impl::SetApartment( const ::rtl::OUString& sApartment )
736cdf0e10cSrcweir {
737cdf0e10cSrcweir try
738cdf0e10cSrcweir {
739cdf0e10cSrcweir m_xData->setPropertyValue(s_sapartment, css::uno::makeAny(::rtl::OUString(sApartment)));
740cdf0e10cSrcweir ::comphelper::ConfigurationHelper::flush(m_xCfg);
741cdf0e10cSrcweir }
742cdf0e10cSrcweir catch ( const css::uno::Exception& ex)
743cdf0e10cSrcweir {
744cdf0e10cSrcweir LogHelper::logIt(ex);
745cdf0e10cSrcweir }
746cdf0e10cSrcweir }
747cdf0e10cSrcweir
748cdf0e10cSrcweir // -----------------------------------------------------------------------
749cdf0e10cSrcweir
GetFullName() const750cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetFullName() const
751cdf0e10cSrcweir {
752cdf0e10cSrcweir ::rtl::OUString sFullName;
753cdf0e10cSrcweir
754cdf0e10cSrcweir sFullName = GetFirstName();
755cdf0e10cSrcweir sFullName.trim();
756cdf0e10cSrcweir if ( sFullName.getLength() )
757cdf0e10cSrcweir sFullName += ::rtl::OUString::createFromAscii(" ");
758cdf0e10cSrcweir sFullName += GetLastName();
759cdf0e10cSrcweir sFullName.trim();
760cdf0e10cSrcweir
761cdf0e10cSrcweir return sFullName;
762cdf0e10cSrcweir }
763cdf0e10cSrcweir
764cdf0e10cSrcweir // -----------------------------------------------------------------------
765cdf0e10cSrcweir
Notify()766cdf0e10cSrcweir void SvtUserOptions_Impl::Notify()
767cdf0e10cSrcweir {
768cdf0e10cSrcweir NotifyListeners(0);
769cdf0e10cSrcweir }
770cdf0e10cSrcweir
771cdf0e10cSrcweir // -----------------------------------------------------------------------
772cdf0e10cSrcweir
IsTokenReadonly(sal_uInt16 nToken) const773cdf0e10cSrcweir sal_Bool SvtUserOptions_Impl::IsTokenReadonly( sal_uInt16 nToken ) const
774cdf0e10cSrcweir {
775cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xData(m_xCfg, css::uno::UNO_QUERY);
776cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySetInfo > xInfo = xData->getPropertySetInfo();
777cdf0e10cSrcweir css::beans::Property aProp;
778cdf0e10cSrcweir sal_Bool bRet = sal_False;
779cdf0e10cSrcweir
780cdf0e10cSrcweir switch ( nToken )
781cdf0e10cSrcweir {
782cdf0e10cSrcweir case USER_OPT_COMPANY:
783cdf0e10cSrcweir {
784cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_so);
785cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
786cdf0e10cSrcweir break;
787cdf0e10cSrcweir }
788cdf0e10cSrcweir case USER_OPT_FIRSTNAME:
789cdf0e10cSrcweir {
790cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sgivenname);
791cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
792cdf0e10cSrcweir break;
793cdf0e10cSrcweir }
794cdf0e10cSrcweir case USER_OPT_LASTNAME:
795cdf0e10cSrcweir {
796cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_ssn);
797cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
798cdf0e10cSrcweir break;
799cdf0e10cSrcweir }
800cdf0e10cSrcweir case USER_OPT_ID:
801cdf0e10cSrcweir {
802cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sinitials);
803cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
804cdf0e10cSrcweir break;
805cdf0e10cSrcweir }
806cdf0e10cSrcweir case USER_OPT_STREET:
807cdf0e10cSrcweir {
808cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sstreet);
809cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
810cdf0e10cSrcweir break;
811cdf0e10cSrcweir }
812cdf0e10cSrcweir case USER_OPT_CITY:
813cdf0e10cSrcweir {
814cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sl);
815cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
816cdf0e10cSrcweir break;
817cdf0e10cSrcweir }
818cdf0e10cSrcweir case USER_OPT_STATE:
819cdf0e10cSrcweir {
820cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sst);
821cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
822cdf0e10cSrcweir break;
823cdf0e10cSrcweir }
824cdf0e10cSrcweir case USER_OPT_ZIP:
825cdf0e10cSrcweir {
826cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_spostalcode);
827cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
828cdf0e10cSrcweir break;
829cdf0e10cSrcweir }
830cdf0e10cSrcweir case USER_OPT_COUNTRY:
831cdf0e10cSrcweir {
832cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sc);
833cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
834cdf0e10cSrcweir break;
835cdf0e10cSrcweir }
836cdf0e10cSrcweir case USER_OPT_POSITION:
837cdf0e10cSrcweir {
838cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sposition);
839cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
840cdf0e10cSrcweir break;
841cdf0e10cSrcweir }
842cdf0e10cSrcweir case USER_OPT_TITLE:
843cdf0e10cSrcweir {
844cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_stitle);
845cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
846cdf0e10cSrcweir break;
847cdf0e10cSrcweir }
848cdf0e10cSrcweir case USER_OPT_TELEPHONEHOME:
849cdf0e10cSrcweir {
850cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_shomephone);
851cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
852cdf0e10cSrcweir break;
853cdf0e10cSrcweir }
854cdf0e10cSrcweir case USER_OPT_TELEPHONEWORK:
855cdf0e10cSrcweir {
856cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_stelephonenumber);
857cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
858cdf0e10cSrcweir break;
859cdf0e10cSrcweir }
860cdf0e10cSrcweir case USER_OPT_FAX:
861cdf0e10cSrcweir {
862cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sfacsimiletelephonenumber);
863cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
864cdf0e10cSrcweir break;
865cdf0e10cSrcweir }
866cdf0e10cSrcweir case USER_OPT_EMAIL:
867cdf0e10cSrcweir {
868cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_smail);
869cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
870cdf0e10cSrcweir break;
871cdf0e10cSrcweir }
872cdf0e10cSrcweir case USER_OPT_FATHERSNAME:
873cdf0e10cSrcweir {
874cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sfathersname);
875cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
876cdf0e10cSrcweir break;
877cdf0e10cSrcweir }
878cdf0e10cSrcweir case USER_OPT_APARTMENT:
879cdf0e10cSrcweir {
880cdf0e10cSrcweir aProp = xInfo->getPropertyByName(s_sapartment);
881cdf0e10cSrcweir bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
882cdf0e10cSrcweir break;
883cdf0e10cSrcweir }
884cdf0e10cSrcweir default:
885cdf0e10cSrcweir DBG_ERRORFILE( "SvtUserOptions_Impl::IsTokenReadonly(): invalid token" );
886cdf0e10cSrcweir }
887cdf0e10cSrcweir
888cdf0e10cSrcweir return bRet;
889cdf0e10cSrcweir }
890cdf0e10cSrcweir
891cdf0e10cSrcweir //------------------------------------------------------------------------
GetToken(sal_uInt16 nToken) const892cdf0e10cSrcweir ::rtl::OUString SvtUserOptions_Impl::GetToken(sal_uInt16 nToken) const
893cdf0e10cSrcweir {
894cdf0e10cSrcweir ::rtl::OUString pRet;
895cdf0e10cSrcweir switch(nToken)
896cdf0e10cSrcweir {
897cdf0e10cSrcweir case USER_OPT_COMPANY: pRet = GetCompany(); break;
898cdf0e10cSrcweir case USER_OPT_FIRSTNAME: pRet = GetFirstName(); break;
899cdf0e10cSrcweir case USER_OPT_LASTNAME: pRet = GetLastName(); break;
900cdf0e10cSrcweir case USER_OPT_ID: pRet = GetID(); break;
901cdf0e10cSrcweir case USER_OPT_STREET: pRet = GetStreet(); break;
902cdf0e10cSrcweir case USER_OPT_CITY: pRet = GetCity(); break;
903cdf0e10cSrcweir case USER_OPT_STATE: pRet = GetState(); break;
904cdf0e10cSrcweir case USER_OPT_ZIP: pRet = GetZip(); break;
905cdf0e10cSrcweir case USER_OPT_COUNTRY: pRet = GetCountry(); break;
906cdf0e10cSrcweir case USER_OPT_POSITION: pRet = GetPosition(); break;
907cdf0e10cSrcweir case USER_OPT_TITLE: pRet = GetTitle(); break;
908cdf0e10cSrcweir case USER_OPT_TELEPHONEHOME: pRet = GetTelephoneHome(); break;
909cdf0e10cSrcweir case USER_OPT_TELEPHONEWORK: pRet = GetTelephoneWork(); break;
910cdf0e10cSrcweir case USER_OPT_FAX: pRet = GetFax(); break;
911cdf0e10cSrcweir case USER_OPT_EMAIL: pRet = GetEmail(); break;
912cdf0e10cSrcweir case USER_OPT_FATHERSNAME: pRet = GetFathersName(); break;
913cdf0e10cSrcweir case USER_OPT_APARTMENT: pRet = GetApartment(); break;
914cdf0e10cSrcweir default:
915cdf0e10cSrcweir DBG_ERRORFILE( "SvtUserOptions_Impl::GetToken(): invalid token" );
916cdf0e10cSrcweir }
917cdf0e10cSrcweir return pRet;
918cdf0e10cSrcweir }
919cdf0e10cSrcweir
920cdf0e10cSrcweir // class SvtUserOptions --------------------------------------------------
921cdf0e10cSrcweir
SvtUserOptions()922cdf0e10cSrcweir SvtUserOptions::SvtUserOptions()
923cdf0e10cSrcweir {
924cdf0e10cSrcweir // Global access, must be guarded (multithreading)
925cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
926cdf0e10cSrcweir
927cdf0e10cSrcweir if ( !pOptions )
928cdf0e10cSrcweir {
929cdf0e10cSrcweir RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtUserOptions_Impl::ctor()");
930cdf0e10cSrcweir pOptions = new SvtUserOptions_Impl;
931cdf0e10cSrcweir
932cdf0e10cSrcweir ItemHolder1::holdConfigItem(E_USEROPTIONS);
933cdf0e10cSrcweir }
934cdf0e10cSrcweir ++nRefCount;
935cdf0e10cSrcweir pImp = pOptions;
936cdf0e10cSrcweir pImp->AddListener(this);
937cdf0e10cSrcweir }
938cdf0e10cSrcweir
939cdf0e10cSrcweir // -----------------------------------------------------------------------
940cdf0e10cSrcweir
~SvtUserOptions()941cdf0e10cSrcweir SvtUserOptions::~SvtUserOptions()
942cdf0e10cSrcweir {
943cdf0e10cSrcweir // Global access, must be guarded (multithreading)
944cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
945cdf0e10cSrcweir pImp->RemoveListener(this);
946cdf0e10cSrcweir if ( !--nRefCount )
947cdf0e10cSrcweir {
948cdf0e10cSrcweir //if ( pOptions->IsModified() )
949cdf0e10cSrcweir // pOptions->Commit();
950cdf0e10cSrcweir DELETEZ( pOptions );
951cdf0e10cSrcweir }
952cdf0e10cSrcweir }
953cdf0e10cSrcweir
954cdf0e10cSrcweir // -----------------------------------------------------------------------
955cdf0e10cSrcweir
GetInitMutex()956cdf0e10cSrcweir ::osl::Mutex& SvtUserOptions::GetInitMutex()
957cdf0e10cSrcweir {
958cdf0e10cSrcweir // Initialize static mutex only for one time!
959cdf0e10cSrcweir static ::osl::Mutex* pMutex = NULL;
960cdf0e10cSrcweir // If these method first called (Mutex not already exist!) ...
961cdf0e10cSrcweir if ( pMutex == NULL )
962cdf0e10cSrcweir {
963cdf0e10cSrcweir // ... we must create a new one. Protect follow code with the global mutex -
964cdf0e10cSrcweir // It must be - we create a static variable!
965cdf0e10cSrcweir ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
966cdf0e10cSrcweir // We must check our pointer again -
967cdf0e10cSrcweir // because another instance of our class will be faster then this instance!
968cdf0e10cSrcweir if ( pMutex == NULL )
969cdf0e10cSrcweir {
970cdf0e10cSrcweir // Create the new mutex and set it for return on static variable.
971cdf0e10cSrcweir static ::osl::Mutex aMutex;
972cdf0e10cSrcweir pMutex = &aMutex;
973cdf0e10cSrcweir }
974cdf0e10cSrcweir }
975cdf0e10cSrcweir // Return new created or already existing mutex object.
976cdf0e10cSrcweir return *pMutex;
977cdf0e10cSrcweir }
978cdf0e10cSrcweir
979cdf0e10cSrcweir // -----------------------------------------------------------------------
980cdf0e10cSrcweir
GetCompany() const981cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetCompany() const
982cdf0e10cSrcweir {
983cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
984cdf0e10cSrcweir return pImp->GetCompany();
985cdf0e10cSrcweir }
986cdf0e10cSrcweir
987cdf0e10cSrcweir // -----------------------------------------------------------------------
988cdf0e10cSrcweir
GetFirstName() const989cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetFirstName() const
990cdf0e10cSrcweir {
991cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
992cdf0e10cSrcweir return pImp->GetFirstName();
993cdf0e10cSrcweir }
994cdf0e10cSrcweir
995cdf0e10cSrcweir // -----------------------------------------------------------------------
996cdf0e10cSrcweir
GetLastName() const997cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetLastName() const
998cdf0e10cSrcweir {
999cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1000cdf0e10cSrcweir return pImp->GetLastName();
1001cdf0e10cSrcweir }
1002cdf0e10cSrcweir
1003cdf0e10cSrcweir // -----------------------------------------------------------------------
1004cdf0e10cSrcweir
GetID() const1005cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetID() const
1006cdf0e10cSrcweir {
1007cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1008cdf0e10cSrcweir return pImp->GetID();
1009cdf0e10cSrcweir }
1010cdf0e10cSrcweir
1011cdf0e10cSrcweir // -----------------------------------------------------------------------
1012cdf0e10cSrcweir
GetStreet() const1013cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetStreet() const
1014cdf0e10cSrcweir {
1015cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1016cdf0e10cSrcweir return pImp->GetStreet();
1017cdf0e10cSrcweir }
1018cdf0e10cSrcweir
1019cdf0e10cSrcweir // -----------------------------------------------------------------------
1020cdf0e10cSrcweir
GetCity() const1021cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetCity() const
1022cdf0e10cSrcweir {
1023cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1024cdf0e10cSrcweir return pImp->GetCity();
1025cdf0e10cSrcweir }
1026cdf0e10cSrcweir
1027cdf0e10cSrcweir // -----------------------------------------------------------------------
1028cdf0e10cSrcweir
GetState() const1029cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetState() const
1030cdf0e10cSrcweir {
1031cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1032cdf0e10cSrcweir return pImp->GetState();
1033cdf0e10cSrcweir }
1034cdf0e10cSrcweir
1035cdf0e10cSrcweir // -----------------------------------------------------------------------
1036cdf0e10cSrcweir
GetZip() const1037cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetZip() const
1038cdf0e10cSrcweir {
1039cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1040cdf0e10cSrcweir return pImp->GetZip();
1041cdf0e10cSrcweir }
1042cdf0e10cSrcweir
1043cdf0e10cSrcweir // -----------------------------------------------------------------------
1044cdf0e10cSrcweir
GetCountry() const1045cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetCountry() const
1046cdf0e10cSrcweir {
1047cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1048cdf0e10cSrcweir return pImp->GetCountry();
1049cdf0e10cSrcweir }
1050cdf0e10cSrcweir
1051cdf0e10cSrcweir // -----------------------------------------------------------------------
1052cdf0e10cSrcweir
GetPosition() const1053cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetPosition() const
1054cdf0e10cSrcweir {
1055cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1056cdf0e10cSrcweir return pImp->GetPosition();
1057cdf0e10cSrcweir }
1058cdf0e10cSrcweir
1059cdf0e10cSrcweir // -----------------------------------------------------------------------
1060cdf0e10cSrcweir
GetTitle() const1061cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetTitle() const
1062cdf0e10cSrcweir {
1063cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1064cdf0e10cSrcweir return pImp->GetTitle();
1065cdf0e10cSrcweir }
1066cdf0e10cSrcweir
1067cdf0e10cSrcweir // -----------------------------------------------------------------------
1068cdf0e10cSrcweir
GetTelephoneHome() const1069cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetTelephoneHome() const
1070cdf0e10cSrcweir {
1071cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1072cdf0e10cSrcweir return pImp->GetTelephoneHome();
1073cdf0e10cSrcweir }
1074cdf0e10cSrcweir
1075cdf0e10cSrcweir // -----------------------------------------------------------------------
1076cdf0e10cSrcweir
GetTelephoneWork() const1077cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetTelephoneWork() const
1078cdf0e10cSrcweir {
1079cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1080cdf0e10cSrcweir return pImp->GetTelephoneWork();
1081cdf0e10cSrcweir }
1082cdf0e10cSrcweir
1083cdf0e10cSrcweir // -----------------------------------------------------------------------
1084cdf0e10cSrcweir
GetFax() const1085cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetFax() const
1086cdf0e10cSrcweir {
1087cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1088cdf0e10cSrcweir return pImp->GetFax();
1089cdf0e10cSrcweir }
1090cdf0e10cSrcweir
1091cdf0e10cSrcweir // -----------------------------------------------------------------------
1092cdf0e10cSrcweir
GetEmail() const1093cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetEmail() const
1094cdf0e10cSrcweir {
1095cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1096cdf0e10cSrcweir return pImp->GetEmail();
1097cdf0e10cSrcweir }
1098cdf0e10cSrcweir
1099cdf0e10cSrcweir // -----------------------------------------------------------------------
1100cdf0e10cSrcweir
GetCustomerNumber() const1101cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetCustomerNumber() const
1102cdf0e10cSrcweir {
1103cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1104cdf0e10cSrcweir return pImp->GetCustomerNumber();
1105cdf0e10cSrcweir }
1106cdf0e10cSrcweir // -----------------------------------------------------------------------
1107cdf0e10cSrcweir
GetFathersName() const1108cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetFathersName() const
1109cdf0e10cSrcweir {
1110cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1111cdf0e10cSrcweir return pImp->GetFathersName() ;
1112cdf0e10cSrcweir }
1113cdf0e10cSrcweir
1114cdf0e10cSrcweir // -----------------------------------------------------------------------
1115cdf0e10cSrcweir
GetApartment() const1116cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetApartment() const
1117cdf0e10cSrcweir {
1118cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1119cdf0e10cSrcweir return pImp->GetApartment();
1120cdf0e10cSrcweir }
1121cdf0e10cSrcweir
1122cdf0e10cSrcweir // -----------------------------------------------------------------------
1123cdf0e10cSrcweir
GetFullName() const1124cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetFullName() const
1125cdf0e10cSrcweir {
1126cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1127cdf0e10cSrcweir return pImp->GetFullName();
1128cdf0e10cSrcweir }
1129cdf0e10cSrcweir
1130cdf0e10cSrcweir // -----------------------------------------------------------------------
1131cdf0e10cSrcweir
GetLocale() const1132cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetLocale() const
1133cdf0e10cSrcweir {
1134cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1135cdf0e10cSrcweir return pImp->GetLocale();
1136cdf0e10cSrcweir }
1137cdf0e10cSrcweir
1138cdf0e10cSrcweir // -----------------------------------------------------------------------
1139cdf0e10cSrcweir
SetCompany(const::rtl::OUString & rNewToken)1140cdf0e10cSrcweir void SvtUserOptions::SetCompany( const ::rtl::OUString& rNewToken )
1141cdf0e10cSrcweir {
1142cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1143cdf0e10cSrcweir pImp->SetCompany( rNewToken );
1144cdf0e10cSrcweir }
1145cdf0e10cSrcweir
1146cdf0e10cSrcweir // -----------------------------------------------------------------------
1147cdf0e10cSrcweir
SetFirstName(const::rtl::OUString & rNewToken)1148cdf0e10cSrcweir void SvtUserOptions::SetFirstName( const ::rtl::OUString& rNewToken )
1149cdf0e10cSrcweir {
1150cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1151cdf0e10cSrcweir pImp->SetFirstName( rNewToken );
1152cdf0e10cSrcweir }
1153cdf0e10cSrcweir
1154cdf0e10cSrcweir // -----------------------------------------------------------------------
1155cdf0e10cSrcweir
SetLastName(const::rtl::OUString & rNewToken)1156cdf0e10cSrcweir void SvtUserOptions::SetLastName( const ::rtl::OUString& rNewToken )
1157cdf0e10cSrcweir {
1158cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1159cdf0e10cSrcweir pImp->SetLastName( rNewToken );
1160cdf0e10cSrcweir }
1161cdf0e10cSrcweir
1162cdf0e10cSrcweir // -----------------------------------------------------------------------
1163cdf0e10cSrcweir
SetID(const::rtl::OUString & rNewToken)1164cdf0e10cSrcweir void SvtUserOptions::SetID( const ::rtl::OUString& rNewToken )
1165cdf0e10cSrcweir {
1166cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1167cdf0e10cSrcweir pImp->SetID( rNewToken );
1168cdf0e10cSrcweir }
1169cdf0e10cSrcweir
1170cdf0e10cSrcweir // -----------------------------------------------------------------------
1171cdf0e10cSrcweir
SetStreet(const::rtl::OUString & rNewToken)1172cdf0e10cSrcweir void SvtUserOptions::SetStreet( const ::rtl::OUString& rNewToken )
1173cdf0e10cSrcweir {
1174cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1175cdf0e10cSrcweir pImp->SetStreet( rNewToken );
1176cdf0e10cSrcweir }
1177cdf0e10cSrcweir
1178cdf0e10cSrcweir // -----------------------------------------------------------------------
1179cdf0e10cSrcweir
SetCity(const::rtl::OUString & rNewToken)1180cdf0e10cSrcweir void SvtUserOptions::SetCity( const ::rtl::OUString& rNewToken )
1181cdf0e10cSrcweir {
1182cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1183cdf0e10cSrcweir pImp->SetCity( rNewToken );
1184cdf0e10cSrcweir }
1185cdf0e10cSrcweir
1186cdf0e10cSrcweir // -----------------------------------------------------------------------
1187cdf0e10cSrcweir
SetState(const::rtl::OUString & rNewToken)1188cdf0e10cSrcweir void SvtUserOptions::SetState( const ::rtl::OUString& rNewToken )
1189cdf0e10cSrcweir {
1190cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1191cdf0e10cSrcweir pImp->SetState( rNewToken );
1192cdf0e10cSrcweir }
1193cdf0e10cSrcweir
1194cdf0e10cSrcweir // -----------------------------------------------------------------------
1195cdf0e10cSrcweir
SetZip(const::rtl::OUString & rNewToken)1196cdf0e10cSrcweir void SvtUserOptions::SetZip( const ::rtl::OUString& rNewToken )
1197cdf0e10cSrcweir {
1198cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1199cdf0e10cSrcweir pImp->SetZip( rNewToken );
1200cdf0e10cSrcweir }
1201cdf0e10cSrcweir
1202cdf0e10cSrcweir // -----------------------------------------------------------------------
1203cdf0e10cSrcweir
SetCountry(const::rtl::OUString & rNewToken)1204cdf0e10cSrcweir void SvtUserOptions::SetCountry( const ::rtl::OUString& rNewToken )
1205cdf0e10cSrcweir {
1206cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1207cdf0e10cSrcweir pImp->SetCountry( rNewToken );
1208cdf0e10cSrcweir }
1209cdf0e10cSrcweir
1210cdf0e10cSrcweir // -----------------------------------------------------------------------
1211cdf0e10cSrcweir
SetPosition(const::rtl::OUString & rNewToken)1212cdf0e10cSrcweir void SvtUserOptions::SetPosition( const ::rtl::OUString& rNewToken )
1213cdf0e10cSrcweir {
1214cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1215cdf0e10cSrcweir pImp->SetPosition( rNewToken );
1216cdf0e10cSrcweir }
1217cdf0e10cSrcweir
1218cdf0e10cSrcweir // -----------------------------------------------------------------------
1219cdf0e10cSrcweir
SetTitle(const::rtl::OUString & rNewToken)1220cdf0e10cSrcweir void SvtUserOptions::SetTitle( const ::rtl::OUString& rNewToken )
1221cdf0e10cSrcweir {
1222cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1223cdf0e10cSrcweir pImp->SetTitle( rNewToken );
1224cdf0e10cSrcweir }
1225cdf0e10cSrcweir
1226cdf0e10cSrcweir // -----------------------------------------------------------------------
1227cdf0e10cSrcweir
SetTelephoneHome(const::rtl::OUString & rNewToken)1228cdf0e10cSrcweir void SvtUserOptions::SetTelephoneHome( const ::rtl::OUString& rNewToken )
1229cdf0e10cSrcweir {
1230cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1231cdf0e10cSrcweir pImp->SetTelephoneHome( rNewToken );
1232cdf0e10cSrcweir }
1233cdf0e10cSrcweir
1234cdf0e10cSrcweir // -----------------------------------------------------------------------
1235cdf0e10cSrcweir
SetTelephoneWork(const::rtl::OUString & rNewToken)1236cdf0e10cSrcweir void SvtUserOptions::SetTelephoneWork( const ::rtl::OUString& rNewToken )
1237cdf0e10cSrcweir {
1238cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1239cdf0e10cSrcweir pImp->SetTelephoneWork( rNewToken );
1240cdf0e10cSrcweir }
1241cdf0e10cSrcweir
1242cdf0e10cSrcweir // -----------------------------------------------------------------------
1243cdf0e10cSrcweir
SetFax(const::rtl::OUString & rNewToken)1244cdf0e10cSrcweir void SvtUserOptions::SetFax( const ::rtl::OUString& rNewToken )
1245cdf0e10cSrcweir {
1246cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1247cdf0e10cSrcweir pImp->SetFax( rNewToken );
1248cdf0e10cSrcweir }
1249cdf0e10cSrcweir
1250cdf0e10cSrcweir // -----------------------------------------------------------------------
1251cdf0e10cSrcweir
SetEmail(const::rtl::OUString & rNewToken)1252cdf0e10cSrcweir void SvtUserOptions::SetEmail( const ::rtl::OUString& rNewToken )
1253cdf0e10cSrcweir {
1254cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1255cdf0e10cSrcweir pImp->SetEmail( rNewToken );
1256cdf0e10cSrcweir }
1257cdf0e10cSrcweir
1258cdf0e10cSrcweir // -----------------------------------------------------------------------
1259cdf0e10cSrcweir
SetCustomerNumber(const::rtl::OUString & rNewToken)1260cdf0e10cSrcweir void SvtUserOptions::SetCustomerNumber( const ::rtl::OUString& rNewToken )
1261cdf0e10cSrcweir {
1262cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1263cdf0e10cSrcweir pImp->SetCustomerNumber( rNewToken );
1264cdf0e10cSrcweir }
1265cdf0e10cSrcweir // -----------------------------------------------------------------------
1266cdf0e10cSrcweir
SetFathersName(const::rtl::OUString & rNewToken)1267cdf0e10cSrcweir void SvtUserOptions::SetFathersName( const ::rtl::OUString& rNewToken )
1268cdf0e10cSrcweir {
1269cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1270cdf0e10cSrcweir pImp->SetFathersName( rNewToken );
1271cdf0e10cSrcweir }
1272cdf0e10cSrcweir
1273cdf0e10cSrcweir // -----------------------------------------------------------------------
1274cdf0e10cSrcweir
SetApartment(const::rtl::OUString & rNewToken)1275cdf0e10cSrcweir void SvtUserOptions::SetApartment( const ::rtl::OUString& rNewToken )
1276cdf0e10cSrcweir {
1277cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1278cdf0e10cSrcweir pImp->SetApartment( rNewToken );
1279cdf0e10cSrcweir }
1280cdf0e10cSrcweir
1281cdf0e10cSrcweir // -----------------------------------------------------------------------
1282cdf0e10cSrcweir
IsTokenReadonly(sal_uInt16 nToken) const1283cdf0e10cSrcweir sal_Bool SvtUserOptions::IsTokenReadonly( sal_uInt16 nToken ) const
1284cdf0e10cSrcweir {
1285cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1286cdf0e10cSrcweir return pImp->IsTokenReadonly( nToken );
1287cdf0e10cSrcweir }
1288cdf0e10cSrcweir //------------------------------------------------------------------------
GetToken(sal_uInt16 nToken) const1289cdf0e10cSrcweir ::rtl::OUString SvtUserOptions::GetToken(sal_uInt16 nToken) const
1290cdf0e10cSrcweir {
1291cdf0e10cSrcweir ::osl::MutexGuard aGuard( GetInitMutex() );
1292cdf0e10cSrcweir return pImp->GetToken( nToken );
1293cdf0e10cSrcweir }
1294