2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-11 09:51:50 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-09-17 13:30:50 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/useroptions.hxx>
|
2008-12-09 11:54:53 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <unotools/configmgr.hxx>
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
2012-01-11 10:02:26 +01:00
|
|
|
#include <tools/solar.h>
|
2010-10-16 03:20:00 -05:00
|
|
|
#include <osl/mutex.hxx>
|
2004-06-25 16:25:36 +00:00
|
|
|
#include <rtl/instance.hxx>
|
2004-11-15 16:24:12 +00:00
|
|
|
#include <rtl/logfile.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include "itemholder1.hxx"
|
2004-11-15 16:24:12 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
#include <com/sun/star/beans/Property.hpp>
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
|
|
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
2009-08-06 12:44:16 +00:00
|
|
|
#include <com/sun/star/util/XChangesListener.hpp>
|
|
|
|
#include <com/sun/star/util/XChangesNotifier.hpp>
|
|
|
|
#include <com/sun/star/util/ChangesEvent.hpp>
|
2008-12-09 11:54:53 +00:00
|
|
|
#include <comphelper/configurationhelper.hxx>
|
2011-11-14 11:49:31 +01:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2008-12-09 11:54:53 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace utl;
|
2009-08-06 12:44:16 +00:00
|
|
|
using namespace com::sun::star;
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace com::sun::star::uno;
|
2011-02-27 18:47:31 +01:00
|
|
|
using ::rtl::OUString;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
namespace css = ::com::sun::star;
|
|
|
|
|
2012-03-28 11:35:55 +01:00
|
|
|
namespace
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
const char s_sData[] = "org.openoffice.UserProfile/Data";
|
|
|
|
const char s_so[] = "o"; // USER_OPT_COMPANY
|
|
|
|
const char s_sgivenname[] = "givenname"; // USER_OPT_FIRSTNAME
|
|
|
|
const char s_ssn[] = "sn"; // USER_OPT_LASTNAME
|
|
|
|
const char s_sinitials[] = "initials"; // USER_OPT_ID
|
|
|
|
const char s_sstreet[] = "street"; // USER_OPT_STREET
|
|
|
|
const char s_sl[] = "l"; // USER_OPT_CITY
|
|
|
|
const char s_sst[] = "st"; // USER_OPT_STATE
|
|
|
|
const char s_spostalcode[] = "postalcode"; // USER_OPT_ZIP
|
|
|
|
const char s_sc[] = "c"; // USER_OPT_COUNTRY
|
|
|
|
const char s_stitle[] = "title"; // USER_OPT_TITLE
|
|
|
|
const char s_sposition[] = "position"; // USER_OPT_POSITION
|
|
|
|
const char s_shomephone[] = "homephone"; // USER_OPT_TELEPHONEHOME
|
|
|
|
const char s_stelephonenumber[] = "telephonenumber"; // USER_OPT_TELEPHONEWORK
|
|
|
|
const char s_sfacsimiletelephonenumber[] = "facsimiletelephonenumber"; // USER_OPT_FAX
|
|
|
|
const char s_smail[] = "mail"; // USER_OPT_EMAIL
|
|
|
|
const char s_scustomernumber[] = "customernumber"; // USER_OPT_CUSTOMERNUMBER
|
|
|
|
const char s_sfathersname[] = "fathersname"; // USER_OPT_FATHERSNAME
|
|
|
|
const char s_sapartment[] = "apartment"; // USER_OPT_APARTMENT
|
2012-03-28 11:35:55 +01:00
|
|
|
}
|
|
|
|
|
2000-09-25 09:00:42 +00:00
|
|
|
// class SvtUserOptions_Impl ---------------------------------------------
|
2009-08-06 12:44:16 +00:00
|
|
|
class SvtUserOptions_Impl;
|
|
|
|
class SvtUserConfigChangeListener_Impl : public cppu::WeakImplHelper1
|
|
|
|
<
|
|
|
|
com::sun::star::util::XChangesListener
|
|
|
|
>
|
|
|
|
{
|
|
|
|
SvtUserOptions_Impl& m_rParent;
|
|
|
|
public:
|
|
|
|
SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl& rParent);
|
|
|
|
~SvtUserConfigChangeListener_Impl();
|
|
|
|
|
|
|
|
//XChangesListener
|
|
|
|
virtual void SAL_CALL changesOccurred( const util::ChangesEvent& Event ) throw(RuntimeException);
|
|
|
|
//XEventListener
|
|
|
|
virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw(RuntimeException);
|
|
|
|
};
|
2000-09-25 09:00:42 +00:00
|
|
|
|
2009-10-06 07:38:24 +02:00
|
|
|
class SvtUserOptions_Impl : public utl::ConfigurationBroadcaster
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SvtUserOptions_Impl();
|
2004-04-29 15:48:13 +00:00
|
|
|
~SvtUserOptions_Impl();
|
2000-09-25 09:00:42 +00:00
|
|
|
|
2003-04-01 13:15:09 +00:00
|
|
|
// get the user token
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString GetCompany() const;
|
|
|
|
::rtl::OUString GetFirstName() const;
|
|
|
|
::rtl::OUString GetLastName() const;
|
|
|
|
::rtl::OUString GetID() const;
|
|
|
|
::rtl::OUString GetStreet() const;
|
|
|
|
::rtl::OUString GetCity() const;
|
|
|
|
::rtl::OUString GetState() const;
|
|
|
|
::rtl::OUString GetZip() const;
|
|
|
|
::rtl::OUString GetCountry() const;
|
|
|
|
::rtl::OUString GetPosition() const;
|
|
|
|
::rtl::OUString GetTitle() const;
|
|
|
|
::rtl::OUString GetTelephoneHome() const;
|
|
|
|
::rtl::OUString GetTelephoneWork() const;
|
|
|
|
::rtl::OUString GetFax() const;
|
|
|
|
::rtl::OUString GetEmail() const;
|
|
|
|
::rtl::OUString GetCustomerNumber() const;
|
|
|
|
::rtl::OUString GetFathersName() const;
|
|
|
|
::rtl::OUString GetApartment() const;
|
|
|
|
|
|
|
|
::rtl::OUString GetFullName() const;
|
2000-09-25 09:00:42 +00:00
|
|
|
|
|
|
|
// set the address token
|
2008-12-09 11:54:53 +00:00
|
|
|
void SetCompany( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetFirstName( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetLastName( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetID( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetStreet( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetCity( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetState( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetZip( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetCountry( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetPosition( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetTitle( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetTelephoneHome( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetTelephoneWork( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetFax( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetEmail( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetCustomerNumber( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetFathersName( const ::rtl::OUString& rNewToken );
|
|
|
|
void SetApartment( const ::rtl::OUString& rNewToken );
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_Bool IsTokenReadonly( sal_uInt16 nToken ) const;
|
|
|
|
::rtl::OUString GetToken(sal_uInt16 nToken) const;
|
2009-08-06 12:44:16 +00:00
|
|
|
void Notify();
|
2008-12-09 11:54:53 +00:00
|
|
|
|
|
|
|
private:
|
2009-08-06 12:44:16 +00:00
|
|
|
uno::Reference< util::XChangesListener > m_xChangeListener;
|
2008-12-09 11:54:53 +00:00
|
|
|
css::uno::Reference< css::container::XNameAccess > m_xCfg;
|
|
|
|
css::uno::Reference< css::beans::XPropertySet > m_xData;
|
2000-09-25 09:00:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// global ----------------------------------------------------------------
|
|
|
|
|
|
|
|
static SvtUserOptions_Impl* pOptions = NULL;
|
|
|
|
static sal_Int32 nRefCount = 0;
|
|
|
|
|
2003-04-01 13:15:09 +00:00
|
|
|
#define READONLY_DEFAULT sal_False
|
|
|
|
|
2009-08-06 12:44:16 +00:00
|
|
|
SvtUserConfigChangeListener_Impl::SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl& rParent) :
|
|
|
|
m_rParent( rParent )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvtUserConfigChangeListener_Impl::~SvtUserConfigChangeListener_Impl()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserConfigChangeListener_Impl::changesOccurred( const util::ChangesEvent& rEvent ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
if(rEvent.Changes.getLength())
|
|
|
|
m_rParent.Notify();
|
|
|
|
}
|
2000-09-25 09:00:42 +00:00
|
|
|
|
2009-08-06 12:44:16 +00:00
|
|
|
void SvtUserConfigChangeListener_Impl::disposing( const lang::EventObject& rSource ) throw(RuntimeException)
|
2004-06-25 16:25:36 +00:00
|
|
|
{
|
2009-08-06 12:44:16 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
uno::Reference< util::XChangesNotifier > xChgNot( rSource.Source, UNO_QUERY_THROW);
|
|
|
|
xChgNot->removeChangesListener(this);
|
|
|
|
}
|
|
|
|
catch(Exception& )
|
|
|
|
{
|
|
|
|
}
|
2004-06-25 16:25:36 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
// class SvtUserOptions_Impl ---------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
2009-08-06 12:44:16 +00:00
|
|
|
SvtUserOptions_Impl::SvtUserOptions_Impl() :
|
|
|
|
m_xChangeListener( new SvtUserConfigChangeListener_Impl(*this) )
|
2008-12-09 11:54:53 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
m_xCfg = Reference< css::container::XNameAccess > (
|
|
|
|
::comphelper::ConfigurationHelper::openConfig(
|
2011-11-14 11:49:31 +01:00
|
|
|
::comphelper::getProcessServiceFactory(),
|
2012-03-28 11:40:49 +01:00
|
|
|
rtl::OUString(s_sData),
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::E_STANDARD),
|
|
|
|
css::uno::UNO_QUERY );
|
|
|
|
|
|
|
|
m_xData = css::uno::Reference< css::beans::XPropertySet >(m_xCfg, css::uno::UNO_QUERY);
|
2009-08-06 12:44:16 +00:00
|
|
|
uno::Reference< util::XChangesNotifier > xChgNot( m_xCfg, UNO_QUERY);
|
|
|
|
try
|
|
|
|
{
|
|
|
|
xChgNot->addChangesListener( m_xChangeListener );
|
|
|
|
}
|
|
|
|
catch(RuntimeException& )
|
|
|
|
{
|
|
|
|
}
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch(const css::uno::Exception& ex)
|
|
|
|
{
|
|
|
|
m_xCfg.clear();
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-25 16:25:36 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
SvtUserOptions_Impl::~SvtUserOptions_Impl()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetCompany() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sCompany;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_so)) >>= sCompany;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
2001-06-21 17:01:26 +00:00
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sCompany;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetFirstName() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sFirstName;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sgivenname)) >>= sFirstName;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sFirstName;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetLastName() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sLastName;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_ssn)) >>= sLastName;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sLastName;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetID() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sID;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sinitials)) >>= sID;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sID;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetStreet() const
|
2000-10-09 05:30:33 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sStreet;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sstreet)) >>= sStreet;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sStreet;
|
2000-10-09 05:30:33 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetCity() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sCity;
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sl)) >>= sCity;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sCity;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetState() const
|
2001-09-28 08:54:56 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sState;
|
|
|
|
|
|
|
|
try
|
2001-09-28 08:54:56 +00:00
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sst)) >>= sState;
|
2001-09-28 08:54:56 +00:00
|
|
|
}
|
2008-12-09 11:54:53 +00:00
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sState;
|
2001-09-28 08:54:56 +00:00
|
|
|
}
|
2004-04-29 15:48:13 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetZip() const
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sZip;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_spostalcode)) >>= sZip;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sZip;
|
2004-04-29 15:48:13 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetCountry() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sCountry;
|
|
|
|
|
|
|
|
try
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sc)) >>= sCountry;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sCountry;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetPosition() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sPosition;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sposition)) >>= sPosition;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2008-12-09 11:54:53 +00:00
|
|
|
|
|
|
|
return sPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetTitle() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sTitle;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_stitle)) >>= sTitle;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sTitle;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetTelephoneHome() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sTelephoneHome;
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_shomephone)) >>= sTelephoneHome;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sTelephoneHome;
|
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetTelephoneWork() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sTelephoneWork;
|
|
|
|
|
|
|
|
try
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_stelephonenumber)) >>= sTelephoneWork;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sTelephoneWork;
|
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetFax() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sFax;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sfacsimiletelephonenumber)) >>= sFax;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
return sFax;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetEmail() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sEmail;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_smail)) >>= sEmail;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sEmail;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetCustomerNumber() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sCustomerNumber;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_scustomernumber)) >>= sCustomerNumber;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sCustomerNumber;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetFathersName() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sFathersName;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sfathersname)) >>= sFathersName;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sFathersName;
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetApartment() const
|
|
|
|
{
|
|
|
|
::rtl::OUString sApartment;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->getPropertyValue(rtl::OUString(s_sapartment)) >>= sApartment;
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex )
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return sApartment;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetCompany( const ::rtl::OUString& sCompany )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_so), css::uno::makeAny(::rtl::OUString(sCompany)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetFirstName( const ::rtl::OUString& sFirstName )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sgivenname), css::uno::makeAny(::rtl::OUString(sFirstName)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetLastName( const ::rtl::OUString& sLastName )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_ssn), css::uno::makeAny(::rtl::OUString(sLastName)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
void SvtUserOptions_Impl::SetID( const ::rtl::OUString& sID )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sinitials), css::uno::makeAny(::rtl::OUString(sID)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions_Impl::SetStreet( const ::rtl::OUString& sStreet )
|
2000-10-09 05:30:33 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sstreet), css::uno::makeAny(::rtl::OUString(sStreet)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetCity( const ::rtl::OUString& sCity )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sl), css::uno::makeAny(::rtl::OUString(sCity)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetState( const ::rtl::OUString& sState )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sst), css::uno::makeAny(::rtl::OUString(sState)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetZip( const ::rtl::OUString& sZip )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_spostalcode), css::uno::makeAny(::rtl::OUString(sZip)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetCountry( const ::rtl::OUString& sCountry )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sc), css::uno::makeAny(::rtl::OUString(sCountry)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetPosition( const ::rtl::OUString& sPosition )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sposition), css::uno::makeAny(::rtl::OUString(sPosition)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetTitle( const ::rtl::OUString& sTitle )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_stitle), css::uno::makeAny(::rtl::OUString(sTitle)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetTelephoneHome( const ::rtl::OUString& sTelephoneHome )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_shomephone), css::uno::makeAny(::rtl::OUString(sTelephoneHome)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetTelephoneWork( const ::rtl::OUString& sTelephoneWork )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_stelephonenumber), css::uno::makeAny(::rtl::OUString(sTelephoneWork)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetFax( const ::rtl::OUString& sFax )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sfacsimiletelephonenumber), css::uno::makeAny(::rtl::OUString(sFax)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetEmail( const ::rtl::OUString& sEmail )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_smail), css::uno::makeAny(::rtl::OUString(sEmail)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetCustomerNumber( const ::rtl::OUString& sCustomerNumber )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_scustomernumber), css::uno::makeAny(::rtl::OUString(sCustomerNumber)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetFathersName( const ::rtl::OUString& sFathersName )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sfathersname), css::uno::makeAny(::rtl::OUString(sFathersName)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvtUserOptions_Impl::SetApartment( const ::rtl::OUString& sApartment )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-01-04 19:07:35 +00:00
|
|
|
if (m_xData.is())
|
2012-03-28 11:40:49 +01:00
|
|
|
m_xData->setPropertyValue(rtl::OUString(s_sapartment), css::uno::makeAny(::rtl::OUString(sApartment)));
|
2008-12-09 11:54:53 +00:00
|
|
|
::comphelper::ConfigurationHelper::flush(m_xCfg);
|
|
|
|
}
|
|
|
|
catch ( const css::uno::Exception& ex)
|
|
|
|
{
|
2012-05-16 09:27:52 +02:00
|
|
|
SAL_WARN("unotools", "Caught unexpected: " << ex.Message);
|
2008-12-09 11:54:53 +00:00
|
|
|
}
|
2000-10-09 05:30:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetFullName() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString sFullName;
|
|
|
|
|
|
|
|
sFullName = GetFirstName();
|
|
|
|
sFullName.trim();
|
2012-01-19 16:01:33 -02:00
|
|
|
if ( !sFullName.isEmpty() )
|
2012-06-02 11:46:36 -05:00
|
|
|
sFullName += ::rtl::OUString(" ");
|
2008-12-09 11:54:53 +00:00
|
|
|
sFullName += GetLastName();
|
|
|
|
sFullName.trim();
|
|
|
|
|
|
|
|
return sFullName;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2003-04-01 13:15:09 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2009-08-06 12:44:16 +00:00
|
|
|
void SvtUserOptions_Impl::Notify()
|
|
|
|
{
|
2009-10-16 00:05:16 +02:00
|
|
|
NotifyListeners(0);
|
2009-08-06 12:44:16 +00:00
|
|
|
}
|
2009-10-06 07:38:24 +02:00
|
|
|
|
2009-08-06 12:44:16 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_Bool SvtUserOptions_Impl::IsTokenReadonly( sal_uInt16 nToken ) const
|
2003-04-01 13:15:09 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
css::uno::Reference< css::beans::XPropertySet > xData(m_xCfg, css::uno::UNO_QUERY);
|
|
|
|
css::uno::Reference< css::beans::XPropertySetInfo > xInfo = xData->getPropertySetInfo();
|
|
|
|
css::beans::Property aProp;
|
|
|
|
sal_Bool bRet = sal_False;
|
2003-04-01 13:15:09 +00:00
|
|
|
|
|
|
|
switch ( nToken )
|
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
case USER_OPT_COMPANY:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_so));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_FIRSTNAME:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sgivenname));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_LASTNAME:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_ssn));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_ID:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sinitials));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_STREET:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sstreet));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_CITY:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sl));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_STATE:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sst));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_ZIP:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_spostalcode));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_COUNTRY:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sc));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_POSITION:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sposition));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_TITLE:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_stitle));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_TELEPHONEHOME:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_shomephone));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_TELEPHONEWORK:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_stelephonenumber));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_FAX:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sfacsimiletelephonenumber));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_EMAIL:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_smail));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_FATHERSNAME:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sfathersname));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case USER_OPT_APARTMENT:
|
|
|
|
{
|
2012-03-28 11:40:49 +01:00
|
|
|
aProp = xInfo->getPropertyByName(rtl::OUString(s_sapartment));
|
2008-12-09 11:54:53 +00:00
|
|
|
bRet = ((aProp.Attributes & css::beans::PropertyAttribute::READONLY) == css::beans::PropertyAttribute::READONLY);
|
|
|
|
break;
|
|
|
|
}
|
2003-04-01 13:15:09 +00:00
|
|
|
default:
|
2012-01-16 18:03:17 +01:00
|
|
|
SAL_WARN( "unotools.config", "SvtUserOptions_Impl::IsTokenReadonly(): invalid token" );
|
2003-04-01 13:15:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2004-04-29 15:48:13 +00:00
|
|
|
//------------------------------------------------------------------------
|
2010-07-29 10:56:19 +08:00
|
|
|
::rtl::OUString SvtUserOptions_Impl::GetToken(sal_uInt16 nToken) const
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString pRet;
|
2004-04-29 15:48:13 +00:00
|
|
|
switch(nToken)
|
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
case USER_OPT_COMPANY: pRet = GetCompany(); break;
|
|
|
|
case USER_OPT_FIRSTNAME: pRet = GetFirstName(); break;
|
|
|
|
case USER_OPT_LASTNAME: pRet = GetLastName(); break;
|
|
|
|
case USER_OPT_ID: pRet = GetID(); break;
|
|
|
|
case USER_OPT_STREET: pRet = GetStreet(); break;
|
|
|
|
case USER_OPT_CITY: pRet = GetCity(); break;
|
|
|
|
case USER_OPT_STATE: pRet = GetState(); break;
|
|
|
|
case USER_OPT_ZIP: pRet = GetZip(); break;
|
|
|
|
case USER_OPT_COUNTRY: pRet = GetCountry(); break;
|
|
|
|
case USER_OPT_POSITION: pRet = GetPosition(); break;
|
|
|
|
case USER_OPT_TITLE: pRet = GetTitle(); break;
|
|
|
|
case USER_OPT_TELEPHONEHOME: pRet = GetTelephoneHome(); break;
|
|
|
|
case USER_OPT_TELEPHONEWORK: pRet = GetTelephoneWork(); break;
|
|
|
|
case USER_OPT_FAX: pRet = GetFax(); break;
|
|
|
|
case USER_OPT_EMAIL: pRet = GetEmail(); break;
|
|
|
|
case USER_OPT_FATHERSNAME: pRet = GetFathersName(); break;
|
|
|
|
case USER_OPT_APARTMENT: pRet = GetApartment(); break;
|
2004-04-29 15:48:13 +00:00
|
|
|
default:
|
2012-01-16 18:03:17 +01:00
|
|
|
SAL_WARN( "unotools.config", "SvtUserOptions_Impl::GetToken(): invalid token" );
|
2004-04-29 15:48:13 +00:00
|
|
|
}
|
2008-12-09 11:54:53 +00:00
|
|
|
return pRet;
|
2004-04-29 15:48:13 +00:00
|
|
|
}
|
|
|
|
|
2000-09-25 09:00:42 +00:00
|
|
|
// class SvtUserOptions --------------------------------------------------
|
|
|
|
|
|
|
|
SvtUserOptions::SvtUserOptions()
|
|
|
|
{
|
|
|
|
// Global access, must be guarded (multithreading)
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
|
2000-09-25 09:00:42 +00:00
|
|
|
if ( !pOptions )
|
2004-11-15 16:24:12 +00:00
|
|
|
{
|
2009-10-06 07:38:24 +02:00
|
|
|
RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtUserOptions_Impl::ctor()");
|
2000-09-25 09:00:42 +00:00
|
|
|
pOptions = new SvtUserOptions_Impl;
|
2004-11-15 16:24:12 +00:00
|
|
|
|
2009-10-06 07:38:24 +02:00
|
|
|
ItemHolder1::holdConfigItem(E_USEROPTIONS);
|
2004-11-15 16:24:12 +00:00
|
|
|
}
|
2000-09-25 09:00:42 +00:00
|
|
|
++nRefCount;
|
|
|
|
pImp = pOptions;
|
2009-10-06 07:38:24 +02:00
|
|
|
pImp->AddListener(this);
|
2000-09-25 09:00:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
SvtUserOptions::~SvtUserOptions()
|
|
|
|
{
|
|
|
|
// Global access, must be guarded (multithreading)
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2009-10-06 07:38:24 +02:00
|
|
|
pImp->RemoveListener(this);
|
2000-09-25 09:00:42 +00:00
|
|
|
if ( !--nRefCount )
|
2000-10-26 11:58:47 +00:00
|
|
|
{
|
2008-12-09 11:54:53 +00:00
|
|
|
//if ( pOptions->IsModified() )
|
|
|
|
// pOptions->Commit();
|
2000-09-25 09:00:42 +00:00
|
|
|
DELETEZ( pOptions );
|
2000-10-26 11:58:47 +00:00
|
|
|
}
|
2000-09-25 09:00:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2011-04-03 21:34:16 +01:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
class theUserOptionsMutex : public rtl::Static<osl::Mutex, theUserOptionsMutex>{};
|
|
|
|
}
|
|
|
|
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::Mutex& SvtUserOptions::GetInitMutex()
|
|
|
|
{
|
2011-04-03 21:34:16 +01:00
|
|
|
return theUserOptionsMutex::get();
|
2003-04-01 13:15:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetCompany() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetCompany();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetFirstName() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetFirstName();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetLastName() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetLastName();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetID() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetID();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetStreet() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetStreet();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetCity() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetCity();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetState() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetState();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetZip() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetZip();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetCountry() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetCountry();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetPosition() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetTitle() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetTelephoneHome() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetTelephoneHome();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetTelephoneWork() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetTelephoneWork();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetFax() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetFax();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetEmail() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetEmail();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetCustomerNumber() const
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
return pImp->GetCustomerNumber();
|
|
|
|
}
|
2004-04-29 15:48:13 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetFathersName() const
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
return pImp->GetFathersName() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetApartment() const
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
return pImp->GetApartment();
|
|
|
|
}
|
2000-09-25 09:00:42 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
::rtl::OUString SvtUserOptions::GetFullName() const
|
2000-10-06 06:51:48 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-10-09 05:30:33 +00:00
|
|
|
return pImp->GetFullName();
|
2000-10-06 06:51:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetCompany( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetCompany( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetFirstName( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetFirstName( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetLastName( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetLastName( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetID( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetID( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetStreet( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetStreet( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetCity( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetCity( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetState( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetState( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetZip( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetZip( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetCountry( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetCountry( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetPosition( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetPosition( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetTitle( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetTitle( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetTelephoneHome( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetTelephoneHome( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetTelephoneWork( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetTelephoneWork( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetFax( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetFax( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetEmail( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetEmail( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetCustomerNumber( const ::rtl::OUString& rNewToken )
|
2000-09-25 09:00:42 +00:00
|
|
|
{
|
2003-04-01 13:15:09 +00:00
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
2000-09-25 09:00:42 +00:00
|
|
|
pImp->SetCustomerNumber( rNewToken );
|
|
|
|
}
|
2004-04-29 15:48:13 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetFathersName( const ::rtl::OUString& rNewToken )
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
pImp->SetFathersName( rNewToken );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-12-09 11:54:53 +00:00
|
|
|
void SvtUserOptions::SetApartment( const ::rtl::OUString& rNewToken )
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
pImp->SetApartment( rNewToken );
|
|
|
|
}
|
2000-09-25 09:00:42 +00:00
|
|
|
|
2003-04-01 13:15:09 +00:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_Bool SvtUserOptions::IsTokenReadonly( sal_uInt16 nToken ) const
|
2003-04-01 13:15:09 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
return pImp->IsTokenReadonly( nToken );
|
|
|
|
}
|
2004-04-29 15:48:13 +00:00
|
|
|
//------------------------------------------------------------------------
|
2010-07-29 10:56:19 +08:00
|
|
|
::rtl::OUString SvtUserOptions::GetToken(sal_uInt16 nToken) const
|
2004-04-29 15:48:13 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( GetInitMutex() );
|
|
|
|
return pImp->GetToken( nToken );
|
|
|
|
}
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|