From f74002df591f62452ef9181068cda76e355f75e7 Mon Sep 17 00:00:00 2001
From: Thomas Lange
Date: Mon, 13 Jul 2009 11:08:01 +0000
Subject: #i1601# sentence case transliteration
---
unotools/source/i18n/transliterationwrapper.cxx | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
(limited to 'unotools')
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index bd33e447471f..70d37ad54f6a 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -34,11 +34,10 @@
#include
#include
#include
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include
-#endif
#include
#include
+#include
#define TRANSLIT_LIBRARYNAME "i18n"
#define TRANSLIT_SERVICENAME "com.sun.star.i18n.Transliteration"
@@ -168,14 +167,22 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang )
sal_Bool bLoad = bFirstCall;
bFirstCall = sal_False;
- if( nLanguage != nLang )
+ if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::SENTENCE_CASE )
{
- setLanguageLocaleImpl( nLang );
- if( !bLoad )
- bLoad = needLanguageForTheMode();
+ if( bLoad )
+ loadModuleByImplName(String::CreateFromAscii("SENTENCE_CASE"), nLang);
+ }
+ else
+ {
+ if( nLanguage != nLang )
+ {
+ setLanguageLocaleImpl( nLang );
+ if( !bLoad )
+ bLoad = needLanguageForTheMode();
+ }
+ if( bLoad )
+ loadModuleImpl();
}
- if( bLoad )
- loadModuleImpl();
}
--
cgit
From 104e585e3db2e7a77e1de237ea68abaf38a44600 Mon Sep 17 00:00:00 2001
From: Thomas Lange
Date: Mon, 13 Jul 2009 12:48:12 +0000
Subject: undoing r273933 which was accidently commited on master m51
---
unotools/source/i18n/transliterationwrapper.cxx | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
(limited to 'unotools')
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index 70d37ad54f6a..bd33e447471f 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -34,10 +34,11 @@
#include
#include
#include
+#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include
+#endif
#include
#include
-#include
#define TRANSLIT_LIBRARYNAME "i18n"
#define TRANSLIT_SERVICENAME "com.sun.star.i18n.Transliteration"
@@ -167,22 +168,14 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang )
sal_Bool bLoad = bFirstCall;
bFirstCall = sal_False;
- if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::SENTENCE_CASE )
- {
- if( bLoad )
- loadModuleByImplName(String::CreateFromAscii("SENTENCE_CASE"), nLang);
- }
- else
+ if( nLanguage != nLang )
{
- if( nLanguage != nLang )
- {
- setLanguageLocaleImpl( nLang );
- if( !bLoad )
- bLoad = needLanguageForTheMode();
- }
- if( bLoad )
- loadModuleImpl();
+ setLanguageLocaleImpl( nLang );
+ if( !bLoad )
+ bLoad = needLanguageForTheMode();
}
+ if( bLoad )
+ loadModuleImpl();
}
--
cgit
From aa611d78df11fcc1e35ead5fa093143bf17e4cf6 Mon Sep 17 00:00:00 2001
From: Mathias Bauer
Date: Fri, 10 Jul 2009 14:03:42 +0200
Subject: #i103452#: replace PRODUCT by !DBG_UTIL; replace assert by OSL_ASSERT
where possible
---
unotools/source/i18n/calendarwrapper.cxx | 52 ++++++++++++-------------
unotools/source/i18n/charclass.cxx | 4 +-
unotools/source/i18n/localedatawrapper.cxx | 2 +-
unotools/source/i18n/transliterationwrapper.cxx | 10 ++---
unotools/source/property/propertysetinfo.cxx | 2 +-
5 files changed, 35 insertions(+), 35 deletions(-)
(limited to 'unotools')
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index 1d83761b5cea..b56175af7e41 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -71,7 +71,7 @@ CalendarWrapper::CalendarWrapper(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "CalendarWrapper ctor: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -96,7 +96,7 @@ CalendarWrapper::CalendarWrapper(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getComponentInstance: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -122,7 +122,7 @@ void CalendarWrapper::loadDefaultCalendar( const ::com::sun::star::lang::Locale&
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "loadDefaultCalendar: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -142,7 +142,7 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "loadCalendar: Exception caught\nrequested: " );
aMsg += ByteString( String( rUniqueID ), RTL_TEXTENCODING_UTF8 );
aMsg += " Locale: ";
@@ -167,7 +167,7 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getLoadedCalendar: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -188,7 +188,7 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getAllCalendars: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -209,7 +209,7 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getUniqueID: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -230,7 +230,7 @@ void CalendarWrapper::setDateTime( double nTimeInDays )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setDateTime: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -250,7 +250,7 @@ double CalendarWrapper::getDateTime() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getDateTime: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -280,7 +280,7 @@ sal_Int32 CalendarWrapper::getCombinedOffsetInMillis(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setLocalDateTime: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -352,7 +352,7 @@ void CalendarWrapper::setLocalDateTime( double nTimeInDays )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setLocalDateTime: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -378,7 +378,7 @@ double CalendarWrapper::getLocalDateTime() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getLocalDateTime: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -399,7 +399,7 @@ void CalendarWrapper::setValue( sal_Int16 nFieldIndex, sal_Int16 nValue )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setValue: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -419,7 +419,7 @@ sal_Bool CalendarWrapper::isValid() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "isValid: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -440,7 +440,7 @@ sal_Int16 CalendarWrapper::getValue( sal_Int16 nFieldIndex ) const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getValue: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -461,7 +461,7 @@ void CalendarWrapper::addValue( sal_Int16 nFieldIndex, sal_Int32 nAmount )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "addValue: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -481,7 +481,7 @@ sal_Int16 CalendarWrapper::getFirstDayOfWeek() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getFirstDayOfWeek: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -502,7 +502,7 @@ void CalendarWrapper::setFirstDayOfWeek( sal_Int16 nDay )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setFirstDayOfWeek: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -522,7 +522,7 @@ void CalendarWrapper::setMinimumNumberOfDaysForFirstWeek( sal_Int16 nDays )
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "setMinimumNumberOfDaysForFirstWeek: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -542,7 +542,7 @@ sal_Int16 CalendarWrapper::getMinimumNumberOfDaysForFirstWeek() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getMinimumNumberOfDaysForFirstWeek: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -563,7 +563,7 @@ sal_Int16 CalendarWrapper::getNumberOfMonthsInYear() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getNumberOfMonthsInYear: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -584,7 +584,7 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getNumberOfDaysInWeek: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -605,7 +605,7 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getMonths: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -626,7 +626,7 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getDays: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -647,7 +647,7 @@ String CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getDisplayName: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -670,7 +670,7 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "getDisplayString: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index c1b6b4bc155c..5b411d1bb519 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -538,7 +538,7 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "parseAnyToken: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -570,7 +570,7 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "parsePredefinedToken: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 074ff7af716a..fa70cc3dda81 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1991,7 +1991,7 @@ void LocaleDataWrapper::evaluateLocaleDataChecking()
nCheck = nLocaleDataChecking;
if (!nCheck)
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
nCheck = 1;
#else
const char* pEnv = getenv( "OOO_ENABLE_LOCALE_DATA_CHECKS");
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index bd33e447471f..7647a6abc345 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -191,7 +191,7 @@ void TransliterationWrapper::loadModuleImpl() const
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "loadModuleImpl: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -218,7 +218,7 @@ void TransliterationWrapper::loadModuleByImplName(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "loadModuleByImplName: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -244,7 +244,7 @@ sal_Bool TransliterationWrapper::equals(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "equals: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -269,7 +269,7 @@ sal_Int32 TransliterationWrapper::compareSubstring(
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "compareSubstring: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -292,7 +292,7 @@ sal_Int32 TransliterationWrapper::compareString( const String& rStr1, const Stri
}
catch ( Exception& e )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
ByteString aMsg( "compareString: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
diff --git a/unotools/source/property/propertysetinfo.cxx b/unotools/source/property/propertysetinfo.cxx
index b8b5f8bb5125..ced5ae10a9d7 100644
--- a/unotools/source/property/propertysetinfo.cxx
+++ b/unotools/source/property/propertysetinfo.cxx
@@ -79,7 +79,7 @@ void PropertyMapImpl::add( PropertyMapEntry* pMap ) throw()
{
OUString aName( pMap->mpName, pMap->mnNameLen, RTL_TEXTENCODING_ASCII_US );
-#ifndef PRODUCT
+#ifdef DBG_UTIL
PropertyMap::iterator aIter = maPropertyMap.find( aName );
if( aIter != maPropertyMap.end() )
{
--
cgit
From f87ee64d502aec9365d98d53d5b913f6456eae6b Mon Sep 17 00:00:00 2001
From: Mathias Bauer
Date: Tue, 6 Oct 2009 07:38:24 +0200
Subject: #103496#: move VCL free ConfigItems to unotools
---
unotools/inc/unotools/accelcfg.hxx | 88 +
unotools/inc/unotools/cacheoptions.hxx | 176 ++
unotools/inc/unotools/cmdoptions.hxx | 258 +++
unotools/inc/unotools/compatibility.hxx | 256 +++
unotools/inc/unotools/configitem.hxx | 4 +-
unotools/inc/unotools/defaultoptions.hxx | 57 +
unotools/inc/unotools/dynamicmenuoptions.hxx | 222 +++
unotools/inc/unotools/eventcfg.hxx | 125 ++
unotools/inc/unotools/extendedsecurityoptions.hxx | 163 ++
unotools/inc/unotools/fltrcfg.hxx | 103 ++
unotools/inc/unotools/fontoptions.hxx | 176 ++
unotools/inc/unotools/historyoptions.hxx | 251 +++
unotools/inc/unotools/historyoptions_const.hxx | 63 +
unotools/inc/unotools/inetoptions.hxx | 146 ++
unotools/inc/unotools/internaloptions.hxx | 183 +++
unotools/inc/unotools/itemholderbase.hxx | 131 ++
unotools/inc/unotools/javaoptions.hxx | 76 +
unotools/inc/unotools/lingucfg.hxx | 244 +++
unotools/inc/unotools/linguprops.hxx | 124 ++
unotools/inc/unotools/localisationoptions.hxx | 181 +++
unotools/inc/unotools/loghelper.hxx | 59 +
unotools/inc/unotools/moduleoptions.hxx | 260 +++
unotools/inc/unotools/options.hxx | 79 +
unotools/inc/unotools/optionsdlg.hxx | 59 +
unotools/inc/unotools/pathoptions.hxx | 143 ++
unotools/inc/unotools/printwarningoptions.hxx | 164 ++
unotools/inc/unotools/regoptions.hxx | 129 ++
unotools/inc/unotools/saveopt.hxx | 133 ++
unotools/inc/unotools/searchopt.hxx | 122 ++
unotools/inc/unotools/securityoptions.hxx | 299 ++++
unotools/inc/unotools/sourceviewconfig.hxx | 66 +
unotools/inc/unotools/startoptions.hxx | 173 ++
unotools/inc/unotools/undoopt.hxx | 52 +
unotools/inc/unotools/useroptions.hxx | 121 ++
unotools/inc/unotools/useroptions_const.hxx | 64 +
unotools/inc/unotools/viewoptions.hxx | 356 ++++
unotools/inc/unotools/workingsetoptions.hxx | 159 ++
unotools/inc/unotools/xmlaccelcfg.hxx | 112 ++
unotools/source/config/accelcfg.cxx | 292 ++++
unotools/source/config/cacheoptions.cxx | 510 ++++++
unotools/source/config/cmdoptions.cxx | 631 ++++++++
unotools/source/config/compatibility.cxx | 807 +++++++++
unotools/source/config/configitem.cxx | 35 +-
unotools/source/config/defaultoptions.cxx | 354 ++++
unotools/source/config/dynamicmenuoptions.cxx | 923 +++++++++++
unotools/source/config/eventcfg.cxx | 458 ++++++
unotools/source/config/extendedsecurityoptions.cxx | 541 +++++++
unotools/source/config/fltrcfg.cxx | 611 +++++++
unotools/source/config/fontoptions.cxx | 514 ++++++
unotools/source/config/historyoptions.cxx | 748 +++++++++
unotools/source/config/inetoptions.cxx | 557 +++++++
unotools/source/config/internaloptions.cxx | 631 ++++++++
unotools/source/config/itemholder1.cxx | 326 ++++
unotools/source/config/itemholder1.hxx | 92 ++
unotools/source/config/javaoptions.cxx | 367 +++++
unotools/source/config/lingucfg.cxx | 1450 +++++++++++++++++
unotools/source/config/localisationoptions.cxx | 459 ++++++
unotools/source/config/makefile.mk | 37 +-
unotools/source/config/menuoptions.cxx | 564 +++++++
unotools/source/config/moduleoptions.cxx | 1600 ++++++++++++++++++
unotools/source/config/options.cxx | 88 +
unotools/source/config/optionsdlg.cxx | 293 ++++
unotools/source/config/optionsdrawinglayer.cxx | 1708 ++++++++++++++++++++
unotools/source/config/pathoptions.cxx | 1094 +++++++++++++
unotools/source/config/printwarningoptions.cxx | 419 +++++
unotools/source/config/regoptions.cxx | 554 +++++++
unotools/source/config/saveopt.cxx | 1047 ++++++++++++
unotools/source/config/searchopt.cxx | 634 ++++++++
unotools/source/config/securityoptions.cxx | 1312 +++++++++++++++
unotools/source/config/sourceviewconfig.cxx | 271 ++++
unotools/source/config/startoptions.cxx | 461 ++++++
unotools/source/config/undoopt.cxx | 208 +++
unotools/source/config/useroptions.cxx | 1304 +++++++++++++++
unotools/source/config/viewoptions.cxx | 1304 +++++++++++++++
unotools/source/config/workingsetoptions.cxx | 396 +++++
unotools/source/config/xmlaccelcfg.cxx | 418 +++++
76 files changed, 29584 insertions(+), 11 deletions(-)
create mode 100644 unotools/inc/unotools/accelcfg.hxx
create mode 100644 unotools/inc/unotools/cacheoptions.hxx
create mode 100644 unotools/inc/unotools/cmdoptions.hxx
create mode 100644 unotools/inc/unotools/compatibility.hxx
create mode 100644 unotools/inc/unotools/defaultoptions.hxx
create mode 100644 unotools/inc/unotools/dynamicmenuoptions.hxx
create mode 100644 unotools/inc/unotools/eventcfg.hxx
create mode 100644 unotools/inc/unotools/extendedsecurityoptions.hxx
create mode 100644 unotools/inc/unotools/fltrcfg.hxx
create mode 100644 unotools/inc/unotools/fontoptions.hxx
create mode 100644 unotools/inc/unotools/historyoptions.hxx
create mode 100644 unotools/inc/unotools/historyoptions_const.hxx
create mode 100644 unotools/inc/unotools/inetoptions.hxx
create mode 100644 unotools/inc/unotools/internaloptions.hxx
create mode 100644 unotools/inc/unotools/itemholderbase.hxx
create mode 100644 unotools/inc/unotools/javaoptions.hxx
create mode 100644 unotools/inc/unotools/lingucfg.hxx
create mode 100644 unotools/inc/unotools/linguprops.hxx
create mode 100644 unotools/inc/unotools/localisationoptions.hxx
create mode 100644 unotools/inc/unotools/loghelper.hxx
create mode 100644 unotools/inc/unotools/moduleoptions.hxx
create mode 100644 unotools/inc/unotools/options.hxx
create mode 100644 unotools/inc/unotools/optionsdlg.hxx
create mode 100644 unotools/inc/unotools/pathoptions.hxx
create mode 100644 unotools/inc/unotools/printwarningoptions.hxx
create mode 100644 unotools/inc/unotools/regoptions.hxx
create mode 100644 unotools/inc/unotools/saveopt.hxx
create mode 100644 unotools/inc/unotools/searchopt.hxx
create mode 100644 unotools/inc/unotools/securityoptions.hxx
create mode 100644 unotools/inc/unotools/sourceviewconfig.hxx
create mode 100644 unotools/inc/unotools/startoptions.hxx
create mode 100644 unotools/inc/unotools/undoopt.hxx
create mode 100644 unotools/inc/unotools/useroptions.hxx
create mode 100644 unotools/inc/unotools/useroptions_const.hxx
create mode 100644 unotools/inc/unotools/viewoptions.hxx
create mode 100644 unotools/inc/unotools/workingsetoptions.hxx
create mode 100644 unotools/inc/unotools/xmlaccelcfg.hxx
create mode 100644 unotools/source/config/accelcfg.cxx
create mode 100644 unotools/source/config/cacheoptions.cxx
create mode 100644 unotools/source/config/cmdoptions.cxx
create mode 100644 unotools/source/config/compatibility.cxx
create mode 100644 unotools/source/config/defaultoptions.cxx
create mode 100644 unotools/source/config/dynamicmenuoptions.cxx
create mode 100644 unotools/source/config/eventcfg.cxx
create mode 100644 unotools/source/config/extendedsecurityoptions.cxx
create mode 100644 unotools/source/config/fltrcfg.cxx
create mode 100644 unotools/source/config/fontoptions.cxx
create mode 100644 unotools/source/config/historyoptions.cxx
create mode 100644 unotools/source/config/inetoptions.cxx
create mode 100644 unotools/source/config/internaloptions.cxx
create mode 100644 unotools/source/config/itemholder1.cxx
create mode 100644 unotools/source/config/itemholder1.hxx
create mode 100644 unotools/source/config/javaoptions.cxx
create mode 100644 unotools/source/config/lingucfg.cxx
create mode 100644 unotools/source/config/localisationoptions.cxx
create mode 100644 unotools/source/config/menuoptions.cxx
create mode 100644 unotools/source/config/moduleoptions.cxx
create mode 100644 unotools/source/config/options.cxx
create mode 100644 unotools/source/config/optionsdlg.cxx
create mode 100644 unotools/source/config/optionsdrawinglayer.cxx
create mode 100644 unotools/source/config/pathoptions.cxx
create mode 100644 unotools/source/config/printwarningoptions.cxx
create mode 100644 unotools/source/config/regoptions.cxx
create mode 100644 unotools/source/config/saveopt.cxx
create mode 100644 unotools/source/config/searchopt.cxx
create mode 100644 unotools/source/config/securityoptions.cxx
create mode 100644 unotools/source/config/sourceviewconfig.cxx
create mode 100644 unotools/source/config/startoptions.cxx
create mode 100644 unotools/source/config/undoopt.cxx
create mode 100644 unotools/source/config/useroptions.cxx
create mode 100644 unotools/source/config/viewoptions.cxx
create mode 100644 unotools/source/config/workingsetoptions.cxx
create mode 100644 unotools/source/config/xmlaccelcfg.cxx
(limited to 'unotools')
diff --git a/unotools/inc/unotools/accelcfg.hxx b/unotools/inc/unotools/accelcfg.hxx
new file mode 100644
index 000000000000..70a0d26545f5
--- /dev/null
+++ b/unotools/inc/unotools/accelcfg.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: accelcfg.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_ACCELCFG_HXX
+#define INCLUDED_unotools_ACCELCFG_HXX
+
+#include
+#include
+
+#include
+#include
+
+struct SvtAcceleratorConfigItem
+{
+ sal_uInt16 nCode;
+ sal_uInt16 nModifier;
+ ::rtl::OUString aCommand;
+};
+
+#include
+typedef ::std::list < SvtAcceleratorConfigItem > SvtAcceleratorItemList;
+
+class SvStream;
+class KeyEvent;
+class String;
+class SvtAcceleratorConfig_Impl;
+
+class SvtAcceleratorConfiguration: public utl::detail::Options
+{
+ SvtAcceleratorConfig_Impl* pImp;
+
+private:
+
+public:
+ // get the global accelerators
+ SvtAcceleratorConfiguration();
+
+ // get special accelerators
+ static SvtAcceleratorConfiguration* CreateFromStream( SvStream& rStream );
+ static String GetStreamName();
+ static SvStream* GetDefaultStream( StreamMode );
+
+ virtual ~SvtAcceleratorConfiguration();
+
+ // save the configuration to a stream, f.e. into a document
+ bool Commit( SvStream& rStream );
+
+ // returns the configured URL for a KeyEvent
+ ::rtl::OUString GetCommand( const ::com::sun::star::awt::KeyEvent& rKeyEvent );
+
+ // returns the whole configuration
+ const SvtAcceleratorItemList& GetItems();
+
+ // sets a single configuration item
+ void SetCommand( const SvtAcceleratorConfigItem& rItem );
+
+ // sets several or all configuration items
+ // if bClear=FALSE, all items not in the sequence remain unchanged
+ void SetItems( const SvtAcceleratorItemList& rItems, bool bClear );
+};
+
+#endif
diff --git a/unotools/inc/unotools/cacheoptions.hxx b/unotools/inc/unotools/cacheoptions.hxx
new file mode 100644
index 000000000000..a9adf9a14467
--- /dev/null
+++ b/unotools/inc/unotools/cacheoptions.hxx
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cacheoptions.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_unotools_CACHEOPTIONS_HXX
+#define INCLUDED_unotools_CACHEOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtCacheOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtCacheOptions
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtCacheOptions();
+ ~SvtCacheOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/_3D-Engine/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ GetWriterOLE_Objects()
+ SetWriterOLE_Objects() => set the number of Writer OLE objects to be cached
+
+ GetDrawingEngineOLE_Objects()
+ SetDrawingEngineOLE_Objects() => set the number of DrawingEngine OLE objects to be cached
+
+ GetGraphicManagerTotalCacheSize()
+ SetGraphicManagerTotalCacheSize() => set the maximum cache size used by GraphicManager to cache graphic objects
+
+ GetGraphicManagerObjectCacheSize()
+ SetGraphicManagerObjectCacheSize() => set the maximum cache size for one GraphicObject to be cached by GraphicManager
+
+ @seealso configuration package "org.openoffice.Office.Common/_3D-Engine"
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetWriterOLE_Objects() const;
+ sal_Int32 GetDrawingEngineOLE_Objects() const;
+ sal_Int32 GetGraphicManagerTotalCacheSize() const;
+ sal_Int32 GetGraphicManagerObjectCacheSize() const;
+ sal_Int32 GetGraphicManagerObjectReleaseTime() const;
+
+ void SetWriterOLE_Objects( sal_Int32 nObjects );
+ void SetDrawingEngineOLE_Objects( sal_Int32 nObjects );
+ void SetGraphicManagerTotalCacheSize( sal_Int32 nTotalCacheSize );
+ void SetGraphicManagerObjectCacheSize( sal_Int32 nObjectCacheSize );
+ void SetGraphicManagerObjectReleaseTime( sal_Int32 nReleaseTimeSeconds );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtCacheOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+};
+
+#endif // #ifndef INCLUDED_unotools_CACHEOPTIONS_HXX
diff --git a/unotools/inc/unotools/cmdoptions.hxx b/unotools/inc/unotools/cmdoptions.hxx
new file mode 100644
index 000000000000..85d8a0725f3c
--- /dev/null
+++ b/unotools/inc/unotools/cmdoptions.hxx
@@ -0,0 +1,258 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cmdoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_CMDOPTIONS_HXX
+#define INCLUDED_unotools_CMDOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define CMDOPTIONS_PROPERTYNAME_URL ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CommandURL" ))
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtCommandOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtCommandOptions: public utl::detail::Options
+{
+ friend class SvtCommandOptions_Impl;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ enum CmdOption
+ {
+ CMDOPTION_DISABLED,
+ CMDOPTION_NONE
+ };
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtCommandOptions();
+ virtual ~SvtCommandOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short clear complete sepcified list
+ @descr Call this methods to clear the whole list.
+ To fill it again use AppendItem().
+
+ @seealso -
+
+ @param "eMenu" select right menu to clear.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear( CmdOption eOption );
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of an dynamic menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @param "eOption" select the list to retrieve.
+ @return A list of command strings is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool HasEntries( CmdOption eOption ) const;
+
+ /*-****************************************************************************************************//**
+ @short Lookup if a command URL is inside a given list
+ @descr Lookup if a command URL is inside a given lst
+
+ @seealso -
+
+ @param "eOption" select right command list
+ @param "aCommandURL" a command URL that is used for the look up
+ @return "sal_True" if the command is inside the list otherwise "sal_False"
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Lookup( CmdOption eOption, const ::rtl::OUString& aCommandURL ) const;
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of an dynamic menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @param "eOption" select the list to retrieve.
+ @return A list of command strings is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > GetList( CmdOption eOption ) const;
+
+ /*-****************************************************************************************************//**
+ @short adds a new command to specified options list
+ @descr You can add a command to specified options list!
+
+ @seealso method Clear()
+
+ @param "eOption" specifies the command list
+ @param "sURL" URL for dispatch
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AddCommand( CmdOption eOption, const ::rtl::OUString& sURL );
+
+ /*-****************************************************************************************************//**
+ @short register an office frame, which must update its dispatches if
+ the underlying configuration was changed.
+
+ @descr To avoid using of "dead" frame objects or implementing
+ deregistration mechanism too, we use weak references to
+ the given frames.
+
+ @param "xFrame" points to the frame, which wish to be
+ notified, if configuration was changed.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void EstablisFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtCommandOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtCmdOptions
+
+#endif // #ifndef INCLUDED_unotools_CMDOPTIONS_HXX
diff --git a/unotools/inc/unotools/compatibility.hxx b/unotools/inc/unotools/compatibility.hxx
new file mode 100644
index 000000000000..0c7c41882c09
--- /dev/null
+++ b/unotools/inc/unotools/compatibility.hxx
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: compatibility.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_COMPATIBILITY_HXX
+#define INCLUDED_unotools_COMPATIBILITY_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+enum CompatibilityOptions
+{
+ COPT_USE_PRINTERDEVICE = 0,
+ COPT_ADD_SPACING,
+ COPT_ADD_SPACING_AT_PAGES,
+ COPT_USE_OUR_TABSTOPS,
+ COPT_NO_EXTLEADING,
+ COPT_USE_LINESPACING,
+ COPT_ADD_TABLESPACING,
+ COPT_USE_OBJECTPOSITIONING,
+ COPT_USE_OUR_TEXTWRAPPING,
+ COPT_CONSIDER_WRAPPINGSTYLE,
+ COPT_EXPAND_WORDSPACE
+};
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define COMPATIBILITY_PROPERTYNAME_NAME OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
+#define COMPATIBILITY_PROPERTYNAME_MODULE OUString( RTL_CONSTASCII_USTRINGPARAM( "Module" ) )
+#define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePrinterMetrics" ) )
+#define COMPATIBILITY_PROPERTYNAME_ADDSPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "AddSpacing" ) )
+#define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES OUString( RTL_CONSTASCII_USTRINGPARAM( "AddSpacingAtPages" ) )
+#define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOurTabStopFormat" ) )
+#define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING OUString( RTL_CONSTASCII_USTRINGPARAM( "NoExternalLeading" ) )
+#define COMPATIBILITY_PROPERTYNAME_USELINESPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLineSpacing" ) )
+#define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "AddTableSpacing" ) )
+#define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseObjectPositioning" ) )
+#define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOurTextWrapping" ) )
+#define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE OUString( RTL_CONSTASCII_USTRINGPARAM( "ConsiderWrappingStyle" ) )
+#define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE OUString( RTL_CONSTASCII_USTRINGPARAM( "ExpandWordSpace" ) )
+
+#define COMPATIBILITY_DEFAULT_NAME OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) )
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtCompatibilityOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtCompatibilityOptions();
+ virtual ~SvtCompatibilityOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short clear complete specified list
+ @descr Call this methods to clear the whole list.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear();
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of compatibility options.
+ We return a list of all nodes with its names and properties.
+
+ @seealso -
+
+ @param -
+ @return A list of compatibility options is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetList() const;
+
+ /*-****************************************************************************************************//**
+ @short append a new item
+ @descr
+
+ @seealso method Clear()
+
+ @param "sName" Name
+ @param "sModule" Module
+
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AppendItem( const ::rtl::OUString& sName,
+ const ::rtl::OUString& sModule,
+ bool bUsePrtMetrics,
+ bool bAddSpacing,
+ bool bAddSpacingAtPages,
+ bool bUseOurTabStops,
+ bool bNoExtLeading,
+ bool bUseLineSpacing,
+ bool bAddTableSpacing,
+ bool bUseObjectPositioning,
+ bool bUseOurTextWrapping,
+ bool bConsiderWrappingStyle,
+ bool bExpandWordSpace );
+
+ bool IsUsePrtDevice() const;
+ bool IsAddSpacing() const;
+ bool IsAddSpacingAtPages() const;
+ bool IsUseOurTabStops() const;
+ bool IsNoExtLeading() const;
+ bool IsUseLineSpacing() const;
+ bool IsAddTableSpacing() const;
+ bool IsUseObjectPositioning() const;
+ bool IsUseOurTextWrapping() const;
+ bool IsConsiderWrappingStyle() const;
+ bool IsExpandWordSpace() const;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtCompatibilityOptions_Impl* m_pDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtCompatibilityOptions
+
+#endif // #ifndef INCLUDED_unotools_COMPATIBILITY_HXX
+
diff --git a/unotools/inc/unotools/configitem.hxx b/unotools/inc/unotools/configitem.hxx
index f3b9db2da452..2af7a089bb54 100644
--- a/unotools/inc/unotools/configitem.hxx
+++ b/unotools/inc/unotools/configitem.hxx
@@ -36,6 +36,7 @@
#include
#include
#include "unotools/unotoolsdllapi.h"
+#include "unotools/options.hxx"
//-----------------------------------------------------------------------------
namespace com{ namespace sun{ namespace star{
@@ -76,7 +77,7 @@ namespace utl
class ConfigManager;
struct ConfigItem_Impl;
- class UNOTOOLS_DLLPUBLIC ConfigItem
+ class UNOTOOLS_DLLPUBLIC ConfigItem : public ConfigurationBroadcaster
{
friend class ConfigChangeListener_Impl;
friend class ConfigManager;
@@ -87,6 +88,7 @@ namespace utl
com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
xChangeLstnr;
ConfigItem_Impl* pImpl;
+ IMPL_ConfigurationListenerList* mpList;
ConfigItem();//
void RemoveChangesListener();
diff --git a/unotools/inc/unotools/defaultoptions.hxx b/unotools/inc/unotools/defaultoptions.hxx
new file mode 100644
index 000000000000..603d7fd6d22a
--- /dev/null
+++ b/unotools/inc/unotools/defaultoptions.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: defaultoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
+#define INCLUDED_unotools_DEFAULTOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include "tools/solar.h"
+#include
+
+class String;
+class SvtDefaultOptions_Impl;
+
+// class SvtDefaultOptions -----------------------------------------------
+
+class SvtDefaultOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtDefaultOptions: public utl::detail::Options
+{
+private:
+ SvtDefaultOptions_Impl* pImp;
+
+public:
+
+ SvtDefaultOptions();
+ virtual ~SvtDefaultOptions();
+
+ String GetDefaultPath( USHORT nId ) const;
+};
+
+#endif // #ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
+
diff --git a/unotools/inc/unotools/dynamicmenuoptions.hxx b/unotools/inc/unotools/dynamicmenuoptions.hxx
new file mode 100644
index 000000000000..2841970c5a84
--- /dev/null
+++ b/unotools/inc/unotools/dynamicmenuoptions.hxx
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dynamicmenuoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
+#define INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define DYNAMICMENU_PROPERTYNAME_URL ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL" ))
+#define DYNAMICMENU_PROPERTYNAME_TITLE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" ))
+#define DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageIdentifier" ))
+#define DYNAMICMENU_PROPERTYNAME_TARGETNAME ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TargetName" ))
+
+/*-************************************************************************************************************//**
+ @descr You can use these enum values to specify right menu if you call our interface methods.
+*//*-*************************************************************************************************************/
+enum EDynamicMenuType
+{
+ E_NEWMENU = 0,
+ E_WIZARDMENU = 1,
+ E_HELPBOOKMARKS = 2
+};
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtDynamicMenuOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtDynamicMenuOptions();
+ virtual ~SvtDynamicMenuOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short clear complete sepcified list
+ @descr Call this methods to clear the whole list.
+ To fill it again use AppendItem().
+
+ @seealso -
+
+ @param "eMenu" select right menu to clear.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear( EDynamicMenuType eMenu );
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of an dynamic menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @param "eMenu" select right menu.
+ @return A list of menu items is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetMenu( EDynamicMenuType eMenu ) const;
+
+ /*-****************************************************************************************************//**
+ @short append a new item to specified menu
+ @descr You can append items to a menu only - removing isn't allowed for a special item!
+ We support a nothing or all mechanism only! Clear all or append something ...
+
+ @seealso method Clear()
+
+ @param "eMenu" select right menu.
+ @param "sURL" URL for dispatch
+ @param "sTitle" label of menu entry
+ @param "sImageIdentifier" icon identifier
+ @param "sTargetName" target for dispatch
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AppendItem( EDynamicMenuType eMenu ,
+ const ::rtl::OUString& sURL ,
+ const ::rtl::OUString& sTitle ,
+ const ::rtl::OUString& sImageIdentifier ,
+ const ::rtl::OUString& sTargetName );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtDynamicMenuOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtDynamicMenuOptions
+
+#endif // #ifndef INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
diff --git a/unotools/inc/unotools/eventcfg.hxx b/unotools/inc/unotools/eventcfg.hxx
new file mode 100644
index 000000000000..0cee43e59dc5
--- /dev/null
+++ b/unotools/inc/unotools/eventcfg.hxx
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: eventcfg.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _EVENTCFG_HXX
+#define _EVENTCFG_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define STR_EVENT_STARTAPP 0
+#define STR_EVENT_CLOSEAPP 1
+#define STR_EVENT_DOCCREATED 2
+#define STR_EVENT_CREATEDOC 3
+#define STR_EVENT_LOADFINISHED 4
+#define STR_EVENT_OPENDOC 5
+#define STR_EVENT_PREPARECLOSEDOC 6
+#define STR_EVENT_CLOSEDOC 7
+#define STR_EVENT_SAVEDOC 8
+#define STR_EVENT_SAVEDOCDONE 9
+#define STR_EVENT_SAVEDOCFAILED 10
+#define STR_EVENT_SAVEASDOC 11
+#define STR_EVENT_SAVEASDOCDONE 12
+#define STR_EVENT_SAVEASDOCFAILED 13
+#define STR_EVENT_SAVETODOC 14
+#define STR_EVENT_SAVETODOCDONE 15
+#define STR_EVENT_SAVETODOCFAILED 16
+#define STR_EVENT_ACTIVATEDOC 17
+#define STR_EVENT_DEACTIVATEDOC 18
+#define STR_EVENT_PRINTDOC 19
+#define STR_EVENT_VIEWCREATED 20
+#define STR_EVENT_PREPARECLOSEVIEW 21
+#define STR_EVENT_CLOSEVIEW 22
+#define STR_EVENT_MODIFYCHANGED 23
+#define STR_EVENT_TITLECHANGED 24
+#define STR_EVENT_VISAREACHANGED 25
+#define STR_EVENT_MODECHANGED 26
+#define STR_EVENT_STORAGECHANGED 27
+
+typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > EventBindingHash;
+typedef ::std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > > FrameVector;
+typedef ::std::vector< ::rtl::OUString > SupportedEventsVector;
+
+class GlobalEventConfig_Impl : public utl::ConfigItem
+{
+ EventBindingHash m_eventBindingHash;
+ FrameVector m_lFrames;
+ SupportedEventsVector m_supportedEvents;
+
+ void initBindingInfo();
+
+public:
+ GlobalEventConfig_Impl( );
+ ~GlobalEventConfig_Impl( );
+
+ void EstablishFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+ void Notify( const com::sun::star::uno::Sequence& aPropertyNames);
+ void Commit();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ ::rtl::OUString GetEventName( sal_Int32 nID );
+};
+
+class UNOTOOLS_DLLPUBLIC GlobalEventConfig:
+ public ::cppu::WeakImplHelper2 < ::com::sun::star::document::XEventsSupplier, ::com::sun::star::container::XNameReplace >
+{
+ public:
+ GlobalEventConfig( );
+ ~GlobalEventConfig( );
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+ void EstablishFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::rtl::OUString GetEventName( sal_Int32 nID );
+
+ private:
+ static GlobalEventConfig_Impl* m_pImpl;
+ static sal_Int32 m_nRefCount;
+};
+
+#endif // _EVENTCFG_HXX
diff --git a/unotools/inc/unotools/extendedsecurityoptions.hxx b/unotools/inc/unotools/extendedsecurityoptions.hxx
new file mode 100644
index 000000000000..114cf81d6ced
--- /dev/null
+++ b/unotools/inc/unotools/extendedsecurityoptions.hxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: extendedsecurityoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
+#define INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtExtendedSecurityOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about security features
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtExtendedSecurityOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+ // Must be zero based!
+ enum OpenHyperlinkMode
+ {
+ OPEN_NEVER = 0,
+ OPEN_WITHSECURITYCHECK,
+ OPEN_ALWAYS
+ };
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtExtendedSecurityOptions();
+ virtual ~SvtExtendedSecurityOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ sal_Bool IsSecureHyperlink( const rtl::OUString& aURL ) const;
+ com::sun::star::uno::Sequence< rtl::OUString > GetSecureExtensionList() const;
+
+ OpenHyperlinkMode GetOpenHyperlinkMode();
+ void SetOpenHyperlinkMode( OpenHyperlinkMode aMode );
+ sal_Bool IsOpenHyperlinkModeReadOnly() const;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtExtendedSecurityOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtExtendedSecurityOptions
+
+#endif // #ifndef INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
diff --git a/unotools/inc/unotools/fltrcfg.hxx b/unotools/inc/unotools/fltrcfg.hxx
new file mode 100644
index 000000000000..1422ba1a7a8f
--- /dev/null
+++ b/unotools/inc/unotools/fltrcfg.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fltrcfg.hxx,v $
+ * $Revision: 1.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SVT_FLTRCFG_HXX
+#define _SVT_FLTRCFG_HXX
+
+// -----------------------------------------------------------------------
+
+#include "unotools/unotoolsdllapi.h"
+#include
+
+struct SvtFilterOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public utl::ConfigItem
+{
+ SvtFilterOptions_Impl* pImp;
+
+ const com::sun::star::uno::Sequence& GetPropertyNames();
+public:
+ SvtFilterOptions();
+ virtual ~SvtFilterOptions();
+
+ virtual void Notify( const com::sun::star::uno::Sequence& aPropertyNames);
+ virtual void Commit();
+ void Load();
+
+ void SetLoadWordBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicCode() const;
+ void SetLoadWordBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicStorage() const;
+
+ void SetLoadExcelBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicCode() const;
+ void SetLoadExcelBasicExecutable( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicExecutable() const;
+ void SetLoadExcelBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicStorage() const;
+
+ void SetLoadPPointBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadPPointBasicCode() const;
+ void SetLoadPPointBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadPPointBasicStorage() const;
+
+ sal_Bool IsMathType2Math() const;
+ void SetMathType2Math( sal_Bool bFlag );
+ sal_Bool IsMath2MathType() const;
+ void SetMath2MathType( sal_Bool bFlag );
+
+ sal_Bool IsWinWord2Writer() const;
+ void SetWinWord2Writer( sal_Bool bFlag );
+ sal_Bool IsWriter2WinWord() const;
+ void SetWriter2WinWord( sal_Bool bFlag );
+
+ sal_Bool IsUseEnhancedFields() const;
+ void SetUseEnhancedFields( sal_Bool bFlag );
+
+ sal_Bool IsExcel2Calc() const;
+ void SetExcel2Calc( sal_Bool bFlag );
+ sal_Bool IsCalc2Excel() const;
+ void SetCalc2Excel( sal_Bool bFlag );
+
+ sal_Bool IsPowerPoint2Impress() const;
+ void SetPowerPoint2Impress( sal_Bool bFlag );
+ sal_Bool IsImpress2PowerPoint() const;
+ void SetImpress2PowerPoint( sal_Bool bFlag );
+
+ sal_Bool IsEnablePPTPreview() const;
+ sal_Bool IsEnableCalcPreview() const;
+ sal_Bool IsEnableWordPreview() const;
+
+ static SvtFilterOptions* Get();
+};
+
+#endif
+
+
+
+
diff --git a/unotools/inc/unotools/fontoptions.hxx b/unotools/inc/unotools/fontoptions.hxx
new file mode 100644
index 000000000000..644670711595
--- /dev/null
+++ b/unotools/inc/unotools/fontoptions.hxx
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fontoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_FONTOPTIONS_HXX
+#define INCLUDED_unotools_FONTOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtFontOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about font features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtFontOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtFontOptions();
+ virtual ~SvtFontOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Font"
+ @descr These values defines different states of font handling.
+
+ ..ReplacementTable..() => Determines if the list of font replacements is applied or not.
+
+ ..FontHistory..() => The last 5 fonts will be shown and the last one will be the
+ first name on the list. These will be displayed in the Font name
+ combo box on the Object bar.
+
+ ..FontWYSIWYG..() => With this option the names of the selectable fonts
+ (for example, the fonts in the Font field in the object bar)
+ will be formatted as the current font.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsReplacementTableEnabled ( ) const ;
+ void EnableReplacementTable ( sal_Bool bState ) ;
+
+ sal_Bool IsFontHistoryEnabled ( ) const ;
+ void EnableFontHistory ( sal_Bool bState ) ;
+
+ sal_Bool IsFontWYSIWYGEnabled ( ) const ;
+ void EnableFontWYSIWYG ( sal_Bool bState ) ;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtFontOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtFontOptions
+
+#endif // #ifndef INCLUDED_unotools_FONTOPTIONS_HXX
diff --git a/unotools/inc/unotools/historyoptions.hxx b/unotools/inc/unotools/historyoptions.hxx
new file mode 100644
index 000000000000..c1bd8f62fca1
--- /dev/null
+++ b/unotools/inc/unotools/historyoptions.hxx
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: historyoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+#define INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+
+#define HISTORY_PROPERTYNAME_URL ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL" ))
+#define HISTORY_PROPERTYNAME_FILTER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Filter" ))
+#define HISTORY_PROPERTYNAME_TITLE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" ))
+#define HISTORY_PROPERTYNAME_PASSWORD ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password" ))
+
+/*-************************************************************************************************************//**
+ @descr You can use these enum values to specify right history if you call ouer interface methods.
+*//*-*************************************************************************************************************/
+
+enum EHistoryType
+{
+ ePICKLIST = 0,
+ eHISTORY = 1,
+ eHELPBOOKMARKS = 2
+};
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtHistoryOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about history features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtHistoryOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtHistoryOptions();
+ virtual ~SvtHistoryOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
+ @descr key "PickList" : The last used documents displayed in the file menu.
+ key "History" : The last opened documents general.
+ *//*-*****************************************************************************************************/
+
+ /*-****************************************************************************************************//**
+ @short set/get max size of specified history
+ @descr Call this methods to get information about max. size of specified list.
+ These value lay down the max count of items in these history. If a new one
+ is add to it the oldest one is deleted automaticly!
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @param "nSize" is the new max size of specified list. If new size smaller then the old one
+ some oldest entries will be destroyed automaticly!
+ @return Current max size of specified list.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_uInt32 GetSize( EHistoryType eHistory ) const ;
+ void SetSize( EHistoryType eHistory, sal_uInt32 nSize ) ;
+
+ /*-****************************************************************************************************//**
+ @short clear complete sepcified list
+ @descr Call this methods to clear the whole list. After that GetItemCount() will return 0 ...
+ but GetSize() will return the old value!
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear( EHistoryType eHistory );
+
+ /*-****************************************************************************************************//**
+ @short return complete sepcified list
+ @descr If you will show the whole list call this method to get it completly.
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @return A list of history items is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetList( EHistoryType eHistory ) const ;
+
+ /*-****************************************************************************************************//**
+ @short append a new item to specified list
+ @descr You can append items to a list only - removing isn't allowed for a special item!
+ The oldest entry is deleted automaticly if max size arrived or you can call Clear() ...
+ It exist two different overload methods to do this.
+ One for user which have an complete history item and another one for uncompletly data sets!
+
+ @seealso method SetSize()
+ @seealso method Clear()
+
+ @param "eHistory" select right history.
+ @param "sURL" URL to save in history
+ @param "sFilter" filter name to save in history
+ @param "sTitle" document title to save in history
+ @param "sPassword" password to save in history
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AppendItem( EHistoryType eHistory ,
+ const ::rtl::OUString& sURL ,
+ const ::rtl::OUString& sFilter ,
+ const ::rtl::OUString& sTitle ,
+ const ::rtl::OUString& sPassword );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr Make these class threadsafe.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtHistoryOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtHistoryOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
diff --git a/unotools/inc/unotools/historyoptions_const.hxx b/unotools/inc/unotools/historyoptions_const.hxx
new file mode 100644
index 000000000000..c9148aeb26f8
--- /dev/null
+++ b/unotools/inc/unotools/historyoptions_const.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: historyoptions_const.hxx,v $
+ *
+ * $Revision: 1.1.4.2 $
+ *
+ * last change: $Author: as $ $Date: 2008/03/19 11:17:49 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#ifndef INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX
+#define INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX
+
+#include
+
+namespace
+{
+ static const ::rtl::OUString s_sCommonHistory = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/History");
+ static const ::rtl::OUString s_sHistories = ::rtl::OUString::createFromAscii("org.openoffice.Office.Histories/Histories");
+ static const ::rtl::OUString s_sPickListSize = ::rtl::OUString::createFromAscii("PickListSize");
+ static const ::rtl::OUString s_sURLHistorySize = ::rtl::OUString::createFromAscii("Size");
+ static const ::rtl::OUString s_sHelpBookmarksSize = ::rtl::OUString::createFromAscii("HelpBookmarkSize");
+ static const ::rtl::OUString s_sPickList = ::rtl::OUString::createFromAscii("PickList");
+ static const ::rtl::OUString s_sURLHistory = ::rtl::OUString::createFromAscii("URLHistory");
+ static const ::rtl::OUString s_sHelpBookmarks = ::rtl::OUString::createFromAscii("HelpBookmarks");
+ static const ::rtl::OUString s_sItemList = ::rtl::OUString::createFromAscii("ItemList");
+ static const ::rtl::OUString s_sOrderList = ::rtl::OUString::createFromAscii("OrderList");
+ static const ::rtl::OUString s_sHistoryItemRef = ::rtl::OUString::createFromAscii("HistoryItemRef");
+ static const ::rtl::OUString s_sURL = ::rtl::OUString::createFromAscii("URL");
+ static const ::rtl::OUString s_sFilter = ::rtl::OUString::createFromAscii("Filter");
+ static const ::rtl::OUString s_sTitle = ::rtl::OUString::createFromAscii("Title");
+ static const ::rtl::OUString s_sPassword = ::rtl::OUString::createFromAscii("Password");
+}
+
+#endif // INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX
diff --git a/unotools/inc/unotools/inetoptions.hxx b/unotools/inc/unotools/inetoptions.hxx
new file mode 100644
index 000000000000..42f01f40b7c2
--- /dev/null
+++ b/unotools/inc/unotools/inetoptions.hxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: inetoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _unotools_INETOPTIONS_HXX_
+#define _unotools_INETOPTIONS_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertiesChangeListener;
+} } } }
+namespace rtl { class OUString; }
+
+//============================================================================
+/** The names of all the properties (options) accessible through
+ SvtInetOptions.
+
+ @descr These names are used in the methods
+ SvtInetOptions::addPropertiesChangeListener() and
+ SvtInetOptions::removePropertiesChangeListener().
+ */
+#define SVT_INET_OPTION_PROXY_NO_PROXY "Inet/Proxy/NoProxy"
+#define SVT_INET_OPTION_PROXY_TYPE "Inet/Proxy/Type"
+#define SVT_INET_OPTION_PROXY_FTP_NAME "Inet/Proxy/FTP/Name"
+#define SVT_INET_OPTION_PROXY_FTP_PORT "Inet/Proxy/FTP/Port"
+#define SVT_INET_OPTION_PROXY_HTTP_NAME "Inet/Proxy/HTTP/Name"
+#define SVT_INET_OPTION_PROXY_HTTP_PORT "Inet/Proxy/HTTP/Port"
+
+//============================================================================
+/** Interface to access those configuration database entries that are related
+ to the various Internet services.
+
+ @descr The Set...() methods all have a second parameter bFlush. If false
+ is passed (the default), the new value is not written back directly, but
+ only cached within this class. If the value in the configuration database
+ is also changed, the cached change will get lost. If, on the other hand,
+ true is passed, the new value is instantly written back to the
+ configuration database.
+ */
+class UNOTOOLS_DLLPUBLIC SvtInetOptions: public utl::detail::Options
+{
+public:
+ SvtInetOptions();
+
+ virtual ~SvtInetOptions();
+
+ enum ProxyType { NONE, AUTOMATIC, MANUAL };
+
+ rtl::OUString GetProxyNoProxy() const;
+
+ sal_Int32 GetProxyType() const;
+
+ rtl::OUString GetProxyFtpName() const;
+
+ sal_Int32 GetProxyFtpPort() const;
+
+ rtl::OUString GetProxyHttpName() const;
+
+ sal_Int32 GetProxyHttpPort() const;
+
+ void SetProxyNoProxy(rtl::OUString const & rValue, bool bFlush = false);
+
+ void SetProxyType(ProxyType eValue, bool bFlush = false);
+
+ void SetProxyFtpName(rtl::OUString const & rValue, bool bFlush = false);
+
+ void SetProxyFtpPort(sal_Int32 nValue, bool bFlush = false);
+
+ void SetProxyHttpName(rtl::OUString const & rValue, bool bFlush = false);
+
+ void SetProxyHttpPort(sal_Int32 nValue, bool bFlush = false);
+
+ void flush();
+
+ /** Add a listener on changes of certain properties (options).
+
+ @param rPropertyNames The names of the properties (options). If an
+ empty sequence is used, nothing is done.
+
+ @param rListener A listener. If the listener is already registered
+ on other properties, it continues to also get notifications about
+ changes of those properties. The
+ com::sun::star::beans::PropertyChangeEvents supplied to the listener
+ will have void OldValue and NewValue slots.
+ */
+ void
+ addPropertiesChangeListener(
+ com::sun::star::uno::Sequence< rtl::OUString > const & rPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ rListener);
+
+ /** Remove a listener on changes of certain properties (options).
+
+ @param rPropertyNames The names of the properties (options). If an
+ empty sequence is used, nothing is done.
+
+ @param rListener A listener. If the listener is still registered on
+ other properties, it continues to get notifications about changes of
+ those properties.
+ */
+ void
+ removePropertiesChangeListener(
+ com::sun::star::uno::Sequence< rtl::OUString > const & rPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ rListener);
+
+private:
+ class Impl;
+
+ static Impl * m_pImpl;
+};
+
+#endif // _unotools_INETOPTIONS_HXX_
diff --git a/unotools/inc/unotools/internaloptions.hxx b/unotools/inc/unotools/internaloptions.hxx
new file mode 100644
index 000000000000..d5c9adaa7b92
--- /dev/null
+++ b/unotools/inc/unotools/internaloptions.hxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: internaloptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_INTERNALOPTIONS_HXX
+#define INCLUDED_unotools_INTERNALOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// namespaces!
+//_________________________________________________________________________________________________________________
+
+#define MUTEX ::osl::Mutex
+#define OUSTRING ::rtl::OUString
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtInternalOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about internal features
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtInternalOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtInternalOptions();
+ virtual ~SvtInternalOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Internal/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+ The values are fixed at runtime - and implemented as readonly!
+
+ SlotCFGEnabled() => If this option is set (true), StarOffice is searching for the slot.cfg.
+ If the slot.cfg cannot be found, the start is aborted.
+ If this option is not set (false), the slot.cfg must not be available,
+ otherwise the start is also aborted.
+
+ CrashMailEnabled() => Crash-Mail-Feature to document program crashes. After a crash,
+ an e-mail with information about the system used is generated
+ automatically when starting StarOffice.
+
+ @seealso configuration package "org.openoffice.Office.Common/Internal"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool SlotCFGEnabled () const;
+ sal_Bool CrashMailEnabled () const;
+ sal_Bool MailUIEnabled () const;
+ sal_Bool IsRemoveMenuEntryClose() const;
+ sal_Bool IsRemoveMenuEntryBackToWebtop() const;
+ sal_Bool IsRemoveMenuEntryNewWebtop() const;
+ sal_Bool IsRemoveMenuEntryLogout() const;
+
+ OUSTRING GetCurrentTempURL() const;
+ void SetCurrentTempURL( const OUSTRING& aNewCurrentTempURL );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static MUTEX& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtInternalOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtInternalOptions
+
+#endif // #ifndef INCLUDED_unotools_INTERNALOPTIONS_HXX
diff --git a/unotools/inc/unotools/itemholderbase.hxx b/unotools/inc/unotools/itemholderbase.hxx
new file mode 100644
index 000000000000..3b8bbccb3549
--- /dev/null
+++ b/unotools/inc/unotools/itemholderbase.hxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: itemholderbase.hxx,v $
+ * $Revision: 1.7 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_unotools_ITEMHOLDERBASE_HXX_
+#define INCLUDED_unotools_ITEMHOLDERBASE_HXX_
+
+//-----------------------------------------------
+// includes
+
+#include
+#include
+
+namespace utl { namespace detail { class Options; } }
+
+//-----------------------------------------------
+// definitions
+
+struct ItemHolderMutexBase
+{
+ ::osl::Mutex m_aLock;
+};
+
+enum EItem
+{
+ E_ACCELCFG , //
+ E_ACCESSIBILITYOPTIONS , // 2
+ E_ADDXMLTOSTORAGEOPTIONS , //
+ E_APEARCFG , // 2
+
+ E_CJKOPTIONS , // 2
+ E_CMDOPTIONS , //
+ E_COLORCFG , // 2
+ E_COMPATIBILITY , //
+ E_CTLOPTIONS , // 2
+
+ E_DEFAULTOPTIONS , //
+ E_DYNAMICMENUOPTIONS , //
+
+ E_EVENTCFG , //
+ E_EXTENDEDSECURITYOPTIONS , //
+
+ E_FLTRCFG , //
+ E_FONTOPTIONS , //
+ E_FONTSUBSTCONFIG , // 2
+
+ E_HELPOPTIONS , // 2
+ E_HISTORYOPTIONS , //
+
+ E_INETOPTIONS , //
+ E_INTERNALOPTIONS , //
+
+ E_JAVAOPTIONS , //
+
+ E_LANGUAGEOPTIONS , // 2
+ E_LINGUCFG , //
+ E_LOCALISATIONOPTIONS , //
+
+ E_MENUOPTIONS , //
+ E_MISCCFG , // 2
+ E_MISCOPTIONS , //
+ E_MODULEOPTIONS , //
+
+ E_OPTIONSDLGOPTIONS , //
+
+ E_PATHOPTIONS , //
+ E_PRINTOPTIONS , // 2
+ E_PRINTFILEOPTIONS , // 2
+ E_PRINTWARNINGOPTIONS , //
+
+ E_REGOPTIONS , //
+
+ E_SAVEOPTIONS , //
+ E_SEARCHOPT , //
+ E_SECURITYOPTIONS , //
+ E_SOURCEVIEWCONFIG , //
+ E_STARTOPTIONS , //
+ E_SYSLOCALEOPTIONS , // 2
+
+ E_UNDOOPTIONS , // 2
+ E_USEROPTIONS , // 2
+
+ E_VIEWOPTIONS_DIALOG , //
+ E_VIEWOPTIONS_TABDIALOG , //
+ E_VIEWOPTIONS_TABPAGE , //
+ E_VIEWOPTIONS_WINDOW , //
+
+ E_WORKINGSETOPTIONS , //
+
+ E_XMLACCELCFG //
+};
+
+struct TItemInfo
+{
+ TItemInfo()
+ : pItem(0)
+ {}
+
+ utl::detail::Options * pItem;
+ EItem eItem;
+};
+
+typedef ::std::vector< TItemInfo > TItems;
+
+#endif // INCLUDED_unotools_ITEMHOLDERBASE_HXX_
diff --git a/unotools/inc/unotools/javaoptions.hxx b/unotools/inc/unotools/javaoptions.hxx
new file mode 100644
index 000000000000..9996a496bf31
--- /dev/null
+++ b/unotools/inc/unotools/javaoptions.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: javaoptions.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _unotools_JAVAOPTIONS_HXX
+#define _unotools_JAVAOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+
+
+// class SvtJavaOptions --------------------------------------------------
+
+struct SvtJavaOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtJavaOptions : public utl::ConfigItem
+{
+ SvtJavaOptions_Impl* pImpl;
+public:
+ enum EOption
+ {
+ E_ENABLED,
+ E_SECURITY,
+ E_NETACCESS,
+ E_USERCLASSPATH,
+ E_EXECUTEAPPLETS
+ };
+
+ SvtJavaOptions();
+ ~SvtJavaOptions();
+
+ virtual void Commit();
+
+ sal_Bool IsEnabled() const;
+ sal_Bool IsSecurity()const;
+ sal_Int32 GetNetAccess() const;
+ rtl::OUString& GetUserClassPath()const;
+ sal_Bool IsExecuteApplets() const;
+
+ void SetEnabled(sal_Bool bSet) ;
+ void SetSecurity(sal_Bool bSet);
+ void SetNetAccess(sal_Int32 nSet) ;
+ void SetUserClassPath(const rtl::OUString& rSet);
+ void SetExecuteApplets(sal_Bool bSet);
+
+ sal_Bool IsReadOnly( EOption eOption ) const;
+};
+
+#endif //
+
diff --git a/unotools/inc/unotools/lingucfg.hxx b/unotools/inc/unotools/lingucfg.hxx
new file mode 100644
index 000000000000..49500db964c2
--- /dev/null
+++ b/unotools/inc/unotools/lingucfg.hxx
@@ -0,0 +1,244 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: lingucfg.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _unotools_LINGUCFG_HXX_
+#define _unotools_LINGUCFG_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+class SvtLinguConfigItem;
+
+//////////////////////////////////////////////////////////////////////
+
+struct UNOTOOLS_DLLPUBLIC SvtLinguOptions
+{
+ ::com::sun::star::uno::Sequence< rtl::OUString > aActiveDics;
+ ::com::sun::star::uno::Sequence< rtl::OUString > aActiveConvDics;
+
+ BOOL bROActiveDics;
+ BOOL bROActiveConvDics;
+
+ // Hyphenator service specific options
+ INT16 nHyphMinLeading,
+ nHyphMinTrailing,
+ nHyphMinWordLength;
+
+ BOOL bROHyphMinLeading,
+ bROHyphMinTrailing,
+ bROHyphMinWordLength;
+
+ // misc options (non-service specific)
+ INT16 nDefaultLanguage;
+ INT16 nDefaultLanguage_CJK;
+ INT16 nDefaultLanguage_CTL;
+
+ BOOL bRODefaultLanguage;
+ BOOL bRODefaultLanguage_CJK;
+ BOOL bRODefaultLanguage_CTL;
+
+ // spelling options (non-service specific)
+ BOOL bIsSpellSpecial;
+ BOOL bIsSpellAuto;
+ BOOL bIsSpellReverse;
+
+ BOOL bROIsSpellSpecial;
+ BOOL bROIsSpellAuto;
+ BOOL bROIsSpellReverse;
+
+ // hyphenation options (non-service specific)
+ BOOL bIsHyphSpecial;
+ BOOL bIsHyphAuto;
+
+ BOOL bROIsHyphSpecial;
+ BOOL bROIsHyphAuto;
+
+ // common to SpellChecker, Hyphenator and Thesaurus service
+ BOOL bIsUseDictionaryList;
+ BOOL bIsIgnoreControlCharacters;
+
+ BOOL bROIsUseDictionaryList;
+ BOOL bROIsIgnoreControlCharacters;
+
+ // SpellChecker service specific options
+ BOOL bIsSpellWithDigits,
+ bIsSpellUpperCase,
+ bIsSpellCapitalization;
+
+ BOOL bROIsSpellWithDigits,
+ bROIsSpellUpperCase,
+ bROIsSpellCapitalization;
+
+ // text conversion specific options
+ BOOL bIsIgnorePostPositionalWord;
+ BOOL bIsAutoCloseDialog;
+ BOOL bIsShowEntriesRecentlyUsedFirst;
+ BOOL bIsAutoReplaceUniqueEntries;
+ BOOL bIsDirectionToSimplified;
+ BOOL bIsUseCharacterVariants;
+ BOOL bIsTranslateCommonTerms;
+ BOOL bIsReverseMapping;
+
+ BOOL bROIsIgnorePostPositionalWord;
+ BOOL bROIsAutoCloseDialog;
+ BOOL bROIsShowEntriesRecentlyUsedFirst;
+ BOOL bROIsAutoReplaceUniqueEntries;
+ BOOL bROIsDirectionToSimplified;
+ BOOL bROIsUseCharacterVariants;
+ BOOL bROIsTranslateCommonTerms;
+ BOOL bROIsReverseMapping;
+
+ // check value need to determine if the configuration needs to updatet
+ // or not (used for a quick check if data files have been changed/added
+ // or deleted
+ INT32 nDataFilesChangedCheckValue;
+ BOOL bRODataFilesChangedCheckValue;
+
+ BOOL bIsGrammarAuto;
+ BOOL bIsGrammarInteractive;
+
+ BOOL bROIsGrammarAuto;
+ BOOL bROIsGrammarInteractive;
+
+ SvtLinguOptions();
+};
+
+//////////////////////////////////////////////////////////////////////
+
+struct UNOTOOLS_DLLPUBLIC SvtLinguConfigDictionaryEntry
+{
+ // the URL's pointing to the location of the files the dictionary consists of
+ com::sun::star::uno::Sequence< rtl::OUString > aLocations;
+ // the name of the dictionary format implement
+ rtl::OUString aFormatName;
+ // the list of languages (ISO names) the dictionary can be used for
+ com::sun::star::uno::Sequence< rtl::OUString > aLocaleNames;
+};
+
+//////////////////////////////////////////////////////////////////////
+
+class UNOTOOLS_DLLPUBLIC SvtLinguConfig: public utl::detail::Options
+{
+ // returns static object
+ UNOTOOLS_DLLPRIVATE SvtLinguConfigItem & GetConfigItem();
+
+ SvtLinguConfigItem & GetConfigItem() const { return const_cast< SvtLinguConfig * >( this )->GetConfigItem(); }
+
+ // configuration update access for the 'Linguistic' main node
+ mutable com::sun::star::uno::Reference< com::sun::star::util::XChangesBatch > m_xMainUpdateAccess;
+
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesBatch > GetMainUpdateAccess() const;
+
+ com::sun::star::uno::Sequence< rtl::OUString > GetCurrentOrLastActiveDicts_Impl( const rtl::OUString &rPropName ) const;
+ void SetCurrentOrLastActiveDicts_Impl( const rtl::OUString &rPropName, const com::sun::star::uno::Sequence< rtl::OUString > &rDictionaries ) const;
+
+ rtl::OUString GetVendorImageUrl_Impl( const rtl::OUString &rServiceImplName, const rtl::OUString &rImageName ) const;
+
+ // disallow copy-constructor and assignment-operator for now
+ SvtLinguConfig( const SvtLinguConfig & );
+ SvtLinguConfig & operator = ( const SvtLinguConfig & );
+
+public:
+ SvtLinguConfig();
+ virtual ~SvtLinguConfig();
+
+ //
+ // borrowed from utl::ConfigItem
+ //
+ com::sun::star::uno::Sequence< rtl::OUString >
+ GetNodeNames( const rtl::OUString &rNode );
+ //
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any >
+ GetProperties(
+ const com::sun::star::uno::Sequence< rtl::OUString > &rNames );
+ //
+ sal_Bool
+ ReplaceSetProperties(
+ const rtl::OUString &rNode,
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > rValues );
+
+ com::sun::star::uno::Any
+ GetProperty( const rtl::OUString &rPropertyName ) const;
+ com::sun::star::uno::Any
+ GetProperty( INT32 nPropertyHandle ) const;
+
+ BOOL SetProperty( const rtl::OUString &rPropertyName,
+ const com::sun::star::uno::Any &rValue );
+ BOOL SetProperty( INT32 nPropertyHandle,
+ const com::sun::star::uno::Any &rValue );
+
+ BOOL GetOptions( SvtLinguOptions &rOptions ) const;
+ BOOL SetOptions( const SvtLinguOptions &rOptions );
+
+ BOOL IsReadOnly( const rtl::OUString &rPropertyName ) const;
+ BOOL IsReadOnly( INT32 nPropertyHandle ) const;
+
+ //!
+ //! the following functions work on the 'ServiceManager' sub node of the
+ //! linguistic configuration only
+ //!
+ BOOL GetElementNamesFor( const rtl::OUString &rNodeName, com::sun::star::uno::Sequence< rtl::OUString > &rElementNames ) const;
+ //
+ BOOL GetSupportedDictionaryFormatsFor( const rtl::OUString &rSetName, const rtl::OUString &rSetEntry, com::sun::star::uno::Sequence< rtl::OUString > &rFormatList ) const;
+ void SetOrCreateSupportedDictionaryFormatsFor( const rtl::OUString &rSetName, const rtl::OUString &rSetEntry, const com::sun::star::uno::Sequence< rtl::OUString > &rFormatList ) const;
+ //
+ BOOL GetDictionaryEntry( const rtl::OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
+ void SetOrCreateDictionaryEntry( const rtl::OUString &rNodeName, const SvtLinguConfigDictionaryEntry &rDicEntry ) const;
+ //
+ com::sun::star::uno::Sequence< rtl::OUString > GetDisabledDictionaries() const;
+ void SetDisabledDictionaries( const com::sun::star::uno::Sequence< rtl::OUString > &rDictionaries ) const;
+ //
+ std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( const rtl::OUString &rFormatName );
+
+ // functions returning file URLs to the respective images (if found) and empty string otherwise
+ ::rtl::OUString GetSpellAndGrammarDialogImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
+ ::rtl::OUString GetSpellAndGrammarContextSuggestionImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
+ ::rtl::OUString GetSpellAndGrammarContextDictionaryImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
+
+ bool HasAnyVendorImages() const;
+ bool HasGrammarChecker() const;
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif
+
diff --git a/unotools/inc/unotools/linguprops.hxx b/unotools/inc/unotools/linguprops.hxx
new file mode 100644
index 000000000000..3edd1004bec0
--- /dev/null
+++ b/unotools/inc/unotools/linguprops.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: linguprops.hxx,v $
+ * $Revision: 1.10 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _unotools_LINGUPROPS_HXX_
+#define _unotools_LINGUPROPS_HXX_
+
+
+// UNO property names for general options
+#define UPN_IS_GERMAN_PRE_REFORM "IsGermanPreReform" /*! deprecated #i91949 !*/
+#define UPN_IS_USE_DICTIONARY_LIST "IsUseDictionaryList"
+#define UPN_IS_IGNORE_CONTROL_CHARACTERS "IsIgnoreControlCharacters"
+#define UPN_ACTIVE_DICTIONARIES "ActiveDictionaries"
+
+// UNO property names for SpellChecker
+#define UPN_IS_SPELL_UPPER_CASE "IsSpellUpperCase"
+#define UPN_IS_SPELL_WITH_DIGITS "IsSpellWithDigits"
+#define UPN_IS_SPELL_CAPITALIZATION "IsSpellCapitalization"
+
+// UNO property names for Hyphenator
+#define UPN_HYPH_MIN_LEADING "HyphMinLeading"
+#define UPN_HYPH_MIN_TRAILING "HyphMinTrailing"
+#define UPN_HYPH_MIN_WORD_LENGTH "HyphMinWordLength"
+
+// UNO property names for Lingu
+// (those not covered by the SpellChecker and Hyphenator
+// properties and more likely to be used in other modules only)
+#define UPN_DEFAULT_LANGUAGE "DefaultLanguage"
+#define UPN_DEFAULT_LOCALE "DefaultLocale"
+#define UPN_DEFAULT_LOCALE_CJK "DefaultLocale_CJK"
+#define UPN_DEFAULT_LOCALE_CTL "DefaultLocale_CTL"
+#define UPN_IS_HYPH_AUTO "IsHyphAuto"
+#define UPN_IS_HYPH_SPECIAL "IsHyphSpecial"
+#define UPN_IS_SPELL_AUTO "IsSpellAuto"
+#define UPN_IS_SPELL_HIDE "IsSpellHide" /*! deprecated #i91949 !*/
+#define UPN_IS_SPELL_IN_ALL_LANGUAGES "IsSpellInAllLanguages" /*! deprecated #i91949 !*/
+#define UPN_IS_SPELL_SPECIAL "IsSpellSpecial"
+#define UPN_IS_WRAP_REVERSE "IsWrapReverse"
+#define UPN_DATA_FILES_CHANGED_CHECK_VALUE "DataFilesChangedCheckValue"
+
+// UNO property names for text conversion options
+#define UPN_ACTIVE_CONVERSION_DICTIONARIES "ActiveConversionDictionaries"
+#define UPN_IS_IGNORE_POST_POSITIONAL_WORD "IsIgnorePostPositionalWord"
+#define UPN_IS_AUTO_CLOSE_DIALOG "IsAutoCloseDialog"
+#define UPN_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST "IsShowEntriesRecentlyUsedFirst"
+#define UPN_IS_AUTO_REPLACE_UNIQUE_ENTRIES "IsAutoReplaceUniqueEntries"
+#define UPN_IS_DIRECTION_TO_SIMPLIFIED "IsDirectionToSimplified"
+#define UPN_IS_USE_CHARACTER_VARIANTS "IsUseCharacterVariants"
+#define UPN_IS_TRANSLATE_COMMON_TERMS "IsTranslateCommonTerms"
+#define UPN_IS_REVERSE_MAPPING "IsReverseMapping"
+
+// new UNO propertynames to be used with 'dictionaries as extensions'
+#define UPN_DICTIONARIES "Dictionaries"
+#define UPN_SPELL_CHECKERS "SpellCheckers"
+#define UPN_HYPHENATORS "Hyphenators"
+#define UPN_THESAURI "Thesauri"
+#define UPN_CURRENT_ACTIVE_DICTIONARIES "CurrentActiveDictionaries"
+#define UPN_LAST_ACTIVE_DICTIONARIES "LastActiveDictionaries"
+
+#define UPN_IS_GRAMMAR_AUTO "IsAutoGrammarCheck"
+#define UPN_IS_GRAMMAR_INTERACTIVE "IsInteractiveGrammarCheck"
+
+// uno property handles
+#define UPH_IS_GERMAN_PRE_REFORM 0
+#define UPH_IS_USE_DICTIONARY_LIST 1
+#define UPH_IS_IGNORE_CONTROL_CHARACTERS 2
+#define UPH_IS_SPELL_UPPER_CASE 3
+#define UPH_IS_SPELL_WITH_DIGITS 4
+#define UPH_IS_SPELL_CAPITALIZATION 5
+#define UPH_HYPH_MIN_LEADING 6
+#define UPH_HYPH_MIN_TRAILING 7
+#define UPH_HYPH_MIN_WORD_LENGTH 8
+#define UPH_DEFAULT_LOCALE 9
+#define UPH_IS_SPELL_AUTO 10
+#define UPH_IS_SPELL_HIDE 11
+#define UPH_IS_SPELL_IN_ALL_LANGUAGES 12
+#define UPH_IS_SPELL_SPECIAL 13
+#define UPH_IS_HYPH_AUTO 14
+#define UPH_IS_HYPH_SPECIAL 15
+#define UPH_IS_WRAP_REVERSE 16
+#define UPH_DATA_FILES_CHANGED_CHECK_VALUE 17
+#define UPH_DEFAULT_LANGUAGE 21
+#define UPH_DEFAULT_LOCALE_CJK 22
+#define UPH_DEFAULT_LOCALE_CTL 23
+#define UPH_ACTIVE_DICTIONARIES 24
+#define UPH_ACTIVE_CONVERSION_DICTIONARIES 25
+#define UPH_IS_IGNORE_POST_POSITIONAL_WORD 26
+#define UPH_IS_AUTO_CLOSE_DIALOG 27
+#define UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST 28
+#define UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES 29
+#define UPH_IS_DIRECTION_TO_SIMPLIFIED 30
+#define UPH_IS_USE_CHARACTER_VARIANTS 31
+#define UPH_IS_TRANSLATE_COMMON_TERMS 32
+#define UPH_IS_REVERSE_MAPPING 33
+#define UPH_IS_GRAMMAR_AUTO 34
+#define UPH_IS_GRAMMAR_INTERACTIVE 35
+#endif
+
diff --git a/unotools/inc/unotools/localisationoptions.hxx b/unotools/inc/unotools/localisationoptions.hxx
new file mode 100644
index 000000000000..d401eccee51a
--- /dev/null
+++ b/unotools/inc/unotools/localisationoptions.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: localisationoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
+#define INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtLocalisationOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about localisation features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtLocalisationOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtLocalisationOptions();
+ virtual ~SvtLocalisationOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/AutoMnemonic"
+ @descr These value specifies if shortcuts should be assigned automatically.
+
+ @seealso -
+
+ @param "bState", new value to set it in configuration.
+ @return The value which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsAutoMnemonic ( ) const ;
+ void SetAutoMnemonic ( sal_Bool bState ) ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/DialogScale"
+ @descr These value specifies the factor for increasing controls.
+ Value from [0..100] are allowed.
+
+ @ATTENTION These methods don't check for valid or invalid values!
+ Our configuration server can do it ... but these implementation don't get any notifications
+ about wrong commits ...!
+ => If you set an invalid value - nothing will be changed. The information will lost.
+
+ @seealso baseclass ConfigItem
+
+ @param "nScale" new value to set it in configuration.
+ @return The value which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetDialogScale( ) const ;
+ void SetDialogScale( sal_Int32 nScale ) ;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtLocalisationOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtLocalisationOptions
+
+#endif // #ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
diff --git a/unotools/inc/unotools/loghelper.hxx b/unotools/inc/unotools/loghelper.hxx
new file mode 100644
index 000000000000..22efd5cff46d
--- /dev/null
+++ b/unotools/inc/unotools/loghelper.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: loghelper.hxx,v $
+ *
+ * $Revision: 1.1.4.2 $
+ *
+ * last change: $Author: as $ $Date: 2008/03/19 11:20:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _SVT_LOGHELPER_HXX
+#define _SVT_LOGHELPER_HXX
+
+namespace css = ::com::sun::star;
+
+class LogHelper
+{
+public:
+ LogHelper();
+ ~LogHelper();
+
+ static void logIt(const css::uno::Exception&){}
+};
+
+inline void logIt(const css::uno::Exception& ex)
+{
+ ::rtl::OUStringBuffer sMsg(256);
+ sMsg.appendAscii("Unexpected exception catched. Original message was:\n\"" );
+ sMsg.append(ex.Message);
+ sMsg.appendAscii("\"");
+ OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
+}
+
+#endif
+
diff --git a/unotools/inc/unotools/moduleoptions.hxx b/unotools/inc/unotools/moduleoptions.hxx
new file mode 100644
index 000000000000..8b759a0834cf
--- /dev/null
+++ b/unotools/inc/unotools/moduleoptions.hxx
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: moduleoptions.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+#define INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define FEATUREFLAG_BASICIDE 0x00000020
+#define FEATUREFLAG_MATH 0x00000100
+#define FEATUREFLAG_CHART 0x00000200
+#define FEATUREFLAG_CALC 0x00000800
+#define FEATUREFLAG_DRAW 0x00001000
+#define FEATUREFLAG_WRITER 0x00002000
+#define FEATUREFLAG_IMPRESS 0x00008000
+#define FEATUREFLAG_INSIGHT 0x00010000
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+class SvtModuleOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about installation state of modules
+ @descr Use these class to get installation state of different office modules like writer, calc etc
+ Further you can ask for additional informations; e.g. name of standard template file, which
+ should be used by corresponding module; or short/long name of these module factory.
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+ @threadsafe yes
+*//*-*************************************************************************************************************/
+class UNOTOOLS_DLLPUBLIC SvtModuleOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public const declarations!
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ enum EModule
+ {
+ E_SWRITER = 0,
+ E_SCALC = 1,
+ E_SDRAW = 2,
+ E_SIMPRESS = 3,
+ E_SMATH = 4,
+ E_SCHART = 5,
+ E_SSTARTMODULE = 6,
+ E_SBASIC = 7,
+ E_SDATABASE = 8,
+ E_SWEB = 9,
+ E_SGLOBAL = 10
+ };
+
+ /*ATTENTION:
+ If you change these enum ... don't forget to change reading/writing and order of configuration values too!
+ See "SvtModuleOptions_Impl::impl_GetSetNames()" and his ctor for further informations.
+ */
+ enum EFactory
+ {
+ E_UNKNOWN_FACTORY = -1,
+ E_WRITER = 0,
+ E_WRITERWEB = 1,
+ E_WRITERGLOBAL = 2,
+ E_CALC = 3,
+ E_DRAW = 4,
+ E_IMPRESS = 5,
+ E_MATH = 6,
+ E_CHART = 7,
+ E_STARTMODULE = 8,
+ E_DATABASE = 9,
+ E_BASIC = 10
+
+ };
+
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+ SvtModuleOptions();
+ virtual ~SvtModuleOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+ sal_Bool IsModuleInstalled ( EModule eModule ) const;
+ ::rtl::OUString GetModuleName ( EModule eModule ) const;
+ ::rtl::OUString GetModuleName ( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryName ( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryShortName ( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryStandardTemplate( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryWindowAttributes( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryEmptyDocumentURL( EFactory eFactory ) const;
+ ::rtl::OUString GetFactoryDefaultFilter ( EFactory eFactory ) const;
+ sal_Bool IsDefaultFilterReadonly ( EFactory eFactory ) const;
+ sal_Int32 GetFactoryIcon ( EFactory eFactory ) const;
+ static sal_Bool ClassifyFactoryByName ( const ::rtl::OUString& sName ,
+ EFactory& eFactory );
+ void SetFactoryStandardTemplate( EFactory eFactory ,
+ const ::rtl::OUString& sTemplate );
+ void SetFactoryWindowAttributes( EFactory eFactory ,
+ const ::rtl::OUString& sAttributes);
+ void SetFactoryDefaultFilter ( EFactory eFactory ,
+ const ::rtl::OUString& sFilter );
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given
+ document service name.
+ */
+ static EFactory ClassifyFactoryByServiceName(const ::rtl::OUString& sName);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given
+ short name.
+ */
+ static EFactory ClassifyFactoryByShortName(const ::rtl::OUString& sName);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given properties.
+
+ @descr Because this search base on filters currently (till we have a better solution)
+ a result is not guaranteed everytimes. May a filter does not exists for the specified
+ content (but a FrameLoader which is not bound to any application!) ... or
+ the given properties describe a stream (and we make no deep detection inside here!).
+
+ @attention The module BASIC cant be detected here. Because it does not
+ has an own URL schema.
+
+ @param sURL
+ the complete URL!
+
+ @param lMediaDescriptor
+ additional informations
+
+ @return A suitable enum value. See EFactory above.
+ */
+ static EFactory ClassifyFactoryByURL(const ::rtl::OUString& sURL ,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lMediaDescriptor);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given properties.
+
+ @descr Here we try to use the list of supported service names of the given model
+ to find out the right application module.
+
+ @attention The module BASIC cant be detected here. Because it does not
+ support any model/ctrl/view paradigm.
+
+ @param xModel
+ the document model
+
+ @return A suitable enum value. See EFactory above.
+ */
+ static EFactory ClassifyFactoryByModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel);
+
+ ::rtl::OUString GetDefaultModuleName();
+
+ //---------------------------------------------------------------------------------------------------------
+ // old interface ...
+ //---------------------------------------------------------------------------------------------------------
+ sal_Bool IsMath () const;
+ sal_Bool IsChart () const;
+ sal_Bool IsCalc () const;
+ sal_Bool IsDraw () const;
+ sal_Bool IsWriter () const;
+ sal_Bool IsImpress () const;
+ sal_Bool IsBasicIDE () const;
+ sal_Bool IsDataBase () const;
+ sal_uInt32 GetFeatures() const;
+
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > GetAllServiceNames();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+ private:
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double defined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtModuleOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtModuleOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
diff --git a/unotools/inc/unotools/options.hxx b/unotools/inc/unotools/options.hxx
new file mode 100644
index 000000000000..6e3b40075a04
--- /dev/null
+++ b/unotools/inc/unotools/options.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: options.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_unotools_OPTIONS_HXX
+#define INCLUDED_unotools_OPTIONS_HXX
+
+#include "sal/config.h"
+#include "unotools/unotoolsdllapi.h"
+
+namespace utl {
+
+ class ConfigurationBroadcaster;
+ class IMPL_ConfigurationListenerList;
+
+ class UNOTOOLS_DLLPUBLIC ConfigurationListener
+ {
+ public:
+ virtual void ConfigurationChanged( ConfigurationBroadcaster* ) = 0;
+ };
+
+ class UNOTOOLS_DLLPUBLIC ConfigurationBroadcaster
+ {
+ IMPL_ConfigurationListenerList* mpList;
+ public:
+ void AddListener( utl::ConfigurationListener* pListener );
+ void RemoveListener( utl::ConfigurationListener* pListener );
+ void NotifyListeners();
+ ConfigurationBroadcaster();
+ ~ConfigurationBroadcaster();
+ };
+
+namespace detail {
+
+// A base class for the various option classes supported by
+// unotools/source/config/itemholderbase.hxx (which must be public, as it is
+// shared between svl and svt):
+class UNOTOOLS_DLLPUBLIC Options : public utl::ConfigurationBroadcaster, public utl::ConfigurationListener
+{
+public:
+ Options();
+
+ virtual ~Options() = 0;
+
+private:
+ UNOTOOLS_DLLPRIVATE Options(Options &); // not defined
+ UNOTOOLS_DLLPRIVATE void operator =(Options &); // not defined
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* );
+};
+
+} }
+
+#endif
diff --git a/unotools/inc/unotools/optionsdlg.hxx b/unotools/inc/unotools/optionsdlg.hxx
new file mode 100644
index 000000000000..87649a82358c
--- /dev/null
+++ b/unotools/inc/unotools/optionsdlg.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: optionsdlg.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_OPTIONSDLG_HXX
+#define INCLUDED_unotools_OPTIONSDLG_HXX
+
+#ifndef INCLUDED_unotoolsdllapi_H
+#include "unotools/unotoolsdllapi.h"
+#endif
+#include
+#include
+
+class SvtOptionsDlgOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtOptionsDialogOptions: public utl::detail::Options
+{
+private:
+ SvtOptionsDlgOptions_Impl* m_pImp;
+
+public:
+ SvtOptionsDialogOptions();
+ virtual ~SvtOptionsDialogOptions();
+
+ sal_Bool IsGroupHidden ( const String& _rGroup ) const;
+ sal_Bool IsPageHidden ( const String& _rPage,
+ const String& _rGroup ) const;
+ sal_Bool IsOptionHidden ( const String& _rOption,
+ const String& _rPage,
+ const String& _rGroup ) const;
+};
+
+#endif
+
diff --git a/unotools/inc/unotools/pathoptions.hxx b/unotools/inc/unotools/pathoptions.hxx
new file mode 100644
index 000000000000..e606180c25de
--- /dev/null
+++ b/unotools/inc/unotools/pathoptions.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pathoptions.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_PATHOPTIONS_HXX
+#define INCLUDED_unotools_PATHOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+
+#define SVT_SEARCHPATH_DELIMITER ';'
+
+// class SvtPathOptions --------------------------------------------------
+
+class SvtPathOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtPathOptions: public utl::detail::Options
+{
+private:
+ SvtPathOptions_Impl* pImp;
+
+public:
+ enum Pathes
+ {
+ PATH_ADDIN,
+ PATH_AUTOCORRECT,
+ PATH_AUTOTEXT,
+ PATH_BACKUP,
+ PATH_BASIC,
+ PATH_BITMAP,
+ PATH_CONFIG,
+ PATH_DICTIONARY,
+ PATH_FAVORITES,
+ PATH_FILTER,
+ PATH_GALLERY,
+ PATH_GRAPHIC,
+ PATH_HELP,
+ PATH_LINGUISTIC,
+ PATH_MODULE,
+ PATH_PALETTE,
+ PATH_PLUGIN,
+ PATH_STORAGE,
+ PATH_TEMP,
+ PATH_TEMPLATE,
+ PATH_USERCONFIG,
+ PATH_WORK,
+ PATH_UICONFIG,
+ PATH_FINGERPRINT,
+ PATH_COUNT // should always be the last element
+ };
+
+ SvtPathOptions();
+ virtual ~SvtPathOptions();
+
+ // get the pathes, not const because of using a mutex
+ const String& GetAddinPath() const;
+ const String& GetAutoCorrectPath() const;
+ const String& GetAutoTextPath() const;
+ const String& GetBackupPath() const;
+ const String& GetBasicPath() const;
+ const String& GetBitmapPath() const;
+ const String& GetConfigPath() const;
+ const String& GetDictionaryPath() const;
+ const String& GetFavoritesPath() const;
+ const String& GetFilterPath() const;
+ const String& GetGalleryPath() const;
+ const String& GetGraphicPath() const;
+ const String& GetHelpPath() const;
+ const String& GetLinguisticPath() const;
+ const String& GetModulePath() const;
+ const String& GetPalettePath() const;
+ const String& GetPluginPath() const;
+ const String& GetStoragePath() const;
+ const String& GetTempPath() const;
+ const String& GetTemplatePath() const;
+ const String& GetUserConfigPath() const;
+ const String& GetWorkPath() const;
+ const String& GetUIConfigPath() const;
+ const String& GetFingerprintPath() const;
+
+ BOOL IsPathReadonly(Pathes ePath)const;
+ const String& GetPath(Pathes ePath) const;
+
+ // set the pathes
+ void SetAddinPath( const String& rPath );
+ void SetAutoCorrectPath( const String& rPath );
+ void SetAutoTextPath( const String& rPath );
+ void SetBackupPath( const String& rPath );
+ void SetBasicPath( const String& rPath );
+ void SetBitmapPath( const String& rPath );
+ void SetConfigPath( const String& rPath );
+ void SetDictionaryPath( const String& rPath );
+ void SetFavoritesPath( const String& rPath );
+ void SetFilterPath( const String& rPath );
+ void SetGalleryPath( const String& rPath );
+ void SetGraphicPath( const String& rPath );
+ void SetHelpPath( const String& rPath );
+ void SetLinguisticPath( const String& rPath );
+ void SetModulePath( const String& rPath );
+ void SetPalettePath( const String& rPath );
+ void SetPluginPath( const String& rPath );
+ void SetStoragePath( const String& rPath );
+ void SetTempPath( const String& rPath );
+ void SetTemplatePath( const String& rPath );
+ void SetUserConfigPath( const String& rPath );
+ void SetWorkPath( const String& rPath );
+ void SetPath( SvtPathOptions::Pathes ePath, const String& rNewPath );
+
+ String SubstituteVariable( const String& rVar );
+ String UseVariable( const String& rVar );
+ sal_Bool SearchFile( String& rIniFile, Pathes ePath = PATH_USERCONFIG );
+ ::com::sun::star::lang::Locale GetLocale() const;
+ sal_Bool IsReadonly() const;
+};
+
+#endif // #ifndef INCLUDED_unotools_PATHOPTIONS_HXX
+
diff --git a/unotools/inc/unotools/printwarningoptions.hxx b/unotools/inc/unotools/printwarningoptions.hxx
new file mode 100644
index 000000000000..3663fb8c63d0
--- /dev/null
+++ b/unotools/inc/unotools/printwarningoptions.hxx
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: printwarningoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
+#define INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtPrintWarningOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtPrintWarningOptions();
+ virtual ~SvtPrintWarningOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Print/Warning..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ @seealso configuration package "org.openoffice.Office.Common/_3D-Engine"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsPaperSize() const;
+ sal_Bool IsPaperOrientation() const;
+ sal_Bool IsNotFound() const;
+ sal_Bool IsTransparency() const;
+ sal_Bool IsModifyDocumentOnPrintingAllowed() const;
+
+ void SetPaperSize( sal_Bool bState );
+ void SetPaperOrientation( sal_Bool bState );
+ void SetNotFound( sal_Bool bState );
+ void SetTransparency( sal_Bool bState );
+ void SetModifyDocumentOnPrintingAllowed( sal_Bool bState );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtPrintWarningOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtPrintWarningOptions
+
+#endif // #ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
diff --git a/unotools/inc/unotools/regoptions.hxx b/unotools/inc/unotools/regoptions.hxx
new file mode 100644
index 000000000000..3b0f6c760b1f
--- /dev/null
+++ b/unotools/inc/unotools/regoptions.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: regoptions.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef unotools_REGOPTIONS_HXX
+#define unotools_REGOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+
+//........................................................................
+namespace utl
+{
+//........................................................................
+
+ //====================================================================
+ //= RegOptions
+ //====================================================================
+ class RegOptionsImpl;
+ /** encapsulates access to the configuration settings for registering the product
+ */
+ class UNOTOOLS_DLLPUBLIC RegOptions
+ {
+ private:
+ RegOptionsImpl* m_pImpl;
+
+ // the impl class is constructed upon need only (as this is expensive)
+ UNOTOOLS_DLLPRIVATE void ensureImpl( );
+
+ public:
+ RegOptions( );
+ ~RegOptions( );
+
+ // retrieves the URL which should be used for online registration
+ String getRegistrationURL( ) const;
+
+ // checks if the menu item which can be used to trigger the online registration should be available
+ sal_Bool allowMenu( ) const;
+
+ enum DialogPermission
+ { // the registration dialog shall be executed ....
+ dpDisabled, // ... never - it has been disabled
+ dpNotThisSession, // ... later - no statement when, but _not now_
+ dpRemindLater, // ... later at a reminder date
+ dpThisSession // ... during this session
+ };
+
+ /** checks if the registration dialog is allowed
+ A return value of does not mean that during this session, the dialog is allowed to
+ be executed. It simply means executing it is allowed in general
+ */
+ DialogPermission getDialogPermission( ) const;
+
+ /** claims that the current session is done with respect to the registration dialog.
+
+ This is not to be called if getDialogPermission returned dpDisabled previously
+
The behaviour changes as follows:
+
+ - any subsequent calls to getDialogPermission will return dpNotThisSession, given
+ that it previously returned dpNotThisSession
+ - any subsequent calls to getDialogPermission will return dpDisabled, given
+ that it previously returned dpThisSession
+ - an internal (persistent) session counter is updated, so that during the next session,
+ getDialogPermission may return dpThisSession
+
+ */
+ void markSessionDone( );
+
+ /** activates the reminder
+
+ If this method is called, the reminder for the dialog will be activated.
+ This means that during the next _nDaysFromNow-1 days,
+ getDialogPermission will return dpRemindLater
,
+ at the _nDaysFromNowth day from today onwards it will
+ return dpThisSession.
+
+ It is not allowed to call this method if the dialog is currently disabled.
+
+ If the current session has not been marked as done already
+ (i.e., markSessionDone has not been called, yet), this is
+ done implicitly when you call activateReminder.
+ */
+ void activateReminder( sal_Int32 _nDaysFromNow );
+
+ /** removes the reminder
+
+ If this method is called, the reminder for the dialog will be removed.
+ */
+ void removeReminder();
+
+ /** checks if the reminder date has come
+
+
Returns if the current date is greater or equal the reminder date.
+ */
+ bool hasReminderDateCome() const;
+ };
+
+//........................................................................
+} // namespace utl
+//........................................................................
+
+#endif // unotools_REGOPTIONS_HXX
+
diff --git a/unotools/inc/unotools/saveopt.hxx b/unotools/inc/unotools/saveopt.hxx
new file mode 100644
index 000000000000..bb50cadafb1d
--- /dev/null
+++ b/unotools/inc/unotools/saveopt.hxx
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: saveopt.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_SAVEOPT_HXX
+#define INCLUDED_unotools_SAVEOPT_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+
+struct SvtLoadSaveOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtSaveOptions: public utl::detail::Options
+{
+ SvtLoadSaveOptions_Impl* pImp;
+
+public:
+
+ enum EOption
+ {
+ E_AUTOSAVETIME,
+ E_USEUSERDATA,
+ E_BACKUP,
+ E_AUTOSAVE,
+ E_AUTOSAVEPROMPT,
+ E_DOCINFSAVE,
+ E_SAVEWORKINGSET,
+ E_SAVEDOCWINS,
+ E_SAVEDOCVIEW,
+ E_SAVERELINET,
+ E_SAVERELFSYS,
+ E_SAVEUNPACKED,
+ E_DOPRETTYPRINTING,
+ E_WARNALIENFORMAT,
+ E_LOADDOCPRINTER,
+ E_ODFDEFAULTVERSION
+ };
+
+ // keep enum values sorted that a less or greater compare maps to older and newer versions!
+ enum ODFDefaultVersion
+ {
+ ODFVER_UNKNOWN = 0, // unknown
+ ODFVER_010 = 1, // ODF 1.0
+ ODFVER_011 = 2, // ODF 1.1
+ DO_NOT_USE = 3, // Do not use this, only here for compatibility with pre OOo 3.2 configuration
+ ODFVER_012 = 4, // ODF 1.2
+
+ ODFVER_LATEST = SAL_MAX_ENUM, // ODF latest version with enhancements
+ };
+
+ SvtSaveOptions();
+ virtual ~SvtSaveOptions();
+
+ void SetAutoSaveTime( sal_Int32 n );
+ sal_Int32 GetAutoSaveTime() const;
+
+ void SetUseUserData( sal_Bool b );
+ sal_Bool IsUseUserData() const;
+
+ void SetBackup( sal_Bool b );
+ sal_Bool IsBackup() const;
+
+ void SetAutoSave( sal_Bool b );
+ sal_Bool IsAutoSave() const;
+
+ void SetAutoSavePrompt( sal_Bool b );
+ sal_Bool IsAutoSavePrompt() const;
+
+ void SetDocInfoSave(sal_Bool b);
+ sal_Bool IsDocInfoSave() const;
+
+ void SetSaveWorkingSet( sal_Bool b );
+ sal_Bool IsSaveWorkingSet() const;
+
+ void SetSaveDocWins( sal_Bool b );
+ sal_Bool IsSaveDocWins() const;
+
+ void SetSaveDocView( sal_Bool b );
+ sal_Bool IsSaveDocView() const;
+
+ void SetSaveRelINet( sal_Bool b );
+ sal_Bool IsSaveRelINet() const;
+
+ void SetSaveRelFSys( sal_Bool b );
+ sal_Bool IsSaveRelFSys() const;
+
+ void SetSaveUnpacked( sal_Bool b );
+ sal_Bool IsSaveUnpacked() const;
+
+ void SetLoadUserSettings(sal_Bool b);
+ sal_Bool IsLoadUserSettings() const;
+
+ void SetPrettyPrinting( sal_Bool _bEnable );
+ sal_Bool IsPrettyPrinting( ) const;
+
+ void SetWarnAlienFormat( sal_Bool _bEnable );
+ sal_Bool IsWarnAlienFormat( ) const;
+
+ void SetLoadDocumentPrinter( sal_Bool _bEnable );
+ sal_Bool IsLoadDocumentPrinter( ) const;
+
+ void SetODFDefaultVersion( ODFDefaultVersion eVersion );
+ ODFDefaultVersion GetODFDefaultVersion() const;
+
+ sal_Bool IsReadOnly( EOption eOption ) const;
+};
+
+#endif
+
diff --git a/unotools/inc/unotools/searchopt.hxx b/unotools/inc/unotools/searchopt.hxx
new file mode 100644
index 000000000000..4f53a1e050b0
--- /dev/null
+++ b/unotools/inc/unotools/searchopt.hxx
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: searchopt.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVT_SEARCHOPT_HXX_
+#define _SVT_SEARCHOPT_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include "tools/solar.h"
+
+class SvtSearchOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtSearchOptions
+{
+ SvtSearchOptions_Impl *pImpl;
+
+ // disallow copy-constructor and assignment-operator for now
+ SvtSearchOptions( const SvtSearchOptions & );
+ SvtSearchOptions & operator = ( const SvtSearchOptions & );
+
+protected:
+
+public:
+ SvtSearchOptions();
+ ~SvtSearchOptions();
+
+ INT32 GetTransliterationFlags() const;
+
+ //
+ // General Options
+ //
+
+ BOOL IsWholeWordsOnly() const;
+ BOOL IsBackwards() const;
+ BOOL IsUseRegularExpression() const;
+ BOOL IsSearchForStyles() const;
+ BOOL IsSimilaritySearch() const;
+ BOOL IsUseAsianOptions() const;
+ BOOL IsMatchCase() const; // also Japanese search option
+ BOOL IsNotes() const;
+
+ void SetWholeWordsOnly( BOOL bVal );
+ void SetBackwards( BOOL bVal );
+ void SetUseRegularExpression( BOOL bVal );
+ void SetSearchForStyles( BOOL bVal );
+ void SetSimilaritySearch( BOOL bVal );
+ void SetUseAsianOptions( BOOL bVal );
+ void SetMatchCase( BOOL bVal ); // also Japanese search option
+ void SetNotes( BOOL bVal);
+
+ //
+ // Japanese search options
+ //
+
+ BOOL IsMatchFullHalfWidthForms() const;
+ BOOL IsMatchHiraganaKatakana() const;
+ BOOL IsMatchContractions() const;
+ BOOL IsMatchMinusDashChoon() const;
+ BOOL IsMatchRepeatCharMarks() const;
+ BOOL IsMatchVariantFormKanji() const;
+ BOOL IsMatchOldKanaForms() const;
+ BOOL IsMatchDiziDuzu() const;
+ BOOL IsMatchBavaHafa() const;
+ BOOL IsMatchTsithichiDhizi() const;
+ BOOL IsMatchHyuiyuByuvyu() const;
+ BOOL IsMatchSesheZeje() const;
+ BOOL IsMatchIaiya() const;
+ BOOL IsMatchKiku() const;
+ BOOL IsIgnorePunctuation() const;
+ BOOL IsIgnoreWhitespace() const;
+ BOOL IsIgnoreProlongedSoundMark() const;
+ BOOL IsIgnoreMiddleDot() const;
+
+ void SetMatchFullHalfWidthForms( BOOL bVal );
+ void SetMatchHiraganaKatakana( BOOL bVal );
+ void SetMatchContractions( BOOL bVal );
+ void SetMatchMinusDashChoon( BOOL bVal );
+ void SetMatchRepeatCharMarks( BOOL bVal );
+ void SetMatchVariantFormKanji( BOOL bVal );
+ void SetMatchOldKanaForms( BOOL bVal );
+ void SetMatchDiziDuzu( BOOL bVal );
+ void SetMatchBavaHafa( BOOL bVal );
+ void SetMatchTsithichiDhizi( BOOL bVal );
+ void SetMatchHyuiyuByuvyu( BOOL bVal );
+ void SetMatchSesheZeje( BOOL bVal );
+ void SetMatchIaiya( BOOL bVal );
+ void SetMatchKiku( BOOL bVal );
+ void SetIgnorePunctuation( BOOL bVal );
+ void SetIgnoreWhitespace( BOOL bVal );
+ void SetIgnoreProlongedSoundMark( BOOL bVal );
+ void SetIgnoreMiddleDot( BOOL bVal );
+};
+
+
+#endif
+
diff --git a/unotools/inc/unotools/securityoptions.hxx b/unotools/inc/unotools/securityoptions.hxx
new file mode 100644
index 000000000000..bbca1770b836
--- /dev/null
+++ b/unotools/inc/unotools/securityoptions.hxx
@@ -0,0 +1,299 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: securityoptions.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX
+#define INCLUDED_unotools_SECURITYOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtSecurityOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr These values present modes to handle StarOffice basic scripts.
+ see GetBasicMode/SetBasicMode() for further informations
+*//*-*************************************************************************************************************/
+
+enum EBasicSecurityMode
+{
+ eNEVER_EXECUTE = 0,
+ eFROM_LIST = 1,
+ eALWAYS_EXECUTE = 2
+};
+
+/*-************************************************************************************************************//**
+ @short collect informations about security features
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtSecurityOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public types
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ enum EOption
+ {
+ E_SECUREURLS,
+ E_BASICMODE, // xmlsec05 depricated
+ E_EXECUTEPLUGINS, // xmlsec05 depricated
+ E_WARNING, // xmlsec05 depricated
+ E_CONFIRMATION, // xmlsec05 depricated
+ E_DOCWARN_SAVEORSEND,
+ E_DOCWARN_SIGNING,
+ E_DOCWARN_PRINT,
+ E_DOCWARN_CREATEPDF,
+ E_DOCWARN_REMOVEPERSONALINFO,
+ E_DOCWARN_RECOMMENDPASSWORD,
+ E_MACRO_SECLEVEL,
+ E_MACRO_TRUSTEDAUTHORS,
+ E_MACRO_DISABLE,
+ E_CTRLCLICK_HYPERLINK
+ };
+
+ enum MacroAction
+ {
+ MA_DONTRUN = 0,
+ MA_CONFIRM,
+ MA_RUN
+ };
+
+ typedef ::com::sun::star::uno::Sequence< ::rtl::OUString > Certificate;
+
+ /*
+ // MT: Doesn't work for sequence...
+ struct Certificate
+ {
+ ::rtl::OUString SubjectName;
+ ::rtl::OUString SerialNumber;
+ ::rtl::OUString RawData;
+ };
+ */
+
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtSecurityOptions();
+ virtual ~SvtSecurityOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short returns readonly state
+ @descr It can be called to get information about the readonly state of a provided item.
+ @seealso -
+
+ @param "eOption", specify, which item is queried
+ @return if item is readonly; otherwhise
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsReadOnly( EOption eOption ) const ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/SecureURL"
+ @descr These value displays the list of all trustworthy URLs.
+ zB.: file:/ => All scripts from the local file system including a LAN;
+ private:explorer => Scripts from the Explorer;
+ private:help => Scripts in the help system;
+ private:newmenu => Scripts that are executed by the commands File-New and AutoPilot;
+ private:schedule => Scripts of the scheduler;
+ private:searchfolder => Scripts of the searchfolder;
+ private:user => Scripts that are entered in the URL field.
+ @seealso -
+
+ @param "seqURLList", new values to set it in configuration.
+ @return The values which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > GetSecureURLs( ) const ;
+ void SetSecureURLs( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqURLList ) ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/StarOfficeBasic"
+ @descr These value determines how StarOffice Basic scripts should be handled.
+ It exist 3 different modes:
+ 0 = never execute
+ 1 = from list
+ 2 = always execute
+
+ @ATTENTION These methods don't check for valid or invalid values!
+ Our configuration server can do it ... but these implementation don't get any notifications
+ about wrong commits ...!
+ => If you set an invalid value - nothing will be changed. The information will lost.
+
+ @seealso enum EBasicSecurityMode
+
+ @param "eMode" to set new mode ... Value must defined as an enum of type EBasicSecurityMode!
+ @return An enum value, which present current mode.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetMacroSecurityLevel ( ) const ;
+ void SetMacroSecurityLevel ( sal_Int32 _nLevel ) ;
+
+ sal_Bool IsMacroDisabled ( ) const ;
+
+ /*-****************************************************************************************************//**
+ @short special method to check an URL and his referer corresponding to ouer internal security cessation
+ @descr Give us an URL and his referer and we will say you if these url can be scripted or not!
+
+ @seealso -
+
+ @param "sURL" reference to URL for checking
+ @param "sReferer" reference to referer which whish to run script by given URL
+ @return sal_True if URL is secure or security is obsolete(!) or sal_False otherwise.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsSecureURL( const ::rtl::OUString& sURL ,
+ const ::rtl::OUString& sReferer ) const ;
+
+ ::com::sun::star::uno::Sequence< Certificate > GetTrustedAuthors ( ) const ;
+ void SetTrustedAuthors ( const ::com::sun::star::uno::Sequence< Certificate >& rAuthors ) ;
+ sal_Bool IsTrustedAuthorsEnabled ( ) ;
+
+ // for bool options only!
+ bool IsOptionSet ( EOption eOption ) const ;
+ bool SetOption ( EOption eOption, bool bValue ) ;
+ bool IsOptionEnabled ( EOption eOption ) const ;
+
+ // xmlsec05 depricated methods
+ sal_Bool IsExecutePlugins() const;
+ void SetExecutePlugins( sal_Bool bSet );
+ EBasicSecurityMode GetBasicMode( ) const ;
+ void SetBasicMode( EBasicSecurityMode eMode ) ;
+ sal_Bool IsWarningEnabled() const;
+ void SetWarningEnabled( sal_Bool bSet );
+ sal_Bool IsConfirmationEnabled() const;
+ void SetConfirmationEnabled( sal_Bool bSet );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtSecurityOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtSecurityOptions
+
+#endif // #ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX
diff --git a/unotools/inc/unotools/sourceviewconfig.hxx b/unotools/inc/unotools/sourceviewconfig.hxx
new file mode 100644
index 000000000000..cc28bd3dae61
--- /dev/null
+++ b/unotools/inc/unotools/sourceviewconfig.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sourceviewconfig.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _unotools_SOURCEVIEWCONFIG_HXX
+#define _unotools_SOURCEVIEWCONFIG_HXX
+
+// include ---------------------------------------------------------------
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+
+/* -----------------------------12.10.00 11:40--------------------------------
+
+ ---------------------------------------------------------------------------*/
+namespace utl
+{
+ class SourceViewConfig_Impl;
+ class UNOTOOLS_DLLPUBLIC SourceViewConfig: public utl::detail::Options
+ {
+ static SourceViewConfig_Impl* m_pImplConfig;
+ static sal_Int32 m_nRefCount;
+
+ public:
+ SourceViewConfig();
+ virtual ~SourceViewConfig();
+
+ const rtl::OUString& GetFontName() const;
+ void SetFontName(const rtl::OUString& rName);
+
+ sal_Int16 GetFontHeight() const;
+ void SetFontHeight(sal_Int16 nHeight);
+
+ sal_Bool IsShowProportionalFontsOnly() const;
+ void SetShowProportionalFontsOnly(sal_Bool bSet);
+ };
+}
+#endif
+
diff --git a/unotools/inc/unotools/startoptions.hxx b/unotools/inc/unotools/startoptions.hxx
new file mode 100644
index 000000000000..a23fb08fce6b
--- /dev/null
+++ b/unotools/inc/unotools/startoptions.hxx
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: startoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_STARTOPTIONS_HXX
+#define INCLUDED_unotools_STARTOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtStartOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtStartOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtStartOptions();
+ virtual ~SvtStartOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Start/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+ The values are fixed at runtime - and implemented as readonly!
+
+ IsIntroEnabled() : Setting, if the StarOffice Logo is displayed when starting StarOffice.
+ Default = true
+
+ EnableIntro() : Use it to enable/disable the logo at startup.
+
+ @seealso configuration package "org.openoffice.Office.Common/Start"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsIntroEnabled ( ) const ;
+ void EnableIntro ( sal_Bool bState ) ;
+
+ /*-****************************************************************************************************//**
+ @short returns or set the connection URL of an office
+ @descr Specifies the URL for an UNO connection.
+ No default is given, the URL has to be entered manually by the admin/user.
+ zB.: "socket,host=pc1.test.de,port=6001;iiop;"
+
+ @seealso configuration package "org.openoffice.Office.Common/Start"
+ *//*-*****************************************************************************************************/
+
+ ::rtl::OUString GetConnectionURL( ) const ;
+ void SetConnectionURL( const ::rtl::OUString& sURL ) ;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtStartOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtStartOptions
+
+#endif // #ifndef INCLUDED_unotools_STARTOPTIONS_HXX
diff --git a/unotools/inc/unotools/undoopt.hxx b/unotools/inc/unotools/undoopt.hxx
new file mode 100644
index 000000000000..288ec3c6b5de
--- /dev/null
+++ b/unotools/inc/unotools/undoopt.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: undoopt.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_UNDOOPT_HXX
+#define INCLUDED_unotools_UNDOOPT_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+
+class SvtUndoOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtUndoOptions: public utl::detail::Options
+{
+ SvtUndoOptions_Impl* pImp;
+
+public:
+ SvtUndoOptions();
+ virtual ~SvtUndoOptions();
+
+ void SetUndoCount( sal_Int32 n );
+ sal_Int32 GetUndoCount() const;
+};
+
+#endif
+
diff --git a/unotools/inc/unotools/useroptions.hxx b/unotools/inc/unotools/useroptions.hxx
new file mode 100644
index 000000000000..67fd3e5bbf35
--- /dev/null
+++ b/unotools/inc/unotools/useroptions.hxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: useroptions.hxx,v $
+ * $Revision: 1.2.312.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_USEROPTIONS_HXX
+#define INCLUDED_unotools_USEROPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+
+// define ----------------------------------------------------------------
+
+#define USER_OPT_CITY ((USHORT)0)
+#define USER_OPT_COMPANY ((USHORT)1)
+#define USER_OPT_COUNTRY ((USHORT)2)
+#define USER_OPT_EMAIL ((USHORT)3)
+#define USER_OPT_FAX ((USHORT)4)
+#define USER_OPT_FIRSTNAME ((USHORT)5)
+#define USER_OPT_LASTNAME ((USHORT)6)
+#define USER_OPT_POSITION ((USHORT)7)
+#define USER_OPT_STATE ((USHORT)8)
+#define USER_OPT_STREET ((USHORT)9)
+#define USER_OPT_TELEPHONEHOME ((USHORT)10)
+#define USER_OPT_TELEPHONEWORK ((USHORT)11)
+#define USER_OPT_TITLE ((USHORT)12)
+#define USER_OPT_ID ((USHORT)13)
+#define USER_OPT_ZIP ((USHORT)14)
+#define USER_OPT_FATHERSNAME ((USHORT)15)
+#define USER_OPT_APARTMENT ((USHORT)16)
+
+// class SvtUserOptions --------------------------------------------------
+
+class SvtUserOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtUserOptions: public utl::detail::Options
+{
+private:
+ SvtUserOptions_Impl* pImp;
+
+public:
+ SvtUserOptions();
+ virtual ~SvtUserOptions();
+
+ static ::osl::Mutex& GetInitMutex();
+
+ // get the address token
+ ::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;
+ ::rtl::OUString GetLocale() const;
+
+ // set the address token
+ 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 );
+
+ sal_Bool IsTokenReadonly( USHORT nToken ) const;
+ ::rtl::OUString GetToken(USHORT nToken) const;
+};
+
+#endif // #ifndef INCLUDED_unotools_USEROPTIONS_HXX
diff --git a/unotools/inc/unotools/useroptions_const.hxx b/unotools/inc/unotools/useroptions_const.hxx
new file mode 100644
index 000000000000..4dbd6da8bba3
--- /dev/null
+++ b/unotools/inc/unotools/useroptions_const.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: useroptions_const.hxx,v $
+ *
+ * $Revision: 1.1.4.2 $
+ *
+ * last change: $Author: as $ $Date: 2008/03/19 11:17:50 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX
+#define INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX
+
+#include
+
+namespace
+{
+ static const ::rtl::OUString s_sData = ::rtl::OUString::createFromAscii("org.openoffice.UserProfile/Data");
+ static const ::rtl::OUString s_so = ::rtl::OUString::createFromAscii("o"); // USER_OPT_COMPANY
+ static const ::rtl::OUString s_sgivenname = ::rtl::OUString::createFromAscii("givenname"); // USER_OPT_FIRSTNAME
+ static const ::rtl::OUString s_ssn = ::rtl::OUString::createFromAscii("sn"); // USER_OPT_LASTNAME
+ static const ::rtl::OUString s_sinitials = ::rtl::OUString::createFromAscii("initials"); // USER_OPT_ID
+ static const ::rtl::OUString s_sstreet = ::rtl::OUString::createFromAscii("street"); // USER_OPT_STREET
+ static const ::rtl::OUString s_sl = ::rtl::OUString::createFromAscii("l"); // USER_OPT_CITY
+ static const ::rtl::OUString s_sst = ::rtl::OUString::createFromAscii("st"); // USER_OPT_STATE
+ static const ::rtl::OUString s_spostalcode = ::rtl::OUString::createFromAscii("postalcode"); // USER_OPT_ZIP
+ static const ::rtl::OUString s_sc = ::rtl::OUString::createFromAscii("c"); // USER_OPT_COUNTRY
+ static const ::rtl::OUString s_stitle = ::rtl::OUString::createFromAscii("title"); // USER_OPT_TITLE
+ static const ::rtl::OUString s_sposition = ::rtl::OUString::createFromAscii("position"); // USER_OPT_POSITION
+ static const ::rtl::OUString s_shomephone = ::rtl::OUString::createFromAscii("homephone"); // USER_OPT_TELEPHONEHOME
+ static const ::rtl::OUString s_stelephonenumber = ::rtl::OUString::createFromAscii("telephonenumber"); // USER_OPT_TELEPHONEWORK
+ static const ::rtl::OUString s_sfacsimiletelephonenumber = ::rtl::OUString::createFromAscii("facsimiletelephonenumber"); // USER_OPT_FAX
+ static const ::rtl::OUString s_smail = ::rtl::OUString::createFromAscii("mail"); // USER_OPT_EMAIL
+ static const ::rtl::OUString s_scustomernumber = ::rtl::OUString::createFromAscii("customernumber"); // USER_OPT_CUSTOMERNUMBER
+ static const ::rtl::OUString s_sfathersname = ::rtl::OUString::createFromAscii("fathersname"); // USER_OPT_FATHERSNAME
+ static const ::rtl::OUString s_sapartment = ::rtl::OUString::createFromAscii("apartment"); // USER_OPT_APARTMENT
+}
+
+#endif // INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX
diff --git a/unotools/inc/unotools/viewoptions.hxx b/unotools/inc/unotools/viewoptions.hxx
new file mode 100644
index 000000000000..07f4da9e3159
--- /dev/null
+++ b/unotools/inc/unotools/viewoptions.hxx
@@ -0,0 +1,356 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: viewoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_VIEWOPTIONS_HXX
+#define INCLUDED_unotools_VIEWOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "unotools/unotoolsdllapi.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+class SvtViewOptionsBase_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr Use these enum values to specify right list in configuration in which your view data are saved.
+*//*-*************************************************************************************************************/
+
+enum EViewType
+{
+ E_DIALOG = 0,
+ E_TABDIALOG = 1,
+ E_TABPAGE = 2,
+ E_WINDOW = 3
+};
+
+/*-************************************************************************************************************//**
+ @short collect informations about view features
+ @descr We support different basetypes of views like dialogs, tab-dialogs, tab-pages and normal windows.
+ You must specify your basetype by using right enum value and must give us a valid name for your
+ subkey in registry! We support some fix features for some bastypes and user data as string for all!
+ see also configuration package "org.openoffice.Office.Views/..." for further informations.
+
+ template of configuration:
+ DialogType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ TabDialogType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ /PageID [int]
+ TabPageType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ WindowType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ /Visible [boolean]
+
+ structure of configuration:
+
+ org.openoffice.Office.Views [package]
+ /Dialogs [set]
+ /Dialog_FileOpen [DialogType]
+ /Dialog_ImportGraphics [DialogType]
+ ...
+ /Dialog_ [DialogType]
+
+ /TabDialogs [set]
+ /TabDialog_001 [TabDialogType]
+ /TabDialog_Blubber [TabDialogType]
+ ...
+ /TabDialog_ [TabDialogType]
+
+ /TabPages [set]
+ /TabPage_XXX [TabPageType]
+ /TabPage_Date [TabPageType]
+ ...
+ /TabPage_ [TabPageType]
+
+ /Windows [set]
+ /Window_User [WindowType]
+ /Window_Options [WindowType]
+ ...
+ /Window_ [WindowType]
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtViewOptions: public utl::detail::Options
+{
+ /*
+ #ifdef TF_OLDVIEW
+ public:
+ void GetPosition ( sal_Int32& nX ,
+ sal_Int32& nY ) const;
+ void SetPosition ( sal_Int32 nX ,
+ sal_Int32 nY );
+ void GetSize ( sal_Int32& nWidth ,
+ sal_Int32& nHeight ) const;
+ void SetSize ( sal_Int32 nWidth ,
+ sal_Int32 nHeight );
+ ::rtl::OUString GetUserData ( ) const;
+ void SetUserData ( const ::rtl::OUString& sData );
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > SeperateUserData( const ::rtl::OUString& sData ,
+ sal_Unicode cSeperator=';' );
+ static ::rtl::OUString GenerateUserData( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqData ,
+ sal_Unicode cSeperator=';' );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetAnyData ( ) const;
+ void SetAnyData ( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lData );
+ #endif
+ */
+
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will de-/initialize an instance with default values.
+ You must give us the basic type of your view and a name which specify right entry
+ in dynamical configuration list. If entry not exist, we create a new one!
+
+ @seealso enum EViewType
+
+ @param "eType" specify type of your view and is used to use right data container!
+ @param "sViewName" specify the name of your view and is the key name in data list too.
+ @return -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ SvtViewOptions( EViewType eType ,
+ const ::rtl::OUString& sViewName );
+ virtual ~SvtViewOptions();
+
+ /*-****************************************************************************************************//**
+ @short support preload of these config item
+ @descr Sometimes we need preloading of these configuration data without real using of it.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static void AcquireOptions();
+ static void ReleaseOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short use it to get information about existing entries in configuration
+ @descr The methods to set/get the position or size will create a new entry automaticly if
+ it not already exist and work with default values!
+ If this a problem for you - you MUST call these method before and
+ you must make up your own mind about that.
+
+ @seealso -
+
+ @onerror No error should occure.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Exists() const;
+
+ /*-****************************************************************************************************//**
+ @short use it to delete an entry of dynamic view set
+ @descr You can use this method to delete anexisting node in configuration.
+ But if you call a Set- or Get- method again on this instance
+ the item is created again! If you do nothing after this call
+ your view will die relay in configuration ...
+
+ @seealso method Exist()
+
+ @return True if delete OK, False otherwise.
+
+ @onerror We return sal_False.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Delete();
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the window state of your view
+ @descr These value describe position/size and some other states of a window.
+ Use it with right vcl methods directly. Normaly it's not neccessary to
+ parse given string!
+
+ @seealso vcl methods
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ ::rtl::OUString GetWindowState( ) const;
+ void SetWindowState( const ::rtl::OUString& sState );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the page number which was the last active one
+ @descr It's only supported for: - tab-dialogs
+ If you call it for other ones you will get an assertion in debug version.
+ In a product version we do nothing!
+
+ @seealso -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetPageID( ) const;
+ void SetPageID( sal_Int32 nID );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the visual state of a window
+ @descr It's only supported for: - windows
+ If you call it for other ones you will get an assertion in debug version.
+ In a product version we do nothing!
+
+ @seealso -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsVisible ( ) const;
+ void SetVisible( sal_Bool bState );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the extended user data (consisting of a set of named scalar values)
+ @descr It's supported for ALL types!
+ Every view can handle its own user defined data set.
+
+ @seealso -
+
+ @onerror In the non-product version, an assertion is made. In a product version, errors are silently ignored.
+ *//*-*****************************************************************************************************/
+/*
+#ifdef TF_OLDVIEW
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetUserData( sal_Bool bMakeItDifferent ) const;
+#else
+*/
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetUserData( ) const;
+//#endif
+ void SetUserData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lData );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get ONE special user data item directly
+ @descr Normaly you can work on full user data list by using "Set/GetUserData()".
+ With this function you have an access on special list entries directly without any
+
+ @seealso -
+
+ @onerror In the non-product version, an assertion is made. In a product version, errors are silently ignored.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Any GetUserItem( const ::rtl::OUString& sName ) const;
+ void SetUserItem( const ::rtl::OUString& sName ,
+ const ::com::sun::star::uno::Any& aValue );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is threadsafe.
+ We create a static mutex only for one time and use it to protect our refcount and container
+ member!
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /// specify which list of views in configuration is used! This can't be a static value!!!
+ /// ... because we need this value to work with right static data container.
+ EViewType m_eViewType ;
+ ::rtl::OUString m_sViewName ;
+
+ /// - impl. data container as dynamic pointer for smaller memory requirements!
+ /// - internal ref count mechanism
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double defined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtViewOptionsBase_Impl* m_pDataContainer_Dialogs ; /// hold data for all dialogs
+ static sal_Int32 m_nRefCount_Dialogs ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_TabDialogs ; /// hold data for all tab-dialogs
+ static sal_Int32 m_nRefCount_TabDialogs ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_TabPages ; /// hold data for all tab-pages
+ static sal_Int32 m_nRefCount_TabPages ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_Windows ; /// hold data for all windows
+ static sal_Int32 m_nRefCount_Windows ;
+
+}; // class SvtViewOptions
+
+#endif // #ifndef INCLUDED_unotools_VIEWOPTIONS_HXX
diff --git a/unotools/inc/unotools/workingsetoptions.hxx b/unotools/inc/unotools/workingsetoptions.hxx
new file mode 100644
index 000000000000..9a422e25cc32
--- /dev/null
+++ b/unotools/inc/unotools/workingsetoptions.hxx
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: workingsetoptions.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
+#define INCLUDED_unotools_WORKINGSETOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtWorkingSetOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about security features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SvtWorkingSetOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtWorkingSetOptions();
+ virtual ~SvtWorkingSetOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/SecureURL"
+ @descr These value defines the editing view for documents and windows, which have to be restored
+ when restarting StarOffice. The list gets filled, if Save/WorkingSet = true.
+
+ @seealso -
+
+ @param "seqWindowList", new values to set it in configuration.
+ @return The values which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > GetWindowList( ) const ;
+ void SetWindowList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqWindowList ) ;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtWorkingSetOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtWorkingSetOptions
+
+#endif // #ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
diff --git a/unotools/inc/unotools/xmlaccelcfg.hxx b/unotools/inc/unotools/xmlaccelcfg.hxx
new file mode 100644
index 000000000000..8b975f2a26ff
--- /dev/null
+++ b/unotools/inc/unotools/xmlaccelcfg.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlaccelcfg.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_unotools_XMLACCELCFG_HXX
+#define INCLUDED_unotools_XMLACCELCFG_HXX
+
+#ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
+#include
+#endif
+#include
+
+#include
+
+class OReadAccelatorDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
+ public ::cppu::OWeakObject
+{
+ public:
+ OReadAccelatorDocumentHandler( SvtAcceleratorItemList& aNewAcceleratorItemList ) :
+ m_nElementDepth( 0 ),
+ m_bAcceleratorMode( sal_False ),
+ m_bItemCloseExpected( sal_False ),
+ m_xLocator( 0 ),
+ m_aReadAcceleratorList( aNewAcceleratorItemList ) {}
+ virtual ~OReadAccelatorDocumentHandler() {}
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw()
+ { OWeakObject::acquire(); }
+ virtual void SAL_CALL release() throw()
+ { OWeakObject::release(); }
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XDocumentHandler
+ virtual void SAL_CALL startDocument(void)
+ throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endDocument(void)
+ throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL startElement(
+ const ::rtl::OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endElement(const ::rtl::OUString& aName) throw
+ ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL characters(const ::rtl::OUString& aChars)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString& aWhitespaces)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDocumentLocator(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ private:
+ ::rtl::OUString getErrorLineString();
+
+ int m_nElementDepth;
+ sal_Bool m_bAcceleratorMode;
+ sal_Bool m_bItemCloseExpected;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
+ SvtAcceleratorItemList& m_aReadAcceleratorList;
+};
+
+
+class OWriteAccelatorDocumentHandler
+{
+ public:
+ OWriteAccelatorDocumentHandler(
+ const SvtAcceleratorItemList& aWriteAcceleratorList,
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
+ virtual ~OWriteAccelatorDocumentHandler();
+
+ void WriteAcceleratorDocument() throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ private:
+ void WriteAcceleratorItem( const SvtAcceleratorConfigItem& aAcceleratorItem ) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
+ ::rtl::OUString m_aAttributeType;
+ const SvtAcceleratorItemList& m_aWriteAcceleratorList;
+};
+
+#endif // INCLUDED_unotools_XMLACCELCFG_HXX
diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx
new file mode 100644
index 000000000000..f911b36e83fe
--- /dev/null
+++ b/unotools/source/config/accelcfg.cxx
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: accelcfg.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#ifndef GCC
+#endif
+#include "rtl/instance.hxx"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include "itemholder1.hxx"
+
+
+using namespace utl;
+using namespace rtl;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::io;
+using namespace com::sun::star::xml::sax;
+
+
+static SvtAcceleratorConfig_Impl* pOptions = NULL;
+static sal_Int32 nRefCount = 0;
+
+class SvtAcceleratorConfig_Impl
+{
+public:
+
+ SvtAcceleratorItemList aList;
+ bool bModified;
+
+ SvtAcceleratorConfig_Impl()
+ : bModified( FALSE )
+ {}
+
+ SvtAcceleratorConfig_Impl( Reference< XInputStream >& xInputStream );
+ bool Commit( Reference< XOutputStream >& xOutputStream );
+};
+
+// -----------------------------------------------------------------------
+
+SvtAcceleratorConfig_Impl::SvtAcceleratorConfig_Impl( Reference< XInputStream >& rInputStream )
+ : bModified( false )
+{
+ Reference< XParser > xParser( ::comphelper::getProcessServiceFactory()->createInstance(
+ ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )),
+ UNO_QUERY);
+
+ // connect stream to input stream to the parser
+ InputSource aInputSource;
+ aInputSource.aInputStream = rInputStream;
+
+ // get filter
+ Reference< XDocumentHandler > xFilter( new OReadAccelatorDocumentHandler( aList ));
+
+ // connect parser and filter
+ xParser->setDocumentHandler( xFilter );
+ xParser->parseStream( aInputSource );
+}
+
+bool SvtAcceleratorConfig_Impl::Commit( Reference< XOutputStream >& rOutputStream )
+{
+ Reference< XDocumentHandler > xWriter;
+
+ xWriter = Reference< XDocumentHandler >( ::comphelper::getProcessServiceFactory()->createInstance(
+ ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+
+ Reference< ::com::sun::star::io::XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
+ xDataSource->setOutputStream( rOutputStream );
+ try
+ {
+ OWriteAccelatorDocumentHandler aWriteHandler( aList, xWriter );
+ aWriteHandler.WriteAcceleratorDocument();
+ rOutputStream->flush();
+ return true;
+ }
+ catch ( RuntimeException& )
+ {
+ }
+ catch ( SAXException& )
+ {
+ }
+ catch ( ::com::sun::star::io::IOException& )
+ {
+ }
+
+ return false;
+}
+
+namespace
+{
+ class LocalSingleton : public rtl::Static< osl::Mutex, LocalSingleton >
+ {
+ };
+}
+
+SvtAcceleratorConfiguration::SvtAcceleratorConfiguration()
+{
+ // Global access, must be guarded (multithreading)
+ ::osl::MutexGuard aGuard( LocalSingleton::get() );
+ if ( !pOptions )
+ {
+ SvStream* pStream = GetDefaultStream( STREAM_STD_READ );
+ ::utl::OInputStreamWrapper aHelper( *pStream );
+ com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xOut( &aHelper );
+
+ try
+ {
+ pOptions = new SvtAcceleratorConfig_Impl( xOut );
+ }
+ catch ( RuntimeException& )
+ {
+ pOptions = new SvtAcceleratorConfig_Impl();
+ }
+ catch( SAXException& )
+ {
+ pOptions = new SvtAcceleratorConfig_Impl();
+ }
+ catch( ::com::sun::star::io::IOException& )
+ {
+ pOptions = new SvtAcceleratorConfig_Impl();
+ }
+
+ if (pOptions)
+ ItemHolder1::holdConfigItem(E_ACCELCFG);
+
+ delete pStream;
+ }
+
+ ++nRefCount;
+ pImp = pOptions;
+}
+
+SvtAcceleratorConfiguration* SvtAcceleratorConfiguration::CreateFromStream( SvStream& rStream )
+{
+ SvtAcceleratorConfiguration* pRet = new SvtAcceleratorConfiguration;
+ ::utl::OInputStreamWrapper aHelper( rStream );
+ com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xOut( &aHelper );
+ try
+ {
+ pRet->pImp = new SvtAcceleratorConfig_Impl( xOut );
+ }
+ catch ( RuntimeException& )
+ {
+ DELETEZ( pRet );
+ }
+ catch( SAXException& )
+ {
+ DELETEZ( pRet );
+ }
+ catch( ::com::sun::star::io::IOException& )
+ {
+ DELETEZ( pRet );
+ }
+
+ return pRet;
+}
+
+// -----------------------------------------------------------------------
+
+SvtAcceleratorConfiguration::~SvtAcceleratorConfiguration()
+{
+ if ( pImp == pOptions )
+ {
+ // Global access, must be guarded (multithreading)
+ ::osl::MutexGuard aGuard( LocalSingleton::get() );
+ if ( !--nRefCount )
+ {
+ if ( pImp->bModified )
+ {
+ String aUserConfig = SvtPathOptions().GetUserConfigPath();
+ INetURLObject aObj( aUserConfig );
+ aObj.insertName( String::CreateFromAscii("GlobalKeyBindings.xml") );
+ SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE|STREAM_TRUNC );
+ ::utl::OOutputStreamWrapper aHelper( *pStream );
+ com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > xOut( &aHelper );
+ pImp->Commit( xOut );
+ delete pStream;
+ }
+
+ DELETEZ( pOptions );
+ }
+ }
+ else
+ {
+ delete pImp;
+ }
+}
+
+::rtl::OUString SvtAcceleratorConfiguration::GetCommand( const ::com::sun::star::awt::KeyEvent& rKeyEvent )
+{
+ sal_Int16 nCode=rKeyEvent.KeyCode, nModifier=rKeyEvent.Modifiers;
+ if ( !nCode )
+ nCode = rKeyEvent.KeyFunc;
+
+ std::list< SvtAcceleratorConfigItem>::const_iterator p;
+ for ( p = pImp->aList.begin(); p != pImp->aList.end(); p++ )
+ if ( p->nCode == nCode && p->nModifier == nModifier )
+ return p->aCommand;
+
+ return ::rtl::OUString();
+}
+
+const SvtAcceleratorItemList& SvtAcceleratorConfiguration::GetItems()
+{
+ return pImp->aList;
+}
+
+void SvtAcceleratorConfiguration::SetCommand( const SvtAcceleratorConfigItem& rItem )
+{
+ std::list< SvtAcceleratorConfigItem>::iterator p;
+ for ( p = pImp->aList.begin(); p != pImp->aList.end(); p++ )
+ if ( p->nCode == rItem.nCode && p->nModifier == rItem.nModifier )
+ {
+ p->aCommand = rItem.aCommand;
+ return;
+ }
+
+ pImp->aList.push_back( rItem );
+
+}
+
+void SvtAcceleratorConfiguration::SetItems( const SvtAcceleratorItemList& rItems, bool bClear )
+{
+ if ( bClear )
+ {
+ pImp->aList = rItems;
+ }
+ else
+ {
+ std::list< SvtAcceleratorConfigItem>::const_iterator p;
+ for ( p = rItems.begin(); p != rItems.end(); p++ )
+ SetCommand( *p );
+ }
+}
+
+String SvtAcceleratorConfiguration::GetStreamName()
+{
+ return String::CreateFromAscii("KeyBindings.xml");
+}
+
+SvStream* SvtAcceleratorConfiguration::GetDefaultStream( StreamMode nMode )
+{
+ String aUserConfig = SvtPathOptions().GetUserConfigPath();
+ INetURLObject aObj( aUserConfig );
+ aObj.insertName( GetStreamName() );
+ return ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), nMode );
+}
diff --git a/unotools/source/config/cacheoptions.cxx b/unotools/source/config/cacheoptions.cxx
new file mode 100644
index 000000000000..c226e8b80921
--- /dev/null
+++ b/unotools/source/config/cacheoptions.cxx
@@ -0,0 +1,510 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cacheoptions.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#ifndef GCC
+#endif
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::utl;
+using namespace ::rtl;
+using namespace ::osl;
+using namespace ::com::sun::star::uno;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_START OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Cache" ))
+#define DEFAULT_WRITEROLE 20
+#define DEFAULT_DRAWINGOLE 20
+#define DEFAULT_GRFMGR_TOTALSIZE 10000000
+#define DEFAULT_GRFMGR_OBJECTSIZE 2400000
+#define DEFAULT_GRFMGR_OBJECTRELEASE 600
+
+#define PROPERTYNAME_WRITEROLE OUString(RTL_CONSTASCII_USTRINGPARAM("Writer/OLE_Objects"))
+#define PROPERTYNAME_DRAWINGOLE OUString(RTL_CONSTASCII_USTRINGPARAM("DrawingEngine/OLE_Objects"))
+#define PROPERTYNAME_GRFMGR_TOTALSIZE OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicManager/TotalCacheSize"))
+#define PROPERTYNAME_GRFMGR_OBJECTSIZE OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicManager/ObjectCacheSize"))
+#define PROPERTYNAME_GRFMGR_OBJECTRELEASE OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicManager/ObjectReleaseTime"))
+
+#define PROPERTYHANDLE_WRITEROLE 0
+#define PROPERTYHANDLE_DRAWINGOLE 1
+#define PROPERTYHANDLE_GRFMGR_TOTALSIZE 2
+#define PROPERTYHANDLE_GRFMGR_OBJECTSIZE 3
+#define PROPERTYHANDLE_GRFMGR_OBJECTRELEASE 4
+
+#define PROPERTYCOUNT 5
+
+class SvtCacheOptions_Impl : public ConfigItem
+{
+public:
+
+//---------------------------------------------------------------------------------------------------------
+// constructor / destructor
+//---------------------------------------------------------------------------------------------------------
+
+ SvtCacheOptions_Impl();
+ ~SvtCacheOptions_Impl();
+
+//---------------------------------------------------------------------------------------------------------
+// overloaded methods of baseclass
+//---------------------------------------------------------------------------------------------------------
+
+ virtual void Commit();
+
+//---------------------------------------------------------------------------------------------------------
+// public interface
+//---------------------------------------------------------------------------------------------------------
+
+ sal_Int32 GetWriterOLE_Objects() const;
+ sal_Int32 GetDrawingEngineOLE_Objects() const;
+ sal_Int32 GetGraphicManagerTotalCacheSize() const;
+ sal_Int32 GetGraphicManagerObjectCacheSize() const;
+ sal_Int32 GetGraphicManagerObjectReleaseTime() const;
+
+ void SetWriterOLE_Objects( sal_Int32 nObjects );
+ void SetDrawingEngineOLE_Objects( sal_Int32 nObjects );
+ void SetGraphicManagerTotalCacheSize( sal_Int32 nTotalCacheSize );
+ void SetGraphicManagerObjectCacheSize( sal_Int32 nObjectCacheSize );
+ void SetGraphicManagerObjectReleaseTime( sal_Int32 nReleaseTimeSeconds );
+
+//-------------------------------------------------------------------------------------------------------------
+// private methods
+//-------------------------------------------------------------------------------------------------------------
+
+private:
+
+ static Sequence< OUString > impl_GetPropertyNames();
+
+//-------------------------------------------------------------------------------------------------------------
+// private member
+//-------------------------------------------------------------------------------------------------------------
+
+private:
+
+ sal_Int32 mnWriterOLE;
+ sal_Int32 mnDrawingOLE;
+ sal_Int32 mnGrfMgrTotalSize;
+ sal_Int32 mnGrfMgrObjectSize;
+ sal_Int32 mnGrfMgrObjectRelease;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtCacheOptions_Impl::SvtCacheOptions_Impl() :
+ ConfigItem( ROOTNODE_START ),
+ mnWriterOLE( DEFAULT_WRITEROLE ),
+ mnDrawingOLE( DEFAULT_DRAWINGOLE ),
+ mnGrfMgrTotalSize( DEFAULT_GRFMGR_TOTALSIZE ),
+ mnGrfMgrObjectSize( DEFAULT_GRFMGR_OBJECTSIZE ),
+ mnGrfMgrObjectRelease( DEFAULT_GRFMGR_OBJECTRELEASE )
+{
+ Sequence< OUString > seqNames( impl_GetPropertyNames() );
+ Sequence< Any > seqValues = GetProperties( seqNames ) ;
+
+ DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtCacheOptions_Impl::SvtCacheOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ // Copy values from list in right order to ouer internal member.
+ sal_Int32 nPropertyCount = seqValues.getLength();
+ sal_Int32 nProperty = 0;
+
+ for( nProperty=0; nProperty>= mnWriterOLE;
+ }
+ break;
+
+ case PROPERTYHANDLE_DRAWINGOLE:
+ {
+ if( seqValues[ nProperty ].getValueTypeClass() == TypeClass_LONG )
+ seqValues[nProperty] >>= mnDrawingOLE;
+ }
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_TOTALSIZE:
+ {
+ if( seqValues[ nProperty ].getValueTypeClass() == TypeClass_LONG )
+ seqValues[nProperty] >>= mnGrfMgrTotalSize;
+ }
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_OBJECTSIZE:
+ {
+ if( seqValues[ nProperty ].getValueTypeClass() == TypeClass_LONG )
+ seqValues[nProperty] >>= mnGrfMgrObjectSize;
+ }
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_OBJECTRELEASE:
+ {
+ if( seqValues[ nProperty ].getValueTypeClass() == TypeClass_LONG )
+ seqValues[nProperty] >>= mnGrfMgrObjectRelease;
+ }
+ break;
+ }
+ }
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtCacheOptions_Impl::~SvtCacheOptions_Impl()
+{
+ if( IsModified() )
+ Commit();
+}
+
+//*****************************************************************************************************************
+// Commit
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::Commit()
+{
+ Sequence< OUString > aSeqNames( impl_GetPropertyNames() );
+ Sequence< Any > aSeqValues( aSeqNames.getLength() );
+
+ for( sal_Int32 nProperty = 0, nCount = aSeqNames.getLength(); nProperty < nCount; ++nProperty )
+ {
+ switch( nProperty )
+ {
+ case PROPERTYHANDLE_WRITEROLE:
+ aSeqValues[nProperty] <<= mnWriterOLE;
+ break;
+
+ case PROPERTYHANDLE_DRAWINGOLE:
+ aSeqValues[nProperty] <<= mnDrawingOLE;
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_TOTALSIZE:
+ aSeqValues[nProperty] <<= mnGrfMgrTotalSize;
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_OBJECTSIZE:
+ aSeqValues[nProperty] <<= mnGrfMgrObjectSize;
+ break;
+
+ case PROPERTYHANDLE_GRFMGR_OBJECTRELEASE:
+ aSeqValues[nProperty] <<= mnGrfMgrObjectRelease;
+ break;
+ }
+ }
+
+ PutProperties( aSeqNames, aSeqValues );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions_Impl::GetWriterOLE_Objects() const
+{
+ return mnWriterOLE;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions_Impl::GetDrawingEngineOLE_Objects() const
+{
+ return mnDrawingOLE;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions_Impl::GetGraphicManagerTotalCacheSize() const
+{
+ return mnGrfMgrTotalSize;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions_Impl::GetGraphicManagerObjectCacheSize() const
+{
+ return mnGrfMgrObjectSize;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions_Impl::GetGraphicManagerObjectReleaseTime() const
+{
+ return mnGrfMgrObjectRelease;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::SetWriterOLE_Objects( sal_Int32 nWriterOLE )
+{
+ mnWriterOLE = nWriterOLE;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::SetDrawingEngineOLE_Objects( sal_Int32 nDrawingOLE )
+{
+ mnDrawingOLE = nDrawingOLE;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::SetGraphicManagerTotalCacheSize( sal_Int32 nGrfMgrTotalSize )
+{
+ mnGrfMgrTotalSize = nGrfMgrTotalSize;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::SetGraphicManagerObjectCacheSize( sal_Int32 nGrfMgrObjectSize )
+{
+ mnGrfMgrObjectSize = nGrfMgrObjectSize;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions_Impl::SetGraphicManagerObjectReleaseTime( sal_Int32 nGrfMgrObjectReleaseTime )
+{
+ mnGrfMgrObjectRelease = nGrfMgrObjectReleaseTime;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Sequence< OUString > SvtCacheOptions_Impl::impl_GetPropertyNames()
+{
+ // Build static list of configuration key names.
+ static const OUString pProperties[] =
+ {
+ PROPERTYNAME_WRITEROLE,
+ PROPERTYNAME_DRAWINGOLE,
+ PROPERTYNAME_GRFMGR_TOTALSIZE,
+ PROPERTYNAME_GRFMGR_OBJECTSIZE,
+ PROPERTYNAME_GRFMGR_OBJECTRELEASE
+ };
+ // Initialize return sequence with these list ...
+ static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ // ... and return it.
+ return seqPropertyNames;
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtCacheOptions_Impl* SvtCacheOptions::m_pDataContainer = NULL;
+sal_Int32 SvtCacheOptions::m_nRefCount = 0;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtCacheOptions::SvtCacheOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already!
+ if( m_pDataContainer == NULL )
+ {
+ m_pDataContainer = new SvtCacheOptions_Impl();
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtCacheOptions::~SvtCacheOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions::GetWriterOLE_Objects() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetWriterOLE_Objects();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions::GetDrawingEngineOLE_Objects() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetDrawingEngineOLE_Objects();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions::GetGraphicManagerTotalCacheSize() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetGraphicManagerTotalCacheSize();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions::GetGraphicManagerObjectCacheSize() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetGraphicManagerObjectCacheSize();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Int32 SvtCacheOptions::GetGraphicManagerObjectReleaseTime() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetGraphicManagerObjectReleaseTime();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions::SetWriterOLE_Objects( sal_Int32 nWriterOLE )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetWriterOLE_Objects( nWriterOLE );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions::SetDrawingEngineOLE_Objects( sal_Int32 nDrawingOLE )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetDrawingEngineOLE_Objects( nDrawingOLE );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions::SetGraphicManagerTotalCacheSize( sal_Int32 nGrfMgrTotalSize )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetGraphicManagerTotalCacheSize( nGrfMgrTotalSize );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions::SetGraphicManagerObjectCacheSize( sal_Int32 nGrfMgrObjectSize )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetGraphicManagerObjectCacheSize( nGrfMgrObjectSize );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCacheOptions::SetGraphicManagerObjectReleaseTime( sal_Int32 nGrfMgrObjectReleaseTime )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetGraphicManagerObjectReleaseTime( nGrfMgrObjectReleaseTime );
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtCacheOptions::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx
new file mode 100644
index 000000000000..421b201d98c0
--- /dev/null
+++ b/unotools/source/config/cmdoptions.cxx
@@ -0,0 +1,631 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cmdoptions.cxx,v $
+ * $Revision: 1.11 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::std ;
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+using namespace ::com::sun::star::beans ;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_CMDOPTIONS OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Commands/Execute" ))
+#define PATHDELIMITER OUString(RTL_CONSTASCII_USTRINGPARAM("/" ))
+
+#define SETNODE_DISABLED OUString(RTL_CONSTASCII_USTRINGPARAM("Disabled" ))
+
+#define PROPERTYNAME_CMD OUString(RTL_CONSTASCII_USTRINGPARAM("Command" ))
+
+#define PROPERTYCOUNT 1
+
+#define OFFSET_CMD 0
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+// Method to retrieve a hash code from a string. May be we have to change it to decrease collisions in the hash map
+struct OUStringHashCode
+{
+ size_t operator()( const ::rtl::OUString& sString ) const
+ {
+ return sString.hashCode();
+ }
+};
+
+/*-****************************************************************************************************************
+ @descr support simple command option structures and operations on it
+****************************************************************************************************************-*/
+class SvtCmdOptions
+{
+ public:
+ //---------------------------------------------------------------------------------------------------------
+ // the only way to free memory!
+ void Clear()
+ {
+ m_aCommandHashMap.clear();
+ }
+
+ sal_Bool HasEntries() const
+ {
+ return ( m_aCommandHashMap.size() > 0 );
+ }
+
+ void SetContainerSize( sal_Int32 nSize )
+ {
+ m_aCommandHashMap.resize( nSize );
+ }
+
+ sal_Bool Lookup( const OUString& aCmd ) const
+ {
+ CommandHashMap::const_iterator pEntry = m_aCommandHashMap.find( aCmd );
+ return ( pEntry != m_aCommandHashMap.end() );
+ }
+
+ void AddCommand( const OUString& aCmd )
+ {
+ m_aCommandHashMap.insert( CommandHashMap::value_type( aCmd, 0 ) );
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // convert internal list to external format
+ // for using it on right menus realy
+ // Notice: We build a property list with 4 entries and set it on result list then.
+ // The while-loop starts with pointer on internal member list lSetupEntries, change to
+ // lUserEntries then and stop after that with NULL!
+ // Separator entries will be packed in another way then normal entries! We define
+ // special strings "sEmpty" and "sSeperator" to perform too ...
+ Sequence< OUString > GetList() const
+ {
+ sal_Int32 nCount = (sal_Int32)m_aCommandHashMap.size();
+ sal_Int32 nIndex = 0;
+ Sequence< OUString > aList( nCount );
+
+ CommandHashMap::const_iterator pEntry = m_aCommandHashMap.begin();
+ while ( pEntry != m_aCommandHashMap.end() )
+ aList[nIndex++] = pEntry->first;
+
+ return aList;
+ }
+
+ private:
+ class CommandHashMap : public ::std::hash_map< ::rtl::OUString ,
+ sal_Int32 ,
+ OUStringHashCode ,
+ ::std::equal_to< ::rtl::OUString > >
+ {
+ public:
+ inline void free()
+ {
+ CommandHashMap().swap( *this );
+ }
+ };
+
+ CommandHashMap m_aCommandHashMap;
+};
+
+typedef ::std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > > SvtFrameVector;
+
+class SvtCommandOptions_Impl : public ConfigItem
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ SvtCommandOptions_Impl();
+ ~SvtCommandOptions_Impl();
+
+ //---------------------------------------------------------------------------------------------------------
+ // overloaded methods of baseclass
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short called for notify of configmanager
+ @descr These method is called from the ConfigManager before application ends or from the
+ PropertyChangeListener if the sub tree broadcasts changes. You must update your
+ internal values.
+
+ @seealso baseclass ConfigItem
+
+ @param "lPropertyNames" is the list of properties which should be updated.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Notify( const Sequence< OUString >& lPropertyNames );
+
+ /*-****************************************************************************************************//**
+ @short write changes to configuration
+ @descr These method writes the changed values into the sub tree
+ and should always called in our destructor to guarantee consistency of config data.
+
+ @seealso baseclass ConfigItem
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Commit();
+
+ //---------------------------------------------------------------------------------------------------------
+ // public interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short base implementation of public interface for "SvtDynamicMenuOptions"!
+ @descr These class is used as static member of "SvtDynamicMenuOptions" ...
+ => The code exist only for one time and isn't duplicated for every instance!
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear ( SvtCommandOptions::CmdOption eCmdOption );
+ sal_Bool HasEntries ( SvtCommandOptions::CmdOption eOption ) const;
+ sal_Bool Lookup ( SvtCommandOptions::CmdOption eCmdOption, const OUString& ) const;
+ Sequence< OUString > GetList ( SvtCommandOptions::CmdOption eCmdOption ) const ;
+ void AddCommand ( SvtCommandOptions::CmdOption eCmdOption,
+ const OUString& sURL );
+ void EstablisFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return list of key names of our configuration management which represent oue module tree
+ @descr These methods return the current list of key names! We need it to get needed values from our
+ configuration management and support dynamical menu item lists!
+
+ @seealso -
+
+ @param "nDisabledCount" , returns count of menu entries for "new"
+ @return A list of configuration key names is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ Sequence< OUString > impl_GetPropertyNames();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+ SvtCmdOptions m_aDisabledCommands;
+ SvtFrameVector m_lFrames;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtCommandOptions_Impl::SvtCommandOptions_Impl()
+ // Init baseclasses first
+ : ConfigItem( ROOTNODE_CMDOPTIONS )
+ // Init member then...
+{
+ // Get names and values of all accessable menu entries and fill internal structures.
+ // See impl_GetPropertyNames() for further informations.
+ Sequence< OUString > lNames = impl_GetPropertyNames ();
+ Sequence< Any > lValues = GetProperties ( lNames );
+
+ // Safe impossible cases.
+ // We need values from ALL configuration keys.
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !(lNames.getLength()!=lValues.getLength()), "SvtCommandOptions_Impl::SvtCommandOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ // Copy values from list in right order to ouer internal member.
+ // Attention: List for names and values have an internal construction pattern!
+ sal_Int32 nItem = 0 ;
+ OUString sCmd ;
+
+ // Set size of hash_map reach a used size of approx. 60%
+ m_aDisabledCommands.SetContainerSize( lNames.getLength() * 10 / 6 );
+
+ // Get names/values for disabled commands.
+ for( nItem=0; nItem < lNames.getLength(); ++nItem )
+ {
+ // Currently only one value
+ lValues[nItem] >>= sCmd;
+ m_aDisabledCommands.AddCommand( sCmd );
+ }
+
+/*TODO: Not used in the moment! see Notify() ...
+ // Enable notification mechanism of ouer baseclass.
+ // We need it to get information about changes outside these class on ouer used configuration keys! */
+ Sequence< OUString > aNotifySeq( 1 );
+ aNotifySeq[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "Disabled" ));
+ EnableNotification( aNotifySeq, sal_True );
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtCommandOptions_Impl::~SvtCommandOptions_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions_Impl::Notify( const Sequence< OUString >& )
+{
+ MutexGuard aGuard( SvtCommandOptions::GetOwnStaticMutex() );
+
+ Sequence< OUString > lNames = impl_GetPropertyNames ();
+ Sequence< Any > lValues = GetProperties ( lNames );
+
+ // Safe impossible cases.
+ // We need values from ALL configuration keys.
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !(lNames.getLength()!=lValues.getLength()), "SvtCommandOptions_Impl::SvtCommandOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ // Copy values from list in right order to ouer internal member.
+ // Attention: List for names and values have an internal construction pattern!
+ sal_Int32 nItem = 0 ;
+ OUString sCmd ;
+
+ // Set size of hash_map reach a used size of approx. 60%
+ m_aDisabledCommands.Clear();
+ m_aDisabledCommands.SetContainerSize( lNames.getLength() * 10 / 6 );
+
+ // Get names/values for disabled commands.
+ for( nItem=0; nItem < lNames.getLength(); ++nItem )
+ {
+ // Currently only one value
+ lValues[nItem] >>= sCmd;
+ m_aDisabledCommands.AddCommand( sCmd );
+ }
+
+ // dont forget to update all existing frames and her might cached dispatch objects!
+ // But look for already killed frames. We hold weak references instead of hard ones ...
+ for (SvtFrameVector::const_iterator pIt = m_lFrames.begin();
+ pIt != m_lFrames.end() ;
+ ++pIt )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame(pIt->get(), ::com::sun::star::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->contextChanged();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions_Impl::Commit()
+{
+ DBG_ERROR( "SvtCommandOptions_Impl::Commit()\nNot implemented yet!\n" );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions_Impl::Clear( SvtCommandOptions::CmdOption eCmdOption )
+{
+ switch( eCmdOption )
+ {
+ case SvtCommandOptions::CMDOPTION_DISABLED:
+ {
+ m_aDisabledCommands.Clear();
+ SetModified();
+ }
+ break;
+
+ default:
+ DBG_ASSERT( sal_False, "SvtCommandOptions_Impl::Clear()\nUnknown option type given!\n" );
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtCommandOptions_Impl::HasEntries( SvtCommandOptions::CmdOption eOption ) const
+{
+ if ( eOption == SvtCommandOptions::CMDOPTION_DISABLED )
+ return ( m_aDisabledCommands.HasEntries() > 0 );
+ else
+ return sal_False;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< OUString > SvtCommandOptions_Impl::GetList( SvtCommandOptions::CmdOption eCmdOption ) const
+{
+ Sequence< OUString > lReturn;
+
+ switch( eCmdOption )
+ {
+ case SvtCommandOptions::CMDOPTION_DISABLED:
+ {
+ lReturn = m_aDisabledCommands.GetList();
+ }
+ break;
+
+ default:
+ DBG_ASSERT( sal_False, "SvtCommandOptions_Impl::GetList()\nUnknown option type given!\n" );
+ }
+
+ return lReturn;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtCommandOptions_Impl::Lookup( SvtCommandOptions::CmdOption eCmdOption, const OUString& aCommand ) const
+{
+ switch( eCmdOption )
+ {
+ case SvtCommandOptions::CMDOPTION_DISABLED:
+ {
+ return m_aDisabledCommands.Lookup( aCommand );
+ }
+ default:
+ DBG_ASSERT( sal_False, "SvtCommandOptions_Impl::GetList()\nUnknown option type given!\n" );
+ }
+
+ return sal_False;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions_Impl::AddCommand( SvtCommandOptions::CmdOption eCmdOption, const OUString& sCmd )
+{
+ switch( eCmdOption )
+ {
+ case SvtCommandOptions::CMDOPTION_DISABLED:
+ {
+ m_aDisabledCommands.AddCommand( sCmd );
+ SetModified();
+ }
+ break;
+
+ default:
+ DBG_ASSERT( sal_False, "SvtCommandOptions_Impl::GetList()\nUnknown option type given!\n" );
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions_Impl::EstablisFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
+{
+ // check if frame already exists inside list
+ // ignore double registrations
+ // every frame must be notified one times only!
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > xWeak(xFrame);
+ SvtFrameVector::const_iterator pIt = ::std::find(m_lFrames.begin(), m_lFrames.end(), xWeak);
+ if (pIt == m_lFrames.end())
+ m_lFrames.push_back(xWeak);
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Sequence< OUString > SvtCommandOptions_Impl::impl_GetPropertyNames()
+{
+ // First get ALL names of current existing list items in configuration!
+ Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::CONFIG_NAME_LOCAL_PATH );
+
+ OUString aSetNode( SETNODE_DISABLED );
+ aSetNode += PATHDELIMITER;
+
+ OUString aCommandKey( PATHDELIMITER );
+ aCommandKey += PROPERTYNAME_CMD;
+
+ // Expand all keys
+ for (sal_Int32 i=0; iClear( eCmdOption );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtCommandOptions::HasEntries( CmdOption eOption ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->HasEntries( eOption );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtCommandOptions::Lookup( CmdOption eCmdOption, const OUString& aCommandURL ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->Lookup( eCmdOption, aCommandURL );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< OUString > SvtCommandOptions::GetList( CmdOption eCmdOption ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetList( eCmdOption );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions::AddCommand( CmdOption eCmdOption, const OUString& sURL )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->AddCommand( eCmdOption, sURL );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCommandOptions::EstablisFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->EstablisFrameCallback(xFrame);
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtCommandOptions::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
new file mode 100644
index 000000000000..46967eb7b43d
--- /dev/null
+++ b/unotools/source/config/compatibility.cxx
@@ -0,0 +1,807 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: compatibility.cxx,v $
+ * $Revision: 1.16 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef __SGI_STL_VECTOR
+#include
+#endif
+
+#include
+
+#include
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::std;
+using namespace ::utl;
+using namespace ::rtl;
+using namespace ::osl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_OPTIONS OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Compatibility/" ) )
+#define PATHDELIMITER OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) )
+#define SETNODE_ALLFILEFORMATS OUString( RTL_CONSTASCII_USTRINGPARAM( "AllFileFormats" ) )
+
+#define PROPERTYNAME_NAME COMPATIBILITY_PROPERTYNAME_NAME
+#define PROPERTYNAME_MODULE COMPATIBILITY_PROPERTYNAME_MODULE
+#define PROPERTYNAME_USEPRTMETRICS COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS
+#define PROPERTYNAME_ADDSPACING COMPATIBILITY_PROPERTYNAME_ADDSPACING
+#define PROPERTYNAME_ADDSPACINGATPAGES COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES
+#define PROPERTYNAME_USEOURTABSTOPS COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS
+#define PROPERTYNAME_NOEXTLEADING COMPATIBILITY_PROPERTYNAME_NOEXTLEADING
+#define PROPERTYNAME_USELINESPACING COMPATIBILITY_PROPERTYNAME_USELINESPACING
+#define PROPERTYNAME_ADDTABLESPACING COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING
+#define PROPERTYNAME_USEOBJPOS COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING
+#define PROPERTYNAME_USEOURTEXTWRAP COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING
+#define PROPERTYNAME_CONSIDERWRAPSTYLE COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE
+#define PROPERTYNAME_EXPANDWORDSPACE COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE
+
+#define PROPERTYCOUNT 13
+
+#define OFFSET_NAME 0
+#define OFFSET_MODULE 1
+#define OFFSET_USEPRTMETRICS 2
+#define OFFSET_ADDSPACING 3
+#define OFFSET_ADDSPACINGATPAGES 4
+#define OFFSET_USEOURTABSTOPS 5
+#define OFFSET_NOEXTLEADING 6
+#define OFFSET_USELINESPACING 7
+#define OFFSET_ADDTABLESPACING 8
+#define OFFSET_USEOBJPOS 9
+#define OFFSET_USEOURTEXTWRAPPING 10
+#define OFFSET_CONSIDERWRAPPINGSTYLE 11
+#define OFFSET_EXPANDWORDSPACE 12
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+/*-****************************************************************************************************************
+ @descr struct to hold information about one compatibility entry
+****************************************************************************************************************-*/
+struct SvtCompatibilityEntry
+{
+ public:
+ SvtCompatibilityEntry() :
+ bUsePrtMetrics( false ), bAddSpacing( false ),
+ bAddSpacingAtPages( false ), bUseOurTabStops( false ),
+ bNoExtLeading( false ), bUseLineSpacing( false ),
+ bAddTableSpacing( false ), bUseObjPos( false ),
+ bUseOurTextWrapping( false ), bConsiderWrappingStyle( false ),
+ bExpandWordSpace( true ) {}
+ SvtCompatibilityEntry(
+ const OUString& _rName, const OUString& _rNewModule ) :
+ sName( _rName ), sModule( _rNewModule ),
+ bUsePrtMetrics( false ), bAddSpacing( false ),
+ bAddSpacingAtPages( false ), bUseOurTabStops( false ),
+ bNoExtLeading( false ), bUseLineSpacing( false ),
+ bAddTableSpacing( false ), bUseObjPos( false ),
+ bUseOurTextWrapping( false ), bConsiderWrappingStyle( false ),
+ bExpandWordSpace( true ) {}
+
+ inline void SetUsePrtMetrics( bool _bSet ) { bUsePrtMetrics = _bSet; }
+ inline void SetAddSpacing( bool _bSet ) { bAddSpacing = _bSet; }
+ inline void SetAddSpacingAtPages( bool _bSet ) { bAddSpacingAtPages = _bSet; }
+ inline void SetUseOurTabStops( bool _bSet ) { bUseOurTabStops = _bSet; }
+ inline void SetNoExtLeading( bool _bSet ) { bNoExtLeading = _bSet; }
+ inline void SetUseLineSpacing( bool _bSet ) { bUseLineSpacing = _bSet; }
+ inline void SetAddTableSpacing( bool _bSet ) { bAddTableSpacing = _bSet; }
+ inline void SetUseObjPos( bool _bSet ) { bUseObjPos = _bSet; }
+ inline void SetUseOurTextWrapping( bool _bSet ) { bUseOurTextWrapping = _bSet; }
+ inline void SetConsiderWrappingStyle( bool _bSet ) { bConsiderWrappingStyle = _bSet; }
+ inline void SetExpandWordSpace( bool _bSet ) { bExpandWordSpace = _bSet; }
+
+ public:
+ OUString sName;
+ OUString sModule;
+ bool bUsePrtMetrics;
+ bool bAddSpacing;
+ bool bAddSpacingAtPages;
+ bool bUseOurTabStops;
+ bool bNoExtLeading;
+ bool bUseLineSpacing;
+ bool bAddTableSpacing;
+ bool bUseObjPos;
+ bool bUseOurTextWrapping;
+ bool bConsiderWrappingStyle;
+ bool bExpandWordSpace;
+};
+
+/*-****************************************************************************************************************
+ @descr support simple menu structures and operations on it
+****************************************************************************************************************-*/
+class SvtCompatibility
+{
+ public:
+ //---------------------------------------------------------------------------------------------------------
+ // append one entry
+ void AppendEntry( const SvtCompatibilityEntry& rEntry )
+ {
+ lEntries.push_back( rEntry );
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // the only way to free memory!
+ void Clear()
+ {
+ lEntries.clear();
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // convert internal list to external format
+ Sequence< Sequence< PropertyValue > > GetList() const
+ {
+ sal_Int32 nCount = (sal_Int32)lEntries.size();
+ sal_Int32 nStep = 0;
+ Sequence< PropertyValue > lProperties( PROPERTYCOUNT );
+ Sequence< Sequence< PropertyValue > > lResult( nCount );
+ const vector< SvtCompatibilityEntry >* pList = &lEntries;
+
+ lProperties[ OFFSET_NAME ].Name = PROPERTYNAME_NAME;
+ lProperties[ OFFSET_MODULE ].Name = PROPERTYNAME_MODULE;
+ lProperties[ OFFSET_USEPRTMETRICS ].Name = PROPERTYNAME_USEPRTMETRICS;
+ lProperties[ OFFSET_ADDSPACING ].Name = PROPERTYNAME_ADDSPACING;
+ lProperties[ OFFSET_ADDSPACINGATPAGES ].Name = PROPERTYNAME_ADDSPACINGATPAGES;
+ lProperties[ OFFSET_USEOURTABSTOPS ].Name = PROPERTYNAME_USEOURTABSTOPS;
+ lProperties[ OFFSET_NOEXTLEADING ].Name = PROPERTYNAME_NOEXTLEADING;
+ lProperties[ OFFSET_USELINESPACING ].Name = PROPERTYNAME_USELINESPACING;
+ lProperties[ OFFSET_ADDTABLESPACING ].Name = PROPERTYNAME_ADDTABLESPACING;
+ lProperties[ OFFSET_USEOBJPOS ].Name = PROPERTYNAME_USEOBJPOS;
+ lProperties[ OFFSET_USEOURTEXTWRAPPING ].Name = PROPERTYNAME_USEOURTEXTWRAP;
+ lProperties[ OFFSET_CONSIDERWRAPPINGSTYLE ].Name = PROPERTYNAME_CONSIDERWRAPSTYLE;
+ lProperties[ OFFSET_EXPANDWORDSPACE ].Name = PROPERTYNAME_EXPANDWORDSPACE;
+
+ for ( vector< SvtCompatibilityEntry >::const_iterator pItem = pList->begin();
+ pItem != pList->end(); ++pItem )
+ {
+ lProperties[ OFFSET_NAME ].Value <<= pItem->sName;
+ lProperties[ OFFSET_MODULE ].Value <<= pItem->sModule;
+ lProperties[ OFFSET_USEPRTMETRICS ].Value <<= pItem->bUsePrtMetrics;
+ lProperties[ OFFSET_ADDSPACING ].Value <<= pItem->bAddSpacing;
+ lProperties[ OFFSET_ADDSPACINGATPAGES ].Value <<= pItem->bAddSpacingAtPages;
+ lProperties[ OFFSET_USEOURTABSTOPS ].Value <<= pItem->bUseOurTabStops;
+ lProperties[ OFFSET_NOEXTLEADING ].Value <<= pItem->bNoExtLeading;
+ lProperties[ OFFSET_USELINESPACING ].Value <<= pItem->bUseLineSpacing;
+ lProperties[ OFFSET_ADDTABLESPACING ].Value <<= pItem->bAddTableSpacing;
+ lProperties[ OFFSET_USEOBJPOS ].Value <<= pItem->bUseObjPos;
+ lProperties[ OFFSET_USEOURTEXTWRAPPING ].Value <<= pItem->bUseOurTextWrapping;
+ lProperties[ OFFSET_CONSIDERWRAPPINGSTYLE ].Value <<= pItem->bConsiderWrappingStyle;
+ lProperties[ OFFSET_EXPANDWORDSPACE ].Value <<= pItem->bExpandWordSpace;
+ lResult[ nStep ] = lProperties;
+ ++nStep;
+ }
+
+ return lResult;
+ }
+
+ int size() const
+ {
+ return lEntries.size();
+ }
+
+ const SvtCompatibilityEntry& operator[]( int i )
+ {
+ return lEntries[i];
+ }
+
+ private:
+ vector< SvtCompatibilityEntry > lEntries;
+};
+
+class SvtCompatibilityOptions_Impl : public ConfigItem
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ SvtCompatibilityOptions_Impl();
+ ~SvtCompatibilityOptions_Impl();
+
+ //---------------------------------------------------------------------------------------------------------
+ // overloaded methods of baseclass
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short called for notify of configmanager
+ @descr These method is called from the ConfigManager before application ends or from the
+ PropertyChangeListener if the sub tree broadcasts changes. You must update your
+ internal values.
+
+ @seealso baseclass ConfigItem
+
+ @param "lPropertyNames" is the list of properties which should be updated.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Notify( const Sequence< OUString >& lPropertyNames );
+
+ /*-****************************************************************************************************//**
+ @short write changes to configuration
+ @descr These method writes the changed values into the sub tree
+ and should always called in our destructor to guarantee consistency of config data.
+
+ @seealso baseclass ConfigItem
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Commit();
+
+ //---------------------------------------------------------------------------------------------------------
+ // public interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short base implementation of public interface for "SvtCompatibilityOptions"!
+ @descr These class is used as static member of "SvtCompatibilityOptions" ...
+ => The code exist only for one time and isn't duplicated for every instance!
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear();
+ Sequence< Sequence< PropertyValue > > GetList() const;
+ void AppendItem( const ::rtl::OUString& _sName,
+ const ::rtl::OUString& _sModule,
+ bool _bUsePrtMetrics,
+ bool _bAddSpacing,
+ bool _bAddSpacingAtPages,
+ bool _bUseOurTabStops,
+ bool _bNoExtLeading,
+ bool _bUseLineSpacing,
+ bool _bAddTableSpacing,
+ bool _bUseObjPos,
+ bool _bUseOurTextWrapping,
+ bool _bConsiderWrappingStyle,
+ bool _bExpandWordSpace );
+
+ inline bool IsUsePrtDevice() const { return m_aDefOptions.bUsePrtMetrics; }
+ inline bool IsAddSpacing() const { return m_aDefOptions.bAddSpacing; }
+ inline bool IsAddSpacingAtPages() const { return m_aDefOptions.bAddSpacingAtPages; }
+ inline bool IsUseOurTabStops() const { return m_aDefOptions.bUseOurTabStops; }
+ inline bool IsNoExtLeading() const { return m_aDefOptions.bNoExtLeading; }
+ inline bool IsUseLineSpacing() const { return m_aDefOptions.bUseLineSpacing; }
+ inline bool IsAddTableSpacing() const { return m_aDefOptions.bAddTableSpacing; }
+ inline bool IsUseObjPos() const { return m_aDefOptions.bUseObjPos; }
+ inline bool IsUseOurTextWrapping() const { return m_aDefOptions.bUseOurTextWrapping; }
+ inline bool IsConsiderWrappingStyle() const { return m_aDefOptions.bConsiderWrappingStyle; }
+ inline bool IsExpandWordSpace() const { return m_aDefOptions.bExpandWordSpace; }
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return list of key names of our configuration management which represent one module tree
+ @descr These methods return the current list of key names! We need it to get needed values from our
+ configuration management and support dynamical menu item lists!
+
+ @seealso -
+
+ @param -
+ @return A list of configuration key names is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ Sequence< OUString > impl_GetPropertyNames( Sequence< OUString >& rItems );
+
+ /*-****************************************************************************************************//**
+ @short expand the list for all well known properties to destination
+ @descr -
+ @attention -
+
+ @seealso method impl_GetPropertyNames()
+
+ @param "lSource" , original list
+ @param "lDestination" , destination of operation
+ @return A list of configuration key names is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void impl_ExpandPropertyNames( const Sequence< OUString >& lSource,
+ Sequence< OUString >& lDestination );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ SvtCompatibility m_aOptions;
+ SvtCompatibilityEntry m_aDefOptions;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()
+ // Init baseclasses first
+ : ConfigItem( ROOTNODE_OPTIONS )
+ // Init member then...
+{
+ // Get names and values of all accessable menu entries and fill internal structures.
+ // See impl_GetPropertyNames() for further informations.
+ Sequence< OUString > lNodes;
+ Sequence< OUString > lNames = impl_GetPropertyNames( lNodes );
+ sal_uInt32 nCount = lNodes.getLength();
+ Sequence< Any > lValues = GetProperties( lNames );
+
+ // Safe impossible cases.
+ // We need values from ALL configuration keys.
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !( lNames.getLength()!=lValues.getLength() ), "SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ SvtCompatibilityEntry aItem;
+ sal_uInt32 nItem = 0;
+ sal_uInt32 nPosition = 0;
+
+ // Get names/values for new menu.
+ // 4 subkeys for every item!
+ bool bDefaultFound = false;
+ for( nItem = 0; nItem < nCount; ++nItem )
+ {
+ aItem.sName = lNodes[ nItem ];
+ lValues[ nPosition++ ] >>= aItem.sModule;
+ lValues[ nPosition++ ] >>= aItem.bUsePrtMetrics;
+ lValues[ nPosition++ ] >>= aItem.bAddSpacing;
+ lValues[ nPosition++ ] >>= aItem.bAddSpacingAtPages;
+ lValues[ nPosition++ ] >>= aItem.bUseOurTabStops;
+ lValues[ nPosition++ ] >>= aItem.bNoExtLeading;
+ lValues[ nPosition++ ] >>= aItem.bUseLineSpacing;
+ lValues[ nPosition++ ] >>= aItem.bAddTableSpacing;
+ lValues[ nPosition++ ] >>= aItem.bUseObjPos;
+ lValues[ nPosition++ ] >>= aItem.bUseOurTextWrapping;
+ lValues[ nPosition++ ] >>= aItem.bConsiderWrappingStyle;
+ lValues[ nPosition++ ] >>= aItem.bExpandWordSpace;
+ m_aOptions.AppendEntry( aItem );
+
+ if ( !bDefaultFound && aItem.sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False )
+ {
+ m_aDefOptions = aItem;
+ bDefaultFound = true;
+ }
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions_Impl::Notify( const Sequence< OUString >& )
+{
+ DBG_ASSERT( sal_False, "SvtCompatibilityOptions_Impl::Notify()\nNot implemented yet! I don't know how I can handle a dynamical list of unknown properties ...\n" );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions_Impl::Commit()
+{
+ // Write all properties!
+ // Delete complete set first.
+ ClearNodeSet( SETNODE_ALLFILEFORMATS );
+
+ SvtCompatibilityEntry aItem;
+ OUString sNode;
+ Sequence< PropertyValue > lPropertyValues( PROPERTYCOUNT - 1 );
+ sal_uInt32 nItem = 0;
+ sal_uInt32 nNewCount = m_aOptions.size();
+ for( nItem = 0; nItem < nNewCount; ++nItem )
+ {
+ aItem = m_aOptions[ nItem ];
+ sNode = SETNODE_ALLFILEFORMATS + PATHDELIMITER + aItem.sName + PATHDELIMITER;
+
+ lPropertyValues[ OFFSET_MODULE - 1 ].Name = sNode + PROPERTYNAME_MODULE;
+ lPropertyValues[ OFFSET_USEPRTMETRICS - 1 ].Name = sNode + PROPERTYNAME_USEPRTMETRICS;
+ lPropertyValues[ OFFSET_ADDSPACING - 1 ].Name = sNode + PROPERTYNAME_ADDSPACING;
+ lPropertyValues[ OFFSET_ADDSPACINGATPAGES - 1 ].Name = sNode + PROPERTYNAME_ADDSPACINGATPAGES;
+ lPropertyValues[ OFFSET_USEOURTABSTOPS - 1 ].Name = sNode + PROPERTYNAME_USEOURTABSTOPS;
+ lPropertyValues[ OFFSET_NOEXTLEADING - 1 ].Name = sNode + PROPERTYNAME_NOEXTLEADING;
+ lPropertyValues[ OFFSET_USELINESPACING - 1 ].Name = sNode + PROPERTYNAME_USELINESPACING;
+ lPropertyValues[ OFFSET_ADDTABLESPACING - 1 ].Name = sNode + PROPERTYNAME_ADDTABLESPACING;
+ lPropertyValues[ OFFSET_USEOBJPOS - 1 ].Name = sNode + PROPERTYNAME_USEOBJPOS;
+ lPropertyValues[ OFFSET_USEOURTEXTWRAPPING - 1 ].Name = sNode + PROPERTYNAME_USEOURTEXTWRAP;
+ lPropertyValues[ OFFSET_CONSIDERWRAPPINGSTYLE - 1 ].Name = sNode + PROPERTYNAME_CONSIDERWRAPSTYLE;
+ lPropertyValues[ OFFSET_EXPANDWORDSPACE - 1 ].Name = sNode + PROPERTYNAME_EXPANDWORDSPACE;
+
+ lPropertyValues[ OFFSET_MODULE - 1 ].Value <<= aItem.sModule;
+ lPropertyValues[ OFFSET_USEPRTMETRICS - 1 ].Value <<= aItem.bUsePrtMetrics;
+ lPropertyValues[ OFFSET_ADDSPACING - 1 ].Value <<= aItem.bAddSpacing;
+ lPropertyValues[ OFFSET_ADDSPACINGATPAGES - 1 ].Value <<= aItem.bAddSpacingAtPages;
+ lPropertyValues[ OFFSET_USEOURTABSTOPS - 1 ].Value <<= aItem.bUseOurTabStops;
+ lPropertyValues[ OFFSET_NOEXTLEADING - 1 ].Value <<= aItem.bNoExtLeading;
+ lPropertyValues[ OFFSET_USELINESPACING - 1 ].Value <<= aItem.bUseLineSpacing;
+ lPropertyValues[ OFFSET_ADDTABLESPACING - 1 ].Value <<= aItem.bAddTableSpacing;
+ lPropertyValues[ OFFSET_USEOBJPOS - 1 ].Value <<= aItem.bUseObjPos;
+ lPropertyValues[ OFFSET_USEOURTEXTWRAPPING - 1 ].Value <<= aItem.bUseOurTextWrapping;
+ lPropertyValues[ OFFSET_CONSIDERWRAPPINGSTYLE - 1 ].Value <<= aItem.bConsiderWrappingStyle;
+ lPropertyValues[ OFFSET_EXPANDWORDSPACE - 1 ].Value <<= aItem.bExpandWordSpace;
+
+ SetSetProperties( SETNODE_ALLFILEFORMATS, lPropertyValues );
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions_Impl::Clear()
+{
+ m_aOptions.Clear();
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< Sequence< PropertyValue > > SvtCompatibilityOptions_Impl::GetList() const
+{
+ Sequence< Sequence< PropertyValue > > lReturn;
+ lReturn = m_aOptions.GetList();
+ return lReturn;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+
+void SvtCompatibilityOptions_Impl::AppendItem( const ::rtl::OUString& _sName,
+ const ::rtl::OUString& _sModule,
+ bool _bUsePrtMetrics,
+ bool _bAddSpacing,
+ bool _bAddSpacingAtPages,
+ bool _bUseOurTabStops,
+ bool _bNoExtLeading,
+ bool _bUseLineSpacing,
+ bool _bAddTableSpacing,
+ bool _bUseObjPos,
+ bool _bUseOurTextWrapping,
+ bool _bConsiderWrappingStyle,
+ bool _bExpandWordSpace )
+{
+ SvtCompatibilityEntry aItem( _sName, _sModule );
+ aItem.SetUsePrtMetrics( _bUsePrtMetrics );
+ aItem.SetAddSpacing( _bAddSpacing );
+ aItem.SetAddSpacingAtPages( _bAddSpacingAtPages );
+ aItem.SetUseOurTabStops( _bUseOurTabStops );
+ aItem.SetNoExtLeading( _bNoExtLeading );
+ aItem.SetUseLineSpacing( _bUseLineSpacing );
+ aItem.SetAddTableSpacing( _bAddTableSpacing );
+ aItem.SetUseObjPos( _bUseObjPos );
+ aItem.SetUseOurTextWrapping( _bUseOurTextWrapping );
+ aItem.SetConsiderWrappingStyle( _bConsiderWrappingStyle );
+ aItem.SetExpandWordSpace( _bExpandWordSpace );
+ m_aOptions.AppendEntry( aItem );
+
+ // default item reset?
+ if ( _sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False )
+ m_aDefOptions = aItem;
+
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequence< OUString >& rItems )
+{
+ // First get ALL names of current existing list items in configuration!
+ rItems = GetNodeNames( SETNODE_ALLFILEFORMATS );
+ // expand list to result list ...
+ Sequence< OUString > lProperties( rItems.getLength() * ( PROPERTYCOUNT - 1 ) );
+ impl_ExpandPropertyNames( rItems, lProperties );
+ // Return result.
+ return lProperties;
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions_Impl::impl_ExpandPropertyNames(
+ const Sequence< OUString >& lSource, Sequence< OUString >& lDestination )
+{
+ OUString sFixPath;
+ sal_Int32 nDestStep = 0;
+ sal_Int32 nSourceCount = lSource.getLength();
+ // Copy entries to destination and expand every item with 2 supported sub properties.
+ for( sal_Int32 nSourceStep = 0; nSourceStep < nSourceCount; ++nSourceStep )
+ {
+ sFixPath = SETNODE_ALLFILEFORMATS;
+ sFixPath += PATHDELIMITER;
+ sFixPath += lSource[ nSourceStep ];
+ sFixPath += PATHDELIMITER;
+
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_MODULE;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_USEPRTMETRICS;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_ADDSPACING;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_ADDSPACINGATPAGES;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_USEOURTABSTOPS;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_NOEXTLEADING;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_USELINESPACING;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_ADDTABLESPACING;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_USEOBJPOS;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_USEOURTEXTWRAP;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_CONSIDERWRAPSTYLE;
+ ++nDestStep;
+ lDestination[nDestStep] = sFixPath;
+ lDestination[nDestStep] += PROPERTYNAME_EXPANDWORDSPACE;
+ ++nDestStep;
+ }
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtCompatibilityOptions_Impl* SvtCompatibilityOptions::m_pDataContainer = NULL;
+sal_Int32 SvtCompatibilityOptions::m_nRefCount = 0;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtCompatibilityOptions::SvtCompatibilityOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already exist!
+ if( m_pDataContainer == NULL )
+ {
+ m_pDataContainer = new SvtCompatibilityOptions_Impl;
+ ItemHolder1::holdConfigItem(E_COMPATIBILITY);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtCompatibilityOptions::~SvtCompatibilityOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions::Clear()
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->Clear();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtCompatibilityOptions::AppendItem( const ::rtl::OUString& sName,
+ const ::rtl::OUString& sModule,
+ bool bUsePrtMetrics,
+ bool bAddSpacing,
+ bool bAddSpacingAtPages,
+ bool bUseOurTabStops,
+ bool bNoExtLeading,
+ bool bUseLineSpacing,
+ bool bAddTableSpacing,
+ bool bUseObjPos,
+ bool bUseOurTextWrapping,
+ bool bConsiderWrappingStyle,
+ bool bExpandWordSpace )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->AppendItem(
+ sName, sModule, bUsePrtMetrics, bAddSpacing,
+ bAddSpacingAtPages, bUseOurTabStops, bNoExtLeading,
+ bUseLineSpacing, bAddTableSpacing, bUseObjPos,
+ bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace );
+}
+
+bool SvtCompatibilityOptions::IsUsePrtDevice() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsUsePrtDevice();
+}
+
+bool SvtCompatibilityOptions::IsAddSpacing() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsAddSpacing();
+}
+
+bool SvtCompatibilityOptions::IsAddSpacingAtPages() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsAddSpacingAtPages();
+}
+
+bool SvtCompatibilityOptions::IsUseOurTabStops() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsUseOurTabStops();
+}
+
+bool SvtCompatibilityOptions::IsNoExtLeading() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsNoExtLeading();
+}
+
+bool SvtCompatibilityOptions::IsUseLineSpacing() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsUseLineSpacing();
+}
+
+bool SvtCompatibilityOptions::IsAddTableSpacing() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsAddTableSpacing();
+}
+
+bool SvtCompatibilityOptions::IsUseObjectPositioning() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsUseObjPos();
+}
+
+bool SvtCompatibilityOptions::IsUseOurTextWrapping() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsUseOurTextWrapping();
+}
+
+bool SvtCompatibilityOptions::IsConsiderWrappingStyle() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsConsiderWrappingStyle();
+}
+
+bool SvtCompatibilityOptions::IsExpandWordSpace() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsExpandWordSpace();
+}
+
+Sequence< Sequence< PropertyValue > > SvtCompatibilityOptions::GetList() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetList();
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtCompatibilityOptions::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
+
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index a6b3bbaa1e2f..944ea0535a93 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -33,6 +33,7 @@
#include "unotools/configitem.hxx"
#include "unotools/configmgr.hxx"
#include "unotools/configpathes.hxx"
+#include
#include
#include
#include
@@ -43,6 +44,8 @@
#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -62,7 +65,7 @@ using namespace com::sun::star::container;
using namespace com::sun::star::configuration;
#define C2U(cChar) OUString::createFromAscii(cChar)
-#include // helper for implementations
+#include // helper for implementations
#ifdef DBG_UTIL
inline void lcl_CFG_DBG_EXCEPTION(const sal_Char* cText, const Exception& rEx)
@@ -82,14 +85,15 @@ catch(Exception& rEx) \
#endif
namespace utl{
- class ConfigChangeListener_Impl : public cppu::WeakImplHelper1
+ class ConfigChangeListener_Impl : public cppu::WeakImplHelper2
<
- com::sun::star::util::XChangesListener
+ com::sun::star::util::XChangesListener,
+ com::sun::star::awt::XCallback
>
{
+ public:
ConfigItem* pParent;
const Sequence< OUString > aPropertyNames;
- public:
ConfigChangeListener_Impl(ConfigItem& rItem, const Sequence< OUString >& rNames);
~ConfigChangeListener_Impl();
@@ -99,6 +103,8 @@ namespace utl{
//XEventListener
virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException);
+ //XAsyncCallback
+ virtual void SAL_CALL notify ( const Any& rData );
};
/* -----------------------------12.02.01 11:38--------------------------------
@@ -211,15 +217,25 @@ void ConfigChangeListener_Impl::changesOccurred( const ChangesEvent& rEvent ) th
if(nNotify)
{
aChangedNames.realloc(nNotify);
- pParent->CallNotify(aChangedNames);
+ Reference < com::sun::star::awt::XRequestCallback > aCallback( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.AsyncCallback") ), UNO_QUERY );
+ aCallback->addCallback( this, makeAny( aChangedNames ) );
}
}
+
+void ConfigChangeListener_Impl::notify ( const Any& rData )
+{
+ Sequence aChangedNames;
+ if ( (rData >>= aChangedNames) && pParent )
+ pParent->CallNotify(aChangedNames);
+}
+
/* -----------------------------29.08.00 16:34--------------------------------
---------------------------------------------------------------------------*/
void ConfigChangeListener_Impl::disposing( const EventObject& /*rSource*/ ) throw(RuntimeException)
{
- pParent->RemoveChangesListener();
+ if ( pParent )
+ pParent->RemoveChangesListener();
}
/* -----------------------------29.08.00 12:50--------------------------------
@@ -266,6 +282,9 @@ ConfigItem::~ConfigItem()
{
if(pImpl->pManager)
{
+ ConfigChangeListener_Impl* pListener = dynamic_cast < ConfigChangeListener_Impl* >( xChangeLstnr.get() );
+ if ( pListener )
+ pListener->pParent = 0;
RemoveChangesListener();
pImpl->pManager->RemoveConfigItem(*this);
}
@@ -304,7 +323,9 @@ void ConfigItem::CallNotify( const com::sun::star::uno::Sequence& rPro
{
if(!IsInValueChange() || pImpl->bEnableInternalNotification)
Notify(rPropertyNames);
+ NotifyListeners();
}
+
/* -----------------------------29.08.00 12:52--------------------------------
---------------------------------------------------------------------------*/
@@ -1419,5 +1440,3 @@ void ConfigItem::UnlockTree()
m_xHierarchyAccess = 0;
}
-
-
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
new file mode 100644
index 000000000000..36c79b451f45
--- /dev/null
+++ b/unotools/source/config/defaultoptions.cxx
@@ -0,0 +1,354 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: defaultoptions.cxx,v $
+ * $Revision: 1.15 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+using namespace osl;
+using namespace utl;
+using namespace rtl;
+using namespace com::sun::star::uno;
+
+// define ----------------------------------------------------------------
+
+#define ASCII_STR(s) OUString( RTL_CONSTASCII_USTRINGPARAM(s) )
+
+#define DEFAULTPATH__ADDIN 0
+#define DEFAULTPATH__AUTOCORRECT 1
+#define DEFAULTPATH__AUTOTEXT 2
+#define DEFAULTPATH__BACKUP 3
+#define DEFAULTPATH__BASIC 4
+#define DEFAULTPATH__BITMAP 5
+#define DEFAULTPATH__CONFIG 6
+#define DEFAULTPATH__DICTIONARY 7
+#define DEFAULTPATH__FAVORITES 8
+#define DEFAULTPATH__FILTER 9
+#define DEFAULTPATH__GALLERY 10
+#define DEFAULTPATH__GRAPHIC 11
+#define DEFAULTPATH__HELP 12
+#define DEFAULTPATH__LINGUISTIC 13
+#define DEFAULTPATH__MODULE 14
+#define DEFAULTPATH__PALETTE 15
+#define DEFAULTPATH__PLUGIN 16
+#define DEFAULTPATH__TEMP 17
+#define DEFAULTPATH__TEMPLATE 18
+#define DEFAULTPATH__USERCONFIG 19
+#define DEFAULTPATH__WORK 20
+#define DEFAULTPATH__USERDICTIONARY 21
+
+// class SvtDefaultOptions_Impl ------------------------------------------
+
+class SvtDefaultOptions_Impl : public utl::ConfigItem
+{
+public:
+ String m_aAddinPath;
+ String m_aAutoCorrectPath;
+ String m_aAutoTextPath;
+ String m_aBackupPath;
+ String m_aBasicPath;
+ String m_aBitmapPath;
+ String m_aConfigPath;
+ String m_aDictionaryPath;
+ String m_aFavoritesPath;
+ String m_aFilterPath;
+ String m_aGalleryPath;
+ String m_aGraphicPath;
+ String m_aHelpPath;
+ String m_aLinguisticPath;
+ String m_aModulePath;
+ String m_aPalettePath;
+ String m_aPluginPath;
+ String m_aTempPath;
+ String m_aTemplatePath;
+ String m_aUserConfigPath;
+ String m_aWorkPath;
+ String m_aUserDictionaryPath;
+
+ SvtDefaultOptions_Impl();
+
+ String GetDefaultPath( USHORT nId ) const;
+};
+
+// global ----------------------------------------------------------------
+
+static SvtDefaultOptions_Impl* pOptions = NULL;
+static sal_Int32 nRefCount = 0;
+
+typedef String SvtDefaultOptions_Impl:: *PathStrPtr;
+
+struct PathToDefaultMapping_Impl
+{
+ SvtPathOptions::Pathes _ePath;
+ PathStrPtr _pDefaultPath;
+};
+
+static PathToDefaultMapping_Impl __READONLY_DATA PathMap_Impl[] =
+{
+ { SvtPathOptions::PATH_ADDIN, &SvtDefaultOptions_Impl::m_aAddinPath },
+ { SvtPathOptions::PATH_AUTOCORRECT, &SvtDefaultOptions_Impl::m_aAutoCorrectPath },
+ { SvtPathOptions::PATH_AUTOTEXT, &SvtDefaultOptions_Impl::m_aAutoTextPath },
+ { SvtPathOptions::PATH_BACKUP, &SvtDefaultOptions_Impl::m_aBackupPath },
+ { SvtPathOptions::PATH_BASIC, &SvtDefaultOptions_Impl::m_aBasicPath },
+ { SvtPathOptions::PATH_BITMAP, &SvtDefaultOptions_Impl::m_aBitmapPath },
+ { SvtPathOptions::PATH_CONFIG, &SvtDefaultOptions_Impl::m_aConfigPath },
+ { SvtPathOptions::PATH_DICTIONARY, &SvtDefaultOptions_Impl::m_aDictionaryPath },
+ { SvtPathOptions::PATH_FAVORITES, &SvtDefaultOptions_Impl::m_aFavoritesPath },
+ { SvtPathOptions::PATH_FILTER, &SvtDefaultOptions_Impl::m_aFilterPath },
+ { SvtPathOptions::PATH_GALLERY, &SvtDefaultOptions_Impl::m_aGalleryPath },
+ { SvtPathOptions::PATH_GRAPHIC, &SvtDefaultOptions_Impl::m_aGraphicPath },
+ { SvtPathOptions::PATH_HELP, &SvtDefaultOptions_Impl::m_aHelpPath },
+ { SvtPathOptions::PATH_LINGUISTIC, &SvtDefaultOptions_Impl::m_aLinguisticPath },
+ { SvtPathOptions::PATH_MODULE, &SvtDefaultOptions_Impl::m_aModulePath },
+ { SvtPathOptions::PATH_PALETTE, &SvtDefaultOptions_Impl::m_aPalettePath },
+ { SvtPathOptions::PATH_PLUGIN, &SvtDefaultOptions_Impl::m_aPluginPath },
+ { SvtPathOptions::PATH_TEMP, &SvtDefaultOptions_Impl::m_aTempPath },
+ { SvtPathOptions::PATH_TEMPLATE, &SvtDefaultOptions_Impl::m_aTemplatePath },
+ { SvtPathOptions::PATH_USERCONFIG, &SvtDefaultOptions_Impl::m_aUserConfigPath },
+ { SvtPathOptions::PATH_WORK, &SvtDefaultOptions_Impl::m_aWorkPath }
+};
+
+// functions -------------------------------------------------------------
+
+Sequence< OUString > GetDefaultPropertyNames()
+{
+ static const char* aPropNames[] =
+ {
+ "Addin", // PATH_ADDIN
+ "AutoCorrect", // PATH_AUTOCORRECT
+ "AutoText", // PATH_AUTOTEXT
+ "Backup", // PATH_BACKUP
+ "Basic", // PATH_BASIC
+ "Bitmap", // PATH_BITMAP
+ "Config", // PATH_CONFIG
+ "Dictionary", // PATH_DICTIONARY
+ "Favorite", // PATH_FAVORITES
+ "Filter", // PATH_FILTER
+ "Gallery", // PATH_GALLERY
+ "Graphic", // PATH_GRAPHIC
+ "Help", // PATH_HELP
+ "Linguistic", // PATH_LINGUISTIC
+ "Module", // PATH_MODULE
+ "Palette", // PATH_PALETTE
+ "Plugin", // PATH_PLUGIN
+ "Temp", // PATH_TEMP
+ "Template", // PATH_TEMPLATE
+ "UserConfig", // PATH_USERCONFIG
+ "Work" // PATH_WORK
+ };
+
+ const int nCount = sizeof( aPropNames ) / sizeof( const char* );
+ Sequence< OUString > aNames( nCount );
+ OUString* pNames = aNames.getArray();
+ for ( int i = 0; i < nCount; i++ )
+ pNames[i] = OUString::createFromAscii( aPropNames[i] );
+
+ return aNames;
+}
+
+// class SvtDefaultOptions_Impl ------------------------------------------
+
+String SvtDefaultOptions_Impl::GetDefaultPath( USHORT nId ) const
+{
+ String aRet;
+ USHORT nIdx = 0;
+
+ while ( PathMap_Impl[nIdx]._ePath <= SvtPathOptions::PATH_WORK )
+ {
+ if ( nId == PathMap_Impl[nIdx]._ePath && PathMap_Impl[nIdx]._pDefaultPath )
+ {
+ aRet = this->*(PathMap_Impl[nIdx]._pDefaultPath);
+ if ( nId == SvtPathOptions::PATH_ADDIN ||
+ nId == SvtPathOptions::PATH_FILTER ||
+ nId == SvtPathOptions::PATH_HELP ||
+ nId == SvtPathOptions::PATH_MODULE ||
+ nId == SvtPathOptions::PATH_PLUGIN )
+ {
+ String aTmp;
+ ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aRet, aTmp );
+ aRet = aTmp;
+ }
+
+ break;
+ }
+ ++nIdx;
+ }
+
+ return aRet;
+}
+
+// -----------------------------------------------------------------------
+
+SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( ASCII_STR("Office.Common/Path/Default") )
+{
+ /*ConfigManager* pCfgMgr =*/ ConfigManager::GetConfigManager();
+ Sequence< OUString > aNames = GetDefaultPropertyNames();
+ Sequence< Any > aValues = GetProperties( aNames );
+ EnableNotification( aNames );
+ const Any* pValues = aValues.getConstArray();
+ DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
+ if ( aValues.getLength() == aNames.getLength() )
+ {
+ SvtPathOptions aPathOpt;
+ OUString aTempStr, aFullPath;
+
+ for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
+ {
+ if ( pValues[nProp].hasValue() )
+ {
+ switch ( pValues[nProp].getValueTypeClass() )
+ {
+ case ::com::sun::star::uno::TypeClass_STRING :
+ {
+ // multi pathes
+ if ( pValues[nProp] >>= aTempStr )
+ aFullPath = aPathOpt.SubstituteVariable( aTempStr );
+ else
+ {
+ DBG_ERRORFILE( "any operator >>= failed" );
+ }
+ break;
+ }
+
+ case ::com::sun::star::uno::TypeClass_SEQUENCE :
+ {
+ // single pathes
+ aFullPath = OUString();
+ Sequence < OUString > aList;
+ if ( pValues[nProp] >>= aList )
+ {
+ sal_Int32 nCount = aList.getLength();
+ for ( sal_Int32 nPosition = 0; nPosition < nCount; ++nPosition )
+ {
+ aTempStr = aPathOpt.SubstituteVariable( aList[ nPosition ] );
+ aFullPath += aTempStr;
+ if ( nPosition < nCount-1 )
+ aFullPath += OUString( RTL_CONSTASCII_USTRINGPARAM(";") );
+ }
+ }
+ else
+ {
+ DBG_ERRORFILE( "any operator >>= failed" );
+ }
+ break;
+ }
+
+ default:
+ {
+ DBG_ERRORFILE( "Wrong any type" );
+ }
+ }
+
+ switch ( nProp )
+ {
+ case DEFAULTPATH__ADDIN: m_aAddinPath = String( aFullPath ); break;
+ case DEFAULTPATH__AUTOCORRECT: m_aAutoCorrectPath = String( aFullPath ); break;
+ case DEFAULTPATH__AUTOTEXT: m_aAutoTextPath = String( aFullPath ); break;
+ case DEFAULTPATH__BACKUP: m_aBackupPath = String( aFullPath ); break;
+ case DEFAULTPATH__BASIC: m_aBasicPath = String( aFullPath ); break;
+ case DEFAULTPATH__BITMAP: m_aBitmapPath = String( aFullPath ); break;
+ case DEFAULTPATH__CONFIG: m_aConfigPath = String( aFullPath ); break;
+ case DEFAULTPATH__DICTIONARY: m_aDictionaryPath = String( aFullPath ); break;
+ case DEFAULTPATH__FAVORITES: m_aFavoritesPath = String( aFullPath ); break;
+ case DEFAULTPATH__FILTER: m_aFilterPath = String( aFullPath ); break;
+ case DEFAULTPATH__GALLERY: m_aGalleryPath = String( aFullPath ); break;
+ case DEFAULTPATH__GRAPHIC: m_aGraphicPath = String( aFullPath ); break;
+ case DEFAULTPATH__HELP: m_aHelpPath = String( aFullPath ); break;
+ case DEFAULTPATH__LINGUISTIC: m_aLinguisticPath = String( aFullPath ); break;
+ case DEFAULTPATH__MODULE: m_aModulePath = String( aFullPath ); break;
+ case DEFAULTPATH__PALETTE: m_aPalettePath = String( aFullPath ); break;
+ case DEFAULTPATH__PLUGIN: m_aPluginPath = String( aFullPath ); break;
+ case DEFAULTPATH__TEMP: m_aTempPath = String( aFullPath ); break;
+ case DEFAULTPATH__TEMPLATE: m_aTemplatePath = String( aFullPath ); break;
+ case DEFAULTPATH__USERCONFIG: m_aUserConfigPath = String( aFullPath ); break;
+ case DEFAULTPATH__WORK: m_aWorkPath = String( aFullPath ); break;
+ case DEFAULTPATH__USERDICTIONARY: m_aUserDictionaryPath = String( aFullPath );break;
+
+ default:
+ DBG_ERRORFILE( "invalid index to load a default path" );
+ }
+ }
+ }
+ }
+}
+
+// class SvtDefaultOptions -----------------------------------------------
+namespace { struct lclMutex : public rtl::Static< ::osl::Mutex, lclMutex > {}; }
+
+SvtDefaultOptions::SvtDefaultOptions()
+{
+ // Global access, must be guarded (multithreading)
+ ::osl::MutexGuard aGuard( lclMutex::get() );
+ if ( !pOptions )
+ {
+ pOptions = new SvtDefaultOptions_Impl;
+ ItemHolder1::holdConfigItem(E_DEFAULTOPTIONS);
+ }
+ ++nRefCount;
+ pImp = pOptions;
+}
+
+// -----------------------------------------------------------------------
+
+SvtDefaultOptions::~SvtDefaultOptions()
+{
+ // Global access, must be guarded (multithreading)
+ ::osl::MutexGuard aGuard( lclMutex::get() );
+ if ( !--nRefCount )
+ {
+ if ( pOptions->IsModified() )
+ pOptions->Commit();
+ DELETEZ( pOptions );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+String SvtDefaultOptions::GetDefaultPath( USHORT nId ) const
+{
+ return pImp->GetDefaultPath( nId );
+}
+
diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx
new file mode 100644
index 000000000000..d3fca4350a67
--- /dev/null
+++ b/unotools/source/config/dynamicmenuoptions.cxx
@@ -0,0 +1,923 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dynamicmenuoptions.cxx,v $
+ * $Revision: 1.18 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#ifndef GCC
+#endif
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef __SGI_STL_VECTOR
+#include
+#endif
+
+#include
+
+#include
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::std ;
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+using namespace ::com::sun::star::beans ;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_MENUS OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Menus/" ))
+#define PATHDELIMITER OUString(RTL_CONSTASCII_USTRINGPARAM("/" ))
+
+#define SETNODE_NEWMENU OUString(RTL_CONSTASCII_USTRINGPARAM("New" ))
+#define SETNODE_WIZARDMENU OUString(RTL_CONSTASCII_USTRINGPARAM("Wizard" ))
+#define SETNODE_HELPBOOKMARKS OUString(RTL_CONSTASCII_USTRINGPARAM("HelpBookmarks" ))
+
+#define PROPERTYNAME_URL DYNAMICMENU_PROPERTYNAME_URL
+#define PROPERTYNAME_TITLE DYNAMICMENU_PROPERTYNAME_TITLE
+#define PROPERTYNAME_IMAGEIDENTIFIER DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER
+#define PROPERTYNAME_TARGETNAME DYNAMICMENU_PROPERTYNAME_TARGETNAME
+
+#define PROPERTYCOUNT 4
+
+#define OFFSET_URL 0
+#define OFFSET_TITLE 1
+#define OFFSET_IMAGEIDENTIFIER 2
+#define OFFSET_TARGETNAME 3
+
+#define PATHPREFIX_SETUP OUString(RTL_CONSTASCII_USTRINGPARAM("m" ))
+#define PATHPREFIX_USER OUString(RTL_CONSTASCII_USTRINGPARAM("u" ))
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+/*-****************************************************************************************************************
+ @descr struct to hold information about one menu entry.
+****************************************************************************************************************-*/
+struct SvtDynMenuEntry
+{
+ public:
+ SvtDynMenuEntry() {};
+
+ SvtDynMenuEntry( const OUString& sNewURL ,
+ const OUString& sNewTitle ,
+ const OUString& sNewImageIdentifier ,
+ const OUString& sNewTargetName )
+ {
+ sURL = sNewURL ;
+ sTitle = sNewTitle ;
+ sImageIdentifier = sNewImageIdentifier ;
+ sTargetName = sNewTargetName ;
+ }
+
+ public:
+ OUString sName ;
+ OUString sURL ;
+ OUString sTitle ;
+ OUString sImageIdentifier ;
+ OUString sTargetName ;
+};
+
+/*-****************************************************************************************************************
+ @descr support simple menu structures and operations on it
+****************************************************************************************************************-*/
+class SvtDynMenu
+{
+ public:
+ //---------------------------------------------------------------------------------------------------------
+ // append setup written menu entry
+ // Don't touch name of entry. It was defined by setup and must be the same everytime!
+ // Look for double menu entries here too ... may be some seperator items are supeflous ...
+ void AppendSetupEntry( const SvtDynMenuEntry& rEntry )
+ {
+ if(
+ ( lSetupEntries.size() < 1 ) ||
+ ( lSetupEntries.rbegin()->sURL != rEntry.sURL )
+ )
+ {
+ lSetupEntries.push_back( rEntry );
+ }
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // append user specific menu entry
+ // We must find unique name for it by using special prefix
+ // and next count of user setted entries!
+ // Look for double menu entries here too ... may be some seperator items are supeflous ...
+ void AppendUserEntry( SvtDynMenuEntry& rEntry )
+ {
+ if(
+ ( lUserEntries.size() < 1 ) ||
+ ( lUserEntries.rbegin()->sURL != rEntry.sURL )
+ )
+ {
+ rEntry.sName = PATHPREFIX_USER;
+ rEntry.sName += OUString::valueOf( (sal_Int32)impl_getNextUserEntryNr() );
+ lUserEntries.push_back( rEntry );
+ }
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // the only way to free memory!
+ void Clear()
+ {
+ lSetupEntries.clear();
+ lUserEntries.clear();
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // convert internal list to external format
+ // for using it on right menus realy
+ // Notice: We build a property list with 4 entries and set it on result list then.
+ // The while-loop starts with pointer on internal member list lSetupEntries, change to
+ // lUserEntries then and stop after that with NULL!
+ // Separator entries will be packed in another way then normal entries! We define
+ // special strings "sEmpty" and "sSeperator" to perform too ...
+ Sequence< Sequence< PropertyValue > > GetList() const
+ {
+ sal_Int32 nSetupCount = (sal_Int32)lSetupEntries.size();
+ sal_Int32 nUserCount = (sal_Int32)lUserEntries.size();
+ sal_Int32 nStep = 0;
+ Sequence< PropertyValue > lProperties ( PROPERTYCOUNT );
+ Sequence< Sequence< PropertyValue > > lResult ( nSetupCount+nUserCount );
+ OUString sSeperator ( RTL_CONSTASCII_USTRINGPARAM("private:separator") );
+ OUString sEmpty ;
+ const vector< SvtDynMenuEntry >* pList = &lSetupEntries;
+
+ lProperties[OFFSET_URL ].Name = PROPERTYNAME_URL ;
+ lProperties[OFFSET_TITLE ].Name = PROPERTYNAME_TITLE ;
+ lProperties[OFFSET_IMAGEIDENTIFIER].Name = PROPERTYNAME_IMAGEIDENTIFIER ;
+ lProperties[OFFSET_TARGETNAME ].Name = PROPERTYNAME_TARGETNAME ;
+
+ while( pList != NULL )
+ {
+ for( vector< SvtDynMenuEntry >::const_iterator pItem =pList->begin();
+ pItem!=pList->end() ;
+ ++pItem )
+ {
+ if( pItem->sURL == sSeperator )
+ {
+ lProperties[OFFSET_URL ].Value <<= sSeperator ;
+ lProperties[OFFSET_TITLE ].Value <<= sEmpty ;
+ lProperties[OFFSET_IMAGEIDENTIFIER ].Value <<= sEmpty ;
+ lProperties[OFFSET_TARGETNAME ].Value <<= sEmpty ;
+ }
+ else
+ {
+ lProperties[OFFSET_URL ].Value <<= pItem->sURL ;
+ lProperties[OFFSET_TITLE ].Value <<= pItem->sTitle ;
+ lProperties[OFFSET_IMAGEIDENTIFIER ].Value <<= pItem->sImageIdentifier;
+ lProperties[OFFSET_TARGETNAME ].Value <<= pItem->sTargetName ;
+ }
+ lResult[nStep] = lProperties;
+ ++nStep;
+ }
+ if( pList == &lSetupEntries )
+ pList = &lUserEntries;
+ else
+ pList = NULL;
+ }
+ return lResult;
+ }
+
+ private:
+ //---------------------------------------------------------------------------------------------------------
+ // search for an entry named "ux" with x=[0..i] inside our menu
+ // which has set highest number x. So we can add another user entry.
+ sal_Int32 impl_getNextUserEntryNr() const
+ {
+ sal_Int32 nNr = 0;
+ for( vector< SvtDynMenuEntry >::const_iterator pItem =lUserEntries.begin();
+ pItem!=lUserEntries.end() ;
+ ++pItem )
+ {
+ if( pItem->sName.compareTo( PATHPREFIX_USER, 1 ) == 0 )
+ {
+ OUString sNr = pItem->sName.copy( 1, pItem->sName.getLength()-1 );
+ sal_Int32 nCheckNr = sNr.toInt32();
+ if( nCheckNr > nNr )
+ nNr = nCheckNr;
+ }
+ }
+ // Attention: Code isn't prepared for recyling of unused fragmented numbers!
+ // If we reach end of sal_Int32 range ... we must stop further working ...
+ // But I think nobody expand a menu to more then 1000 ... 100000 ... entries ... or?
+ DBG_ASSERT( !(nNr>0x7fffffff), "Menu::impl_getNextUserEntryNr()\nUser count can be out of range next time ...\n" );
+ return nNr;
+ }
+
+ private:
+ vector< SvtDynMenuEntry > lSetupEntries;
+ vector< SvtDynMenuEntry > lUserEntries ;
+};
+
+class SvtDynamicMenuOptions_Impl : public ConfigItem
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ SvtDynamicMenuOptions_Impl();
+ ~SvtDynamicMenuOptions_Impl();
+
+ //---------------------------------------------------------------------------------------------------------
+ // overloaded methods of baseclass
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short called for notify of configmanager
+ @descr These method is called from the ConfigManager before application ends or from the
+ PropertyChangeListener if the sub tree broadcasts changes. You must update your
+ internal values.
+
+ @seealso baseclass ConfigItem
+
+ @param "lPropertyNames" is the list of properties which should be updated.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Notify( const Sequence< OUString >& lPropertyNames );
+
+ /*-****************************************************************************************************//**
+ @short write changes to configuration
+ @descr These method writes the changed values into the sub tree
+ and should always called in our destructor to guarantee consistency of config data.
+
+ @seealso baseclass ConfigItem
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Commit();
+
+ //---------------------------------------------------------------------------------------------------------
+ // public interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short base implementation of public interface for "SvtDynamicMenuOptions"!
+ @descr These class is used as static member of "SvtDynamicMenuOptions" ...
+ => The code exist only for one time and isn't duplicated for every instance!
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear ( EDynamicMenuType eMenu );
+ Sequence< Sequence< PropertyValue > > GetMenu ( EDynamicMenuType eMenu ) const ;
+ void AppendItem ( EDynamicMenuType eMenu ,
+ const OUString& sURL ,
+ const OUString& sTitle ,
+ const OUString& sImageIdentifier,
+ const OUString& sTargetName );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return list of key names of our configuration management which represent oue module tree
+ @descr These methods return the current list of key names! We need it to get needed values from our
+ configuration management and support dynamical menu item lists!
+
+ @seealso -
+
+ @param "nNewCount" , returns count of menu entries for "new"
+ @param "nWizardCount" , returns count of menu entries for "wizard"
+ @return A list of configuration key names is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ Sequence< OUString > impl_GetPropertyNames( sal_uInt32& nNewCount, sal_uInt32& nWizardCount, sal_uInt32& nHelpBookmarksCount );
+
+ /*-****************************************************************************************************//**
+ @short sort given source list and expand it for all well known properties to destination
+ @descr We must support sets of entries with count inside the name .. but some of them could be missing!
+ e.g. s1-s2-s3-s0-u1-s6-u5-u7
+ Then we must sort it by name and expand it to the follow one:
+ sSetNode/s0/URL
+ sSetNode/s0/Title
+ sSetNode/s0/...
+ sSetNode/s1/URL
+ sSetNode/s1/Title
+ sSetNode/s1/...
+ ...
+ sSetNode/s6/URL
+ sSetNode/s6/Title
+ sSetNode/s6/...
+ sSetNode/u1/URL
+ sSetNode/u1/Title
+ sSetNode/u1/...
+ ...
+ sSetNode/u7/URL
+ sSetNode/u7/Title
+ sSetNode/u7/...
+ Rules: We start with all setup written entries names "sx" and x=[0..n].
+ Then we handle all "ux" items. Inside these blocks we sort it ascending by number.
+
+ @attention We add these expanded list to the end of given "lDestination" list!
+ So we must start on "lDestination.getLength()".
+ Reallocation of memory of destination list is done by us!
+
+ @seealso method impl_GetPropertyNames()
+
+ @param "lSource" , original list (e.g. [m1-m2-m3-m6-m0] )
+ @param "lDestination" , destination of operation
+ @param "sSetNode" , name of configuration set to build complete path
+ @return A list of configuration key names is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void impl_SortAndExpandPropertyNames( const Sequence< OUString >& lSource ,
+ Sequence< OUString >& lDestination ,
+ const OUString& sSetNode );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ SvtDynMenu m_aNewMenu ;
+ SvtDynMenu m_aWizardMenu ;
+ SvtDynMenu m_aHelpBookmarksMenu ;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtDynamicMenuOptions_Impl::SvtDynamicMenuOptions_Impl()
+ // Init baseclasses first
+ : ConfigItem( ROOTNODE_MENUS )
+ // Init member then...
+{
+ // Get names and values of all accessable menu entries and fill internal structures.
+ // See impl_GetPropertyNames() for further informations.
+ sal_uInt32 nNewCount = 0;
+ sal_uInt32 nWizardCount = 0;
+ sal_uInt32 nHelpBookmarksCount = 0;
+ Sequence< OUString > lNames = impl_GetPropertyNames ( nNewCount ,
+ nWizardCount ,
+ nHelpBookmarksCount );
+ Sequence< Any > lValues = GetProperties ( lNames );
+
+ // Safe impossible cases.
+ // We need values from ALL configuration keys.
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !(lNames.getLength()!=lValues.getLength()), "SvtDynamicMenuOptions_Impl::SvtDynamicMenuOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ // Copy values from list in right order to ouer internal member.
+ // Attention: List for names and values have an internal construction pattern!
+ //
+ // first "New" menu ...
+ // Name Value
+ // /New/1/URL "private:factory/swriter"
+ // /New/1/Title "Neues Writer Dokument"
+ // /New/1/ImageIdentifier "icon_writer"
+ // /New/1/TargetName "_blank"
+ //
+ // /New/2/URL "private:factory/scalc"
+ // /New/2/Title "Neues Calc Dokument"
+ // /New/2/ImageIdentifier "icon_calc"
+ // /New/2/TargetName "_blank"
+ //
+ // second "Wizard" menu ...
+ // /Wizard/1/URL "file://b"
+ // /Wizard/1/Title "MalWas"
+ // /Wizard/1/ImageIdentifier "icon_?"
+ // /Wizard/1/TargetName "_self"
+ //
+ // ... and so on ...
+
+ sal_uInt32 nItem = 0 ;
+ sal_uInt32 nPosition = 0 ;
+ OUString sName ;
+
+ // We must use these one instance object(!) to get information about installed modules.
+ // These information are used to filter menu entries wich need not installed modules ...
+ // Such entries shouldnt be available then!
+ // see impl_IsEntrySupported() too
+ SvtModuleOptions aModuleOptions;
+
+ // Get names/values for new menu.
+ // 4 subkeys for every item!
+ for( nItem=0; nItem>= aItem.sURL ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTitle ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sImageIdentifier ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTargetName ;
+ ++nPosition;
+ m_aNewMenu.AppendSetupEntry( aItem );
+ }
+
+ // Attention: Don't reset nPosition here!
+
+ // Get names/values for wizard menu.
+ // 4 subkeys for every item!
+ for( nItem=0; nItem>= aItem.sURL ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTitle ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sImageIdentifier ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTargetName ;
+ ++nPosition;
+ m_aWizardMenu.AppendSetupEntry( aItem );
+ }
+
+ // Attention: Don't reset nPosition here!
+
+ // Get names/values for wizard menu.
+ // 4 subkeys for every item!
+ for( nItem=0; nItem>= aItem.sURL ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTitle ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sImageIdentifier ;
+ ++nPosition;
+ lValues[nPosition] >>= aItem.sTargetName ;
+ ++nPosition;
+ m_aHelpBookmarksMenu.AppendSetupEntry( aItem );
+ }
+
+/*TODO: Not used in the moment! see Notify() ...
+ // Enable notification mechanism of ouer baseclass.
+ // We need it to get information about changes outside these class on ouer used configuration keys!
+ EnableNotification( lNames );
+*/
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtDynamicMenuOptions_Impl::~SvtDynamicMenuOptions_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtDynamicMenuOptions_Impl::Notify( const Sequence< OUString >& )
+{
+ DBG_ASSERT( sal_False, "SvtDynamicMenuOptions_Impl::Notify()\nNot implemented yet! I don't know how I can handle a dynamical list of unknown properties ...\n" );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtDynamicMenuOptions_Impl::Commit()
+{
+ DBG_ERROR( "SvtDynamicMenuOptions_Impl::Commit()\nNot implemented yet!\n" );
+ /*
+ // Write all properties!
+ // Delete complete sets first.
+ ClearNodeSet( SETNODE_NEWMENU );
+ ClearNodeSet( SETNODE_WIZARDMENU );
+ ClearNodeSet( SETNODE_HELPBOOKMARKS );
+
+ MenuEntry aItem ;
+ OUString sNode ;
+ Sequence< PropertyValue > lPropertyValues( PROPERTYCOUNT );
+ sal_uInt32 nItem = 0 ;
+
+ // Copy "new" menu entries to save-list!
+ sal_uInt32 nNewCount = m_aNewMenu.size();
+ for( nItem=0; nItem > SvtDynamicMenuOptions_Impl::GetMenu( EDynamicMenuType eMenu ) const
+{
+ Sequence< Sequence< PropertyValue > > lReturn;
+ switch( eMenu )
+ {
+ case E_NEWMENU : {
+ lReturn = m_aNewMenu.GetList();
+ }
+ break;
+
+ case E_WIZARDMENU : {
+ lReturn = m_aWizardMenu.GetList();
+ }
+ break;
+
+ case E_HELPBOOKMARKS : {
+ lReturn = m_aHelpBookmarksMenu.GetList();
+ }
+ break;
+ }
+ return lReturn;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtDynamicMenuOptions_Impl::AppendItem( EDynamicMenuType eMenu ,
+ const OUString& sURL ,
+ const OUString& sTitle ,
+ const OUString& sImageIdentifier,
+ const OUString& sTargetName )
+{
+ SvtDynMenuEntry aItem( sURL, sTitle, sImageIdentifier, sTargetName );
+
+ switch( eMenu )
+ {
+ case E_NEWMENU : {
+ m_aNewMenu.AppendUserEntry( aItem );
+ SetModified();
+ }
+ break;
+
+ case E_WIZARDMENU : {
+ m_aWizardMenu.AppendUserEntry( aItem );
+ SetModified();
+ }
+ break;
+
+ case E_HELPBOOKMARKS : {
+ m_aHelpBookmarksMenu.AppendUserEntry( aItem );
+ SetModified();
+ }
+ break;
+ }
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Sequence< OUString > SvtDynamicMenuOptions_Impl::impl_GetPropertyNames( sal_uInt32& nNewCount, sal_uInt32& nWizardCount, sal_uInt32& nHelpBookmarksCount )
+{
+ // First get ALL names of current existing list items in configuration!
+ Sequence< OUString > lNewItems = GetNodeNames( SETNODE_NEWMENU );
+ Sequence< OUString > lWizardItems = GetNodeNames( SETNODE_WIZARDMENU );
+ Sequence< OUString > lHelpBookmarksItems = GetNodeNames( SETNODE_HELPBOOKMARKS );
+
+ // Get information about list counts ...
+ nNewCount = lNewItems.getLength ();
+ nWizardCount = lWizardItems.getLength ();
+ nHelpBookmarksCount = lHelpBookmarksItems.getLength();
+
+ // Sort and expand all three list to result list ...
+ Sequence< OUString > lProperties;
+ impl_SortAndExpandPropertyNames( lNewItems , lProperties, SETNODE_NEWMENU );
+ impl_SortAndExpandPropertyNames( lWizardItems , lProperties, SETNODE_WIZARDMENU );
+ impl_SortAndExpandPropertyNames( lHelpBookmarksItems, lProperties, SETNODE_HELPBOOKMARKS );
+
+ // Return result.
+ return lProperties;
+}
+
+//*****************************************************************************************************************
+// private helper
+//*****************************************************************************************************************
+class CountWithPrefixSort
+{
+ public:
+ int operator() ( const OUString& s1 ,
+ const OUString& s2 ) const
+ {
+ // Get order numbers from entry name without prefix.
+ // e.g. "m10" => 10
+ // "m5" => 5
+ sal_Int32 n1 = s1.copy( 1, s1.getLength()-1 ).toInt32();
+ sal_Int32 n2 = s2.copy( 1, s2.getLength()-1 ).toInt32();
+ // MUST be in [0,1] ... because it's a difference between
+ // insert-positions of given entries in sorted list!
+ return( n1& lSource ,
+ Sequence< OUString >& lDestination ,
+ const OUString& sSetNode )
+{
+ OUString sFixPath ;
+ vector< OUString > lTemp ;
+ sal_Int32 nSourceCount = lSource.getLength() ;
+ sal_Int32 nDestinationStep = lDestination.getLength() ; // start on end of current list ...!
+
+ lDestination.realloc( (nSourceCount*PROPERTYCOUNT)+nDestinationStep ); // get enough memory for copy operations after nDestination ...
+
+ // Copy all items to temp. vector to use fast sort operations :-)
+ for( sal_Int32 nSourceStep=0; nSourceStep::const_iterator pItem =lTemp.begin() ;
+ pItem!=lTemp.end() ;
+ ++pItem )
+ {
+ sFixPath = sSetNode ;
+ sFixPath += PATHDELIMITER ;
+ sFixPath += *pItem ;
+ sFixPath += PATHDELIMITER ;
+
+ lDestination[nDestinationStep] = sFixPath ;
+ lDestination[nDestinationStep] += PROPERTYNAME_URL ;
+ ++nDestinationStep;
+ lDestination[nDestinationStep] = sFixPath ;
+ lDestination[nDestinationStep] += PROPERTYNAME_TITLE ;
+ ++nDestinationStep;
+ lDestination[nDestinationStep] = sFixPath ;
+ lDestination[nDestinationStep] += PROPERTYNAME_IMAGEIDENTIFIER ;
+ ++nDestinationStep;
+ lDestination[nDestinationStep] = sFixPath ;
+ lDestination[nDestinationStep] += PROPERTYNAME_TARGETNAME ;
+ ++nDestinationStep;
+ }
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtDynamicMenuOptions_Impl* SvtDynamicMenuOptions::m_pDataContainer = NULL ;
+sal_Int32 SvtDynamicMenuOptions::m_nRefCount = 0 ;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtDynamicMenuOptions::SvtDynamicMenuOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already exist!
+ if( m_pDataContainer == NULL )
+ {
+ m_pDataContainer = new SvtDynamicMenuOptions_Impl;
+ ItemHolder1::holdConfigItem(E_DYNAMICMENUOPTIONS);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtDynamicMenuOptions::~SvtDynamicMenuOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtDynamicMenuOptions::Clear( EDynamicMenuType eMenu )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->Clear( eMenu );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< Sequence< PropertyValue > > SvtDynamicMenuOptions::GetMenu( EDynamicMenuType eMenu ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetMenu( eMenu );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtDynamicMenuOptions::AppendItem( EDynamicMenuType eMenu ,
+ const OUString& sURL ,
+ const OUString& sTitle ,
+ const OUString& sImageIdentifier,
+ const OUString& sTargetName )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->AppendItem( eMenu, sURL, sTitle, sImageIdentifier, sTargetName );
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtDynamicMenuOptions::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
new file mode 100644
index 000000000000..3155f4ac2fa7
--- /dev/null
+++ b/unotools/source/config/eventcfg.cxx
@@ -0,0 +1,458 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: eventcfg.cxx,v $
+ * $Revision: 1.8.24.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef __SGI_STL_HASH_MAP
+#include
+#endif
+#include
+#include
+
+#include
+
+#include
+
+using namespace ::std ;
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+using namespace ::com::sun::star;
+
+#define ROOTNODE_EVENTS OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Events/ApplicationEvents" ))
+#define PATHDELIMITER OUString(RTL_CONSTASCII_USTRINGPARAM("/"))
+#define SETNODE_BINDINGS OUString(RTL_CONSTASCII_USTRINGPARAM("Bindings" ))
+#define PROPERTYNAME_BINDINGURL OUString(RTL_CONSTASCII_USTRINGPARAM("BindingURL"))
+
+const char* pEventAsciiNames[] =
+{
+"OnStartApp",
+"OnCloseApp",
+"OnCreate",
+"OnNew",
+"OnLoadFinished",
+"OnLoad",
+"OnPrepareUnload",
+"OnUnload",
+"OnSave",
+"OnSaveDone",
+"OnSaveFailed",
+"OnSaveAs",
+"OnSaveAsDone",
+"OnSaveAsFailed",
+"OnCopyTo",
+"OnCopyToDone",
+"OnCopyToFailed",
+"OnFocus",
+"OnUnfocus",
+"OnPrint",
+"OnViewCreated",
+"OnPrepareViewClosing",
+"OnViewClosed",
+"OnModifyChanged",
+"OnTitleChanged",
+"OnVisAreaChanged",
+"OnModeChanged",
+"OnStorageChanged"
+};
+
+GlobalEventConfig_Impl::GlobalEventConfig_Impl()
+ : ConfigItem( ROOTNODE_EVENTS, CONFIG_MODE_IMMEDIATE_UPDATE )
+{
+ // the supported event names
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STARTAPP] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEAPP] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DOCCREATED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CREATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_LOADFINISHED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_OPENDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_ACTIVATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DEACTIVATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PRINTDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VIEWCREATED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEVIEW] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEVIEW] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODIFYCHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_TITLECHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VISAREACHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODECHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STORAGECHANGED] ) );
+
+ initBindingInfo();
+
+/*TODO: Not used in the moment! see Notify() ...
+ // Enable notification mechanism of our baseclass.
+ // We need it to get information about changes outside these class on our used configuration keys! */
+ Sequence< OUString > aNotifySeq( 1 );
+ aNotifySeq[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "Events" ));
+ EnableNotification( aNotifySeq, sal_True );
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+GlobalEventConfig_Impl::~GlobalEventConfig_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+::rtl::OUString GlobalEventConfig_Impl::GetEventName( sal_Int32 nIndex )
+{
+ if ( nIndex < (sal_Int32) m_supportedEvents.size() )
+ return m_supportedEvents[nIndex];
+ else
+ return rtl::OUString();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void GlobalEventConfig_Impl::Notify( const Sequence< OUString >& )
+{
+ MutexGuard aGuard( GlobalEventConfig::GetOwnStaticMutex() );
+
+ initBindingInfo();
+
+ // dont forget to update all existing frames and her might cached dispatch objects!
+ // But look for already killed frames. We hold weak references instead of hard ones ...
+ for (FrameVector::const_iterator pIt = m_lFrames.begin();
+ pIt != m_lFrames.end() ;
+ ++pIt )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame(pIt->get(), ::com::sun::star::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->contextChanged();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void GlobalEventConfig_Impl::Commit()
+{
+ //DF need to check it this is correct??
+ OSL_TRACE("In GlobalEventConfig_Impl::Commit");
+ EventBindingHash::const_iterator it = m_eventBindingHash.begin();
+ EventBindingHash::const_iterator it_end = m_eventBindingHash.end();
+ // clear the existing nodes
+ ClearNodeSet( SETNODE_BINDINGS );
+ Sequence< beans::PropertyValue > seqValues( 1 );
+ OUString sNode;
+ static const OUString sPrefix(SETNODE_BINDINGS + PATHDELIMITER + OUString::createFromAscii("BindingType['"));
+ static const OUString sPostfix(OUString::createFromAscii("']") + PATHDELIMITER + PROPERTYNAME_BINDINGURL);
+ //step through the list of events
+ for(int i=0;it!=it_end;++it,++i)
+ {
+ //no point in writing out empty bindings!
+ if(it->second.getLength() == 0 )
+ continue;
+ sNode = sPrefix + it->first + sPostfix;
+ OSL_TRACE("writing binding for: %s",::rtl::OUStringToOString(sNode , RTL_TEXTENCODING_ASCII_US ).pData->buffer);
+ seqValues[ 0 ].Name = sNode;
+ seqValues[ 0 ].Value <<= it->second;
+ //write the data to the registry
+ SetSetProperties(SETNODE_BINDINGS,seqValues);
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void GlobalEventConfig_Impl::EstablishFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
+{
+ // check if frame already exists inside list
+ // ignore double registrations
+ // every frame must be notified one times only!
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > xWeak(xFrame);
+ FrameVector::const_iterator pIt = ::std::find(m_lFrames.begin(), m_lFrames.end(), xWeak);
+ if (pIt == m_lFrames.end())
+ m_lFrames.push_back(xWeak);
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+void GlobalEventConfig_Impl::initBindingInfo()
+{
+ // Get ALL names of current existing list items in configuration!
+ Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::CONFIG_NAME_LOCAL_PATH );
+
+ OUString aSetNode( SETNODE_BINDINGS );
+ aSetNode += PATHDELIMITER;
+
+ OUString aCommandKey( PATHDELIMITER );
+ aCommandKey += PROPERTYNAME_BINDINGURL;
+
+ // Expand all keys
+ Sequence< OUString > lMacros(1);
+ for (sal_Int32 i=0; ibuffer);
+ Sequence< Any > lValues = GetProperties( lMacros );
+ OUString sMacroURL;
+ if( lValues.getLength() > 0 )
+ {
+ lValues[0] >>= sMacroURL;
+ sal_Int32 startIndex = lEventNames[i].indexOf('\'');
+ sal_Int32 endIndex = lEventNames[i].lastIndexOf('\'');
+ if( startIndex >=0 && endIndex > 0 )
+ {
+ startIndex++;
+ OUString eventName = lEventNames[i].copy(startIndex,endIndex-startIndex);
+ m_eventBindingHash[ eventName ] = sMacroURL;
+ }
+ }
+ }
+}
+
+Reference< container::XNameReplace > SAL_CALL GlobalEventConfig_Impl::getEvents() throw (::com::sun::star::uno::RuntimeException)
+{
+ //how to return this object as an XNameReplace?
+ Reference< container::XNameReplace > ret;
+ return ret;
+}
+
+void SAL_CALL GlobalEventConfig_Impl::replaceByName( const OUString& aName, const Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
+{
+ Sequence< beans::PropertyValue > props;
+ //DF should we prepopulate the hash with a list of valid event Names?
+ if( sal_False == ( aElement >>= props ) )
+ {
+ throw lang::IllegalArgumentException( OUString(),
+ Reference< XInterface > (), 2);
+ }
+ OUString macroURL;
+ sal_Int32 nPropCount = props.getLength();
+ for( sal_Int32 index = 0 ; index < nPropCount ; ++index )
+ {
+ if ( props[ index ].Name.compareToAscii( "Script" ) == 0 )
+ props[ index ].Value >>= macroURL;
+ }
+ m_eventBindingHash[ aName ] = macroURL;
+ SetModified();
+}
+
+Any SAL_CALL GlobalEventConfig_Impl::getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
+{
+ Any aRet;
+ Sequence< beans::PropertyValue > props(2);
+ props[0].Name = OUString::createFromAscii("EventType");
+ props[0].Value <<= OUString::createFromAscii("Script");
+ props[1].Name = OUString::createFromAscii("Script");
+ EventBindingHash::const_iterator it = m_eventBindingHash.find( aName );
+ if( it != m_eventBindingHash.end() )
+ {
+ props[1].Value <<= it->second;
+ }
+ else
+ {
+ // not yet accessed - is it a supported name?
+ SupportedEventsVector::const_iterator pos = ::std::find(
+ m_supportedEvents.begin(), m_supportedEvents.end(), aName );
+ if ( pos == m_supportedEvents.end() )
+ throw container::NoSuchElementException( aName, NULL );
+
+ props[1].Value <<= OUString();
+ }
+ aRet <<= props;
+ return aRet;
+}
+
+Sequence< OUString > SAL_CALL GlobalEventConfig_Impl::getElementNames( ) throw (RuntimeException)
+{
+ const ::rtl::OUString* pRet = m_supportedEvents.empty() ? NULL : &m_supportedEvents[0];
+ return uno::Sequence< ::rtl::OUString >(pRet, m_supportedEvents.size());
+}
+
+sal_Bool SAL_CALL GlobalEventConfig_Impl::hasByName( const OUString& aName ) throw (RuntimeException)
+{
+ if ( m_eventBindingHash.find( aName ) != m_eventBindingHash.end() )
+ return sal_True;
+
+ // never accessed before - is it supported in general?
+ SupportedEventsVector::const_iterator pos = ::std::find(
+ m_supportedEvents.begin(), m_supportedEvents.end(), aName );
+ if ( pos != m_supportedEvents.end() )
+ return sal_True;
+
+ return sal_False;
+}
+
+Type SAL_CALL GlobalEventConfig_Impl::getElementType( ) throw (RuntimeException)
+{
+ //DF definitly not sure about this??
+ return ::getCppuType((const Sequence*)0);
+}
+
+sal_Bool SAL_CALL GlobalEventConfig_Impl::hasElements( ) throw (RuntimeException)
+{
+ return ( m_eventBindingHash.empty() );
+}
+
+// and now the wrapper
+
+
+//initialize static member
+GlobalEventConfig_Impl* GlobalEventConfig::m_pImpl = NULL ;
+sal_Int32 GlobalEventConfig::m_nRefCount = 0 ;
+
+GlobalEventConfig::GlobalEventConfig()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Increase our refcount ...
+ ++m_nRefCount;
+ // ... and initialize our data container only if it not already exist!
+ if( m_pImpl == NULL )
+ {
+ m_pImpl = new GlobalEventConfig_Impl;
+ ItemHolder1::holdConfigItem(E_EVENTCFG);
+ }
+}
+
+GlobalEventConfig::~GlobalEventConfig()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Decrease our refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy our static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pImpl;
+ m_pImpl = NULL;
+ }
+}
+
+void GlobalEventConfig::EstablishFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pImpl->EstablishFrameCallback( xFrame );
+}
+
+Reference< container::XNameReplace > SAL_CALL GlobalEventConfig::getEvents() throw (::com::sun::star::uno::RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ Reference< container::XNameReplace > ret(this);
+ return ret;
+}
+
+void SAL_CALL GlobalEventConfig::replaceByName( const OUString& aName, const Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pImpl->replaceByName( aName, aElement );
+}
+Any SAL_CALL GlobalEventConfig::getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pImpl->getByName( aName );
+}
+Sequence< OUString > SAL_CALL GlobalEventConfig::getElementNames( ) throw (RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pImpl->getElementNames( );
+}
+sal_Bool SAL_CALL GlobalEventConfig::hasByName( const OUString& aName ) throw (RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pImpl->hasByName( aName );
+}
+Type SAL_CALL GlobalEventConfig::getElementType( ) throw (RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pImpl->getElementType( );
+}
+sal_Bool SAL_CALL GlobalEventConfig::hasElements( ) throw (RuntimeException)
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pImpl->hasElements( );
+}
+
+Mutex& GlobalEventConfig::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect following code with
+ // the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that
+ // another instance of our class will be faster then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
+
+::rtl::OUString GlobalEventConfig::GetEventName( sal_Int32 nIndex )
+{
+ return GlobalEventConfig().m_pImpl->GetEventName( nIndex );
+}
+
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
new file mode 100644
index 000000000000..b4d21f79246b
--- /dev/null
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -0,0 +1,541 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: extendedsecurityoptions.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+
+#include
+#include "itemholder1.hxx"
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_SECURITY OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Security"))
+
+#define SECURE_EXTENSIONS_SET OUString(RTL_CONSTASCII_USTRINGPARAM("SecureExtensions"))
+#define EXTENSION_PROPNAME OUString(RTL_CONSTASCII_USTRINGPARAM("/Extension"))
+
+#define PROPERTYNAME_HYPERLINKS_OPEN OUString(RTL_CONSTASCII_USTRINGPARAM("Hyperlinks/Open"))
+
+#define PROPERTYHANDLE_HYPERLINKS_OPEN 0
+
+#define PROPERTYCOUNT 1
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+struct OUStringHashCode
+{
+ size_t operator()( const ::rtl::OUString& sString ) const
+ {
+ return sString.hashCode();
+ }
+};
+
+class ExtensionHashMap : public ::std::hash_map< ::rtl::OUString,
+ sal_Int32,
+ OUStringHashCode,
+ ::std::equal_to< ::rtl::OUString > >
+{
+ public:
+ inline void free()
+ {
+ ExtensionHashMap().swap( *this );
+ }
+};
+
+class SvtExtendedSecurityOptions_Impl : public ConfigItem
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ SvtExtendedSecurityOptions_Impl();
+ ~SvtExtendedSecurityOptions_Impl();
+
+ //---------------------------------------------------------------------------------------------------------
+ // overloaded methods of baseclass
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short called for notify of configmanager
+ @descr These method is called from the ConfigManager before application ends or from the
+ PropertyChangeListener if the sub tree broadcasts changes. You must update your
+ internal values.
+
+ @seealso baseclass ConfigItem
+
+ @param "seqPropertyNames" is the list of properties which should be updated.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Notify( const Sequence< OUString >& seqPropertyNames );
+
+ /*-****************************************************************************************************//**
+ @short write changes to configuration
+ @descr These method writes the changed values into the sub tree
+ and should always called in our destructor to guarantee consistency of config data.
+
+ @seealso baseclass ConfigItem
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Commit();
+
+ //---------------------------------------------------------------------------------------------------------
+ // public interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short Access method to check for security problems
+ @descr Different methods to check for security related problems.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsSecureHyperlink( const rtl::OUString& aURL ) const;
+ Sequence< rtl::OUString > GetSecureExtensionList() const;
+
+ SvtExtendedSecurityOptions::OpenHyperlinkMode GetOpenHyperlinkMode();
+ void SetOpenHyperlinkMode( SvtExtendedSecurityOptions::OpenHyperlinkMode aMode );
+ sal_Bool IsOpenHyperlinkModeReadOnly() const;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return list of key names of ouer configuration management which represent oue module tree
+ @descr These methods return a static const list of key names. We need it to get needed values from our
+ configuration management.
+
+ @seealso -
+
+ @param -
+ @return A list of needed configuration keys is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static Sequence< OUString > GetPropertyNames();
+
+ /*-****************************************************************************************************//**
+ @short Fills the hash map with all extensions known to be secure
+ @descr These methods fills the given hash map object with all extensions known to be secure.
+
+ @seealso -
+
+ @param aHashMap
+ A hash map to be filled with secure extension strings.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+ void FillExtensionHashMap( ExtensionHashMap& aHashMap );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+ OUString m_aSecureExtensionsSetName;
+ OUString m_aExtensionPropName;
+
+ SvtExtendedSecurityOptions::OpenHyperlinkMode m_eOpenHyperlinkMode;
+ sal_Bool m_bROOpenHyperlinkMode;
+ ExtensionHashMap m_aExtensionHashMap;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl()
+ // Init baseclasses first
+ : ConfigItem ( ROOTNODE_SECURITY ),
+ m_aSecureExtensionsSetName( SECURE_EXTENSIONS_SET ),
+ m_aExtensionPropName( EXTENSION_PROPNAME ),
+ m_bROOpenHyperlinkMode(sal_False)
+ // Init member then.
+{
+ // Fill the extension hash map with all secure extension strings
+ FillExtensionHashMap( m_aExtensionHashMap );
+
+ Sequence< OUString > seqNames = GetPropertyNames();
+ Sequence< Any > seqValues = GetProperties( seqNames );
+ Sequence< sal_Bool > seqRO = GetReadOnlyStates ( seqNames );
+
+ sal_Int32 nPropertyCount = seqValues.getLength();
+ for( sal_Int32 nProperty=0; nProperty>= nMode )
+ m_eOpenHyperlinkMode = (SvtExtendedSecurityOptions::OpenHyperlinkMode)nMode;
+ else {
+ DBG_ERROR("Wrong type for Open mode!");
+ }
+ m_bROOpenHyperlinkMode = seqRO[nProperty];
+ }
+ break;
+ }
+ }
+
+ // Enable notification mechanism of our baseclass.
+ // We need it to get information about changes outside these class on ouer used configuration keys!
+ Sequence< OUString > seqNotifyNames( 1 );
+ seqNotifyNames[0] = m_aSecureExtensionsSetName;
+ EnableNotification( seqNotifyNames );
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions_Impl::~SvtExtendedSecurityOptions_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtExtendedSecurityOptions_Impl::Notify( const Sequence< OUString >& )
+{
+ // Not implemented
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtExtendedSecurityOptions_Impl::Commit()
+{
+ // Get names of supported properties, create a list for values and copy current values to it.
+ Sequence< OUString > seqNames = GetPropertyNames ();
+ sal_Int32 nCount = seqNames.getLength();
+ Sequence< Any > seqValues ( nCount );
+ for( sal_Int32 nProperty=0; nProperty SvtExtendedSecurityOptions_Impl::GetSecureExtensionList() const
+{
+ Sequence< OUString > aResult( m_aExtensionHashMap.size() );
+
+ sal_Int32 nIndex = 0;
+ for ( ExtensionHashMap::const_iterator pIter = m_aExtensionHashMap.begin();
+ pIter != m_aExtensionHashMap.end(); pIter++ )
+ {
+ aResult[nIndex++] = pIter->first;
+ }
+
+ return aResult;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions_Impl::GetOpenHyperlinkMode()
+{
+ return m_eOpenHyperlinkMode;
+}
+/* -----------------09.07.2003 11:26-----------------
+
+ --------------------------------------------------*/
+sal_Bool SvtExtendedSecurityOptions_Impl::IsOpenHyperlinkModeReadOnly() const
+{
+ return m_bROOpenHyperlinkMode;
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtExtendedSecurityOptions_Impl::SetOpenHyperlinkMode( SvtExtendedSecurityOptions::OpenHyperlinkMode eNewMode )
+{
+ m_eOpenHyperlinkMode = eNewMode;
+ SetModified();
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+void SvtExtendedSecurityOptions_Impl::FillExtensionHashMap( ExtensionHashMap& aHashMap )
+{
+ // Get sequence with secure extensions from configuration
+ Sequence< OUString > seqNodes = GetNodeNames( m_aSecureExtensionsSetName );
+
+ OUString aValue;
+ Sequence< Any > aValues;
+ Sequence< OUString > aPropSeq( 1 );
+ for ( int i = 0; i < seqNodes.getLength(); i++ )
+ {
+ // Create access name for property
+ OUStringBuffer aExtEntryProp( m_aSecureExtensionsSetName );
+ aExtEntryProp.appendAscii( "/" );
+ aExtEntryProp.append( seqNodes[i] );
+ aExtEntryProp.append( m_aExtensionPropName );
+
+ aPropSeq[0] = aExtEntryProp.makeStringAndClear();
+ aValues = GetProperties( aPropSeq );
+ if ( aValues.getLength() == 1 )
+ {
+ // Don't use value if sequence has not the correct length
+ if ( aValues[0] >>= aValue )
+ // Add extension into secure extensions hash map
+ aHashMap.insert( ExtensionHashMap::value_type( aValue.toAsciiLowerCase(), 1 ) );
+ else
+ {
+ DBG_ERRORFILE( "SvtExtendedSecurityOptions_Impl::FillExtensionHashMap(): not string value?" );
+ }
+ }
+ }
+}
+
+//*****************************************************************************************************************
+// private method (currently not used)
+//*****************************************************************************************************************
+Sequence< OUString > SvtExtendedSecurityOptions_Impl::GetPropertyNames()
+{
+ // Build static list of configuration key names.
+ static const OUString pProperties[] =
+ {
+ PROPERTYNAME_HYPERLINKS_OPEN
+ };
+ // Initialize return sequence with these list ...
+ static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ // ... and return it.
+ return seqPropertyNames;
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions_Impl* SvtExtendedSecurityOptions::m_pDataContainer = NULL ;
+sal_Int32 SvtExtendedSecurityOptions::m_nRefCount = 0 ;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions::SvtExtendedSecurityOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetInitMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already exist!
+ if( m_pDataContainer == NULL )
+ {
+ RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtExtendedSecurityOptions_Impl::ctor()");
+ m_pDataContainer = new SvtExtendedSecurityOptions_Impl;
+
+ ItemHolder1::holdConfigItem(E_EXTENDEDSECURITYOPTIONS);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions::~SvtExtendedSecurityOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetInitMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtExtendedSecurityOptions::IsSecureHyperlink( const rtl::OUString& aURL ) const
+{
+ MutexGuard aGuard( GetInitMutex() );
+ return m_pDataContainer->IsSecureHyperlink( aURL );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< rtl::OUString > SvtExtendedSecurityOptions::GetSecureExtensionList() const
+{
+ MutexGuard aGuard( GetInitMutex() );
+ return m_pDataContainer->GetSecureExtensionList();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions::GetOpenHyperlinkMode()
+{
+ MutexGuard aGuard( GetInitMutex() );
+ return m_pDataContainer->GetOpenHyperlinkMode();
+}
+/* -----------------09.07.2003 11:26-----------------
+
+ --------------------------------------------------*/
+sal_Bool SvtExtendedSecurityOptions::IsOpenHyperlinkModeReadOnly() const
+{
+ return m_pDataContainer->IsOpenHyperlinkModeReadOnly();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtExtendedSecurityOptions::SetOpenHyperlinkMode( SvtExtendedSecurityOptions::OpenHyperlinkMode eMode )
+{
+ MutexGuard aGuard( GetInitMutex() );
+ m_pDataContainer->SetOpenHyperlinkMode( eMode );
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtExtendedSecurityOptions::GetInitMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
new file mode 100644
index 000000000000..7050e4734401
--- /dev/null
+++ b/unotools/source/config/fltrcfg.cxx
@@ -0,0 +1,611 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fltrcfg.cxx,v $
+ * $Revision: 1.12 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+#include
+#include
+
+#include
+#include
+#include
+
+using namespace utl;
+using namespace rtl;
+using namespace com::sun::star::uno;
+
+#define C2U(cChar) OUString::createFromAscii(cChar)
+
+// -----------------------------------------------------------------------
+#define FILTERCFG_WORD_CODE 0x0001
+#define FILTERCFG_WORD_STORAGE 0x0002
+#define FILTERCFG_EXCEL_CODE 0x0004
+#define FILTERCFG_EXCEL_STORAGE 0x0008
+#define FILTERCFG_PPOINT_CODE 0x0010
+#define FILTERCFG_PPOINT_STORAGE 0x0020
+#define FILTERCFG_MATH_LOAD 0x0100
+#define FILTERCFG_MATH_SAVE 0x0200
+#define FILTERCFG_WRITER_LOAD 0x0400
+#define FILTERCFG_WRITER_SAVE 0x0800
+#define FILTERCFG_CALC_LOAD 0x1000
+#define FILTERCFG_CALC_SAVE 0x2000
+#define FILTERCFG_IMPRESS_LOAD 0x4000
+#define FILTERCFG_IMPRESS_SAVE 0x8000
+#define FILTERCFG_EXCEL_EXECTBL 0x10000
+#define FILTERCFG_ENABLE_PPT_PREVIEW 0x20000
+#define FILTERCFG_ENABLE_EXCEL_PREVIEW 0x40000
+#define FILTERCFG_ENABLE_WORD_PREVIEW 0x80000
+#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
+
+static SvtFilterOptions* pOptions=0;
+
+/* -----------------------------22.01.01 10:23--------------------------------
+
+ ---------------------------------------------------------------------------*/
+class SvtAppFilterOptions_Impl : public utl::ConfigItem
+{
+ sal_Bool bLoadVBA;
+ sal_Bool bSaveVBA;
+public:
+ SvtAppFilterOptions_Impl(const OUString& rRoot) :
+ utl::ConfigItem(rRoot),
+ bLoadVBA(sal_False),
+ bSaveVBA(sal_False) {}
+ ~SvtAppFilterOptions_Impl();
+ virtual void Commit();
+ void Load();
+
+ sal_Bool IsLoad() const {return bLoadVBA;}
+ void SetLoad(sal_Bool bSet)
+ {
+ if(bSet != bLoadVBA)
+ SetModified();
+ bLoadVBA = bSet;
+ }
+ sal_Bool IsSave() const {return bSaveVBA;}
+ void SetSave(sal_Bool bSet)
+ {
+ if(bSet != bSaveVBA)
+ SetModified();
+ bSaveVBA = bSet;
+ }
+};
+
+/* -----------------------------22.01.01 11:08--------------------------------
+
+ ---------------------------------------------------------------------------*/
+SvtAppFilterOptions_Impl::~SvtAppFilterOptions_Impl()
+{
+ if(IsModified())
+ Commit();
+}
+/* -----------------------------22.01.01 10:38--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SvtAppFilterOptions_Impl::Commit()
+{
+ Sequence aNames(2);
+ OUString* pNames = aNames.getArray();
+ pNames[0] = C2U("Load");
+ pNames[1] = C2U("Save");
+ Sequence aValues(aNames.getLength());
+ Any* pValues = aValues.getArray();
+
+ const Type& rType = ::getBooleanCppuType();
+ pValues[0].setValue(&bLoadVBA, rType);
+ pValues[1].setValue(&bSaveVBA, rType);
+
+ PutProperties(aNames, aValues);
+}
+/* -----------------------------22.01.01 10:38--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SvtAppFilterOptions_Impl::Load()
+{
+ Sequence aNames(2);
+ OUString* pNames = aNames.getArray();
+ pNames[0] = C2U("Load");
+ pNames[1] = C2U("Save");
+
+ Sequence aValues = GetProperties(aNames);
+ const Any* pValues = aValues.getConstArray();
+
+ if(pValues[0].hasValue())
+ bLoadVBA = *(sal_Bool*)pValues[0].getValue();
+ if(pValues[1].hasValue())
+ bSaveVBA = *(sal_Bool*)pValues[1].getValue();
+}
+
+// -----------------------------------------------------------------------
+class SvtCalcFilterOptions_Impl : public SvtAppFilterOptions_Impl
+{
+ sal_Bool bLoadExecutable;
+public:
+ SvtCalcFilterOptions_Impl(const OUString& rRoot) :
+ SvtAppFilterOptions_Impl(rRoot),
+ bLoadExecutable(sal_False)
+ {}
+ virtual void Commit();
+ void Load();
+
+ sal_Bool IsLoadExecutable() const {return bLoadExecutable;}
+ void SetLoadExecutable(sal_Bool bSet)
+ {
+ if(bSet != bLoadExecutable)
+ SetModified();
+ bLoadExecutable = bSet;
+ }
+};
+
+void SvtCalcFilterOptions_Impl::Commit()
+{
+ SvtAppFilterOptions_Impl::Commit();
+
+ Sequence aNames(1);
+ aNames[0] = C2U("Executable");
+ Sequence aValues(1);
+ aValues[0] <<= bLoadExecutable;
+
+ PutProperties(aNames, aValues);
+}
+
+void SvtCalcFilterOptions_Impl::Load()
+{
+ SvtAppFilterOptions_Impl::Load();
+
+ Sequence aNames(1);
+ aNames[0] = C2U("Executable");
+
+ Sequence aValues = GetProperties(aNames);
+ const Any* pValues = aValues.getConstArray();
+ if(pValues[0].hasValue())
+ bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
+}
+
+/* -----------------------------22.01.01 10:32--------------------------------
+
+ ---------------------------------------------------------------------------*/
+struct SvtFilterOptions_Impl
+{
+ ULONG nFlags;
+ SvtAppFilterOptions_Impl aWriterCfg;
+ SvtCalcFilterOptions_Impl aCalcCfg;
+ SvtAppFilterOptions_Impl aImpressCfg;
+
+ SvtFilterOptions_Impl() :
+ aWriterCfg(C2U("Office.Writer/Filter/Import/VBA")),
+ aCalcCfg(C2U("Office.Calc/Filter/Import/VBA")),
+ aImpressCfg(C2U("Office.Impress/Filter/Import/VBA"))
+ {
+ nFlags = FILTERCFG_WORD_CODE |
+ FILTERCFG_WORD_STORAGE |
+ FILTERCFG_EXCEL_CODE |
+ FILTERCFG_EXCEL_STORAGE |
+ FILTERCFG_PPOINT_CODE |
+ FILTERCFG_PPOINT_STORAGE |
+ FILTERCFG_MATH_LOAD |
+ FILTERCFG_MATH_SAVE |
+ FILTERCFG_WRITER_LOAD |
+ FILTERCFG_WRITER_SAVE |
+ FILTERCFG_CALC_LOAD |
+ FILTERCFG_CALC_SAVE |
+ FILTERCFG_IMPRESS_LOAD |
+ FILTERCFG_IMPRESS_SAVE |
+ FILTERCFG_USE_ENHANCED_FIELDS;
+ Load();
+ }
+
+ void SetFlag( ULONG nFlag, BOOL bSet );
+ BOOL IsFlag( ULONG nFlag ) const;
+ void Load()
+ {
+ aWriterCfg.Load();
+ aCalcCfg.Load();
+ aImpressCfg.Load();
+ }
+};
+/* -----------------------------22.01.01 10:34--------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet )
+{
+ switch(nFlag)
+ {
+ case FILTERCFG_WORD_CODE: aWriterCfg.SetLoad(bSet);break;
+ case FILTERCFG_WORD_STORAGE: aWriterCfg.SetSave(bSet);break;
+ case FILTERCFG_EXCEL_CODE: aCalcCfg.SetLoad(bSet);break;
+ case FILTERCFG_EXCEL_STORAGE: aCalcCfg.SetSave(bSet);break;
+ case FILTERCFG_EXCEL_EXECTBL: aCalcCfg.SetLoadExecutable(bSet);break;
+ case FILTERCFG_PPOINT_CODE: aImpressCfg.SetLoad(bSet);break;
+ case FILTERCFG_PPOINT_STORAGE: aImpressCfg.SetSave(bSet);break;
+ default:
+ if( bSet )
+ nFlags |= nFlag;
+ else
+ nFlags &= ~nFlag;
+ }
+}
+/* -----------------------------22.01.01 10:35--------------------------------
+
+ ---------------------------------------------------------------------------*/
+BOOL SvtFilterOptions_Impl::IsFlag( ULONG nFlag ) const
+{
+ BOOL bRet;
+ switch(nFlag)
+ {
+ case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
+ case FILTERCFG_WORD_STORAGE : bRet = aWriterCfg.IsSave();break;
+ case FILTERCFG_EXCEL_CODE : bRet = aCalcCfg.IsLoad();break;
+ case FILTERCFG_EXCEL_STORAGE : bRet = aCalcCfg.IsSave();break;
+ case FILTERCFG_EXCEL_EXECTBL : bRet = aCalcCfg.IsLoadExecutable();break;
+ case FILTERCFG_PPOINT_CODE : bRet = aImpressCfg.IsLoad();break;
+ case FILTERCFG_PPOINT_STORAGE : bRet = aImpressCfg.IsSave();break;
+ default:
+ bRet = 0 != (nFlags & nFlag );
+ }
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+SvtFilterOptions::SvtFilterOptions() :
+ ConfigItem( C2U("Office.Common/Filter/Microsoft") ),
+ pImp(new SvtFilterOptions_Impl)
+{
+ RTL_LOGFILE_CONTEXT(aLog, "unotools SvtFilterOptions::SvtFilterOptions()");
+ EnableNotification(GetPropertyNames());
+ Load();
+}
+// -----------------------------------------------------------------------
+SvtFilterOptions::~SvtFilterOptions()
+{
+ delete pImp;
+}
+/* -----------------------------22.01.01 08:45--------------------------------
+
+ ---------------------------------------------------------------------------*/
+const Sequence& SvtFilterOptions::GetPropertyNames()
+{
+ static Sequence aNames;
+ if(!aNames.getLength())
+ {
+ int nCount = 12;
+ aNames.realloc(nCount);
+ static const char* aPropNames[] =
+ {
+ "Import/MathTypeToMath", // 0
+ "Import/WinWordToWriter", // 1
+ "Import/PowerPointToImpress", // 2
+ "Import/ExcelToCalc", // 3
+ "Export/MathToMathType", // 4
+ "Export/WriterToWinWord", // 5
+ "Export/ImpressToPowerPoint", // 6
+ "Export/CalcToExcel", // 7
+ "Export/EnablePowerPointPreview", // 8
+ "Export/EnableExcelPreview", // 9
+ "Export/EnableWordPreview", // 10
+ "Import/ImportWWFieldsAsEnhancedFields" // 11
+ };
+ OUString* pNames = aNames.getArray();
+ for(int i = 0; i < nCount; i++)
+ pNames[i] = C2U(aPropNames[i]);
+ }
+ return aNames;
+}
+//-----------------------------------------------------------------------
+static ULONG lcl_GetFlag(sal_Int32 nProp)
+{
+ ULONG nFlag = 0;
+ switch(nProp)
+ {
+ case 0: nFlag = FILTERCFG_MATH_LOAD; break;
+ case 1: nFlag = FILTERCFG_WRITER_LOAD; break;
+ case 2: nFlag = FILTERCFG_IMPRESS_LOAD; break;
+ case 3: nFlag = FILTERCFG_CALC_LOAD; break;
+ case 4: nFlag = FILTERCFG_MATH_SAVE; break;
+ case 5: nFlag = FILTERCFG_WRITER_SAVE; break;
+ case 6: nFlag = FILTERCFG_IMPRESS_SAVE; break;
+ case 7: nFlag = FILTERCFG_CALC_SAVE; break;
+ case 8: nFlag = FILTERCFG_ENABLE_PPT_PREVIEW; break;
+ case 9: nFlag = FILTERCFG_ENABLE_EXCEL_PREVIEW; break;
+ case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break;
+ case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break;
+
+ default: DBG_ERROR("illegal value");
+ }
+ return nFlag;
+}
+/*-- 22.01.01 08:53:03---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void SvtFilterOptions::Notify( const Sequence& )
+{
+ Load();
+}
+/*-- 22.01.01 08:53:04---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void SvtFilterOptions::Commit()
+{
+ const Sequence& aNames = GetPropertyNames();
+ Sequence aValues(aNames.getLength());
+ Any* pValues = aValues.getArray();
+
+ const Type& rType = ::getBooleanCppuType();
+ for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+ {
+ ULONG nFlag = lcl_GetFlag(nProp);
+ sal_Bool bVal = pImp->IsFlag( nFlag);
+ pValues[nProp].setValue(&bVal, rType);
+
+ }
+ PutProperties(aNames, aValues);
+}
+/*-- 22.01.01 08:53:04---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void SvtFilterOptions::Load()
+{
+ pImp->Load();
+ const Sequence& rNames = GetPropertyNames();
+ Sequence aValues = GetProperties(rNames);
+ const Any* pValues = aValues.getConstArray();
+ DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+ if(aValues.getLength() == rNames.getLength())
+ {
+ for(int nProp = 0; nProp < rNames.getLength(); nProp++)
+ {
+ if(pValues[nProp].hasValue())
+ {
+ sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue();
+ ULONG nFlag = lcl_GetFlag(nProp);
+ pImp->SetFlag( nFlag, bVal);
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------
+
+void SvtFilterOptions::SetLoadWordBasicCode( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WORD_CODE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadWordBasicCode() const
+{
+ return pImp->IsFlag( FILTERCFG_WORD_CODE );
+}
+
+void SvtFilterOptions::SetLoadWordBasicStorage( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadWordBasicStorage() const
+{
+ return pImp->IsFlag( FILTERCFG_WORD_STORAGE );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtFilterOptions::SetLoadExcelBasicCode( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_EXCEL_CODE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadExcelBasicCode() const
+{
+ return pImp->IsFlag( FILTERCFG_EXCEL_CODE );
+}
+
+void SvtFilterOptions::SetLoadExcelBasicExecutable( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadExcelBasicExecutable() const
+{
+ return pImp->IsFlag( FILTERCFG_EXCEL_EXECTBL );
+}
+
+void SvtFilterOptions::SetLoadExcelBasicStorage( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadExcelBasicStorage() const
+{
+ return pImp->IsFlag( FILTERCFG_EXCEL_STORAGE );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtFilterOptions::SetLoadPPointBasicCode( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_PPOINT_CODE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadPPointBasicCode() const
+{
+ return pImp->IsFlag( FILTERCFG_PPOINT_CODE );
+}
+
+void SvtFilterOptions::SetLoadPPointBasicStorage( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadPPointBasicStorage() const
+{
+ return pImp->IsFlag( FILTERCFG_PPOINT_STORAGE );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SvtFilterOptions::IsMathType2Math() const
+{
+ return pImp->IsFlag( FILTERCFG_MATH_LOAD );
+}
+
+void SvtFilterOptions::SetMathType2Math( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_MATH_LOAD, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsMath2MathType() const
+{
+ return pImp->IsFlag( FILTERCFG_MATH_SAVE );
+}
+
+void SvtFilterOptions::SetMath2MathType( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_MATH_SAVE, bFlag );
+ SetModified();
+}
+
+
+// -----------------------------------------------------------------------
+BOOL SvtFilterOptions::IsWinWord2Writer() const
+{
+ return pImp->IsFlag( FILTERCFG_WRITER_LOAD );
+}
+
+void SvtFilterOptions::SetWinWord2Writer( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WRITER_LOAD, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsWriter2WinWord() const
+{
+ return pImp->IsFlag( FILTERCFG_WRITER_SAVE );
+}
+
+void SvtFilterOptions::SetWriter2WinWord( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WRITER_SAVE, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsUseEnhancedFields() const
+{
+ return false; // disable for now;
+// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
+}
+
+void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_USE_ENHANCED_FIELDS, bFlag );
+ SetModified();
+}
+
+// -----------------------------------------------------------------------
+BOOL SvtFilterOptions::IsExcel2Calc() const
+{
+ return pImp->IsFlag( FILTERCFG_CALC_LOAD );
+}
+
+void SvtFilterOptions::SetExcel2Calc( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_CALC_LOAD, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsCalc2Excel() const
+{
+ return pImp->IsFlag( FILTERCFG_CALC_SAVE );
+}
+
+void SvtFilterOptions::SetCalc2Excel( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_CALC_SAVE, bFlag );
+ SetModified();
+}
+
+
+// -----------------------------------------------------------------------
+BOOL SvtFilterOptions::IsPowerPoint2Impress() const
+{
+ return pImp->IsFlag( FILTERCFG_IMPRESS_LOAD );
+}
+
+void SvtFilterOptions::SetPowerPoint2Impress( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsImpress2PowerPoint() const
+{
+ return pImp->IsFlag( FILTERCFG_IMPRESS_SAVE );
+}
+
+void SvtFilterOptions::SetImpress2PowerPoint( BOOL bFlag )
+{
+ pImp->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag );
+ SetModified();
+}
+
+SvtFilterOptions* SvtFilterOptions::Get()
+{
+ if ( !pOptions )
+ pOptions = new SvtFilterOptions;
+ return pOptions;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SvtFilterOptions::IsEnablePPTPreview() const
+{
+ return pImp->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW );
+}
+
+
+BOOL SvtFilterOptions::IsEnableCalcPreview() const
+{
+ return pImp->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW );
+}
+
+
+BOOL SvtFilterOptions::IsEnableWordPreview() const
+{
+ return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW );
+}
+
+
diff --git a/unotools/source/config/fontoptions.cxx b/unotools/source/config/fontoptions.cxx
new file mode 100644
index 000000000000..ac7fd2a94b62
--- /dev/null
+++ b/unotools/source/config/fontoptions.cxx
@@ -0,0 +1,514 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fontoptions.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#ifndef GCC
+#endif
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include "itemholder1.hxx"
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+#define ROOTNODE_FONT OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Font" ))
+
+#define PROPERTYNAME_REPLACEMENTTABLE OUString(RTL_CONSTASCII_USTRINGPARAM("Substitution/Replacement" ))
+#define PROPERTYNAME_FONTHISTORY OUString(RTL_CONSTASCII_USTRINGPARAM("View/History" ))
+#define PROPERTYNAME_FONTWYSIWYG OUString(RTL_CONSTASCII_USTRINGPARAM("View/ShowFontBoxWYSIWYG" ))
+
+#define PROPERTYHANDLE_REPLACEMENTTABLE 0
+#define PROPERTYHANDLE_FONTHISTORY 1
+#define PROPERTYHANDLE_FONTWYSIWYG 2
+
+#define PROPERTYCOUNT 3
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+class SvtFontOptions_Impl : public ConfigItem
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ SvtFontOptions_Impl();
+ ~SvtFontOptions_Impl();
+
+ //---------------------------------------------------------------------------------------------------------
+ // overloaded methods of baseclass
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short called for notify of configmanager
+ @descr These method is called from the ConfigManager before application ends or from the
+ PropertyChangeListener if the sub tree broadcasts changes. You must update your
+ internal values.
+
+ @seealso baseclass ConfigItem
+
+ @param "seqPropertyNames" is the list of properties which should be updated.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Notify( const Sequence< OUString >& seqPropertyNames );
+
+ /*-****************************************************************************************************//**
+ @short write changes to configuration
+ @descr These method writes the changed values into the sub tree
+ and should always called in our destructor to guarantee consistency of config data.
+
+ @seealso baseclass ConfigItem
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ virtual void Commit();
+
+ //---------------------------------------------------------------------------------------------------------
+ // public interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short access method to get internal values
+ @descr These method give us a chance to regulate acces to ouer internal values.
+ It's not used in the moment - but it's possible for the feature!
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsReplacementTableEnabled ( ) const ;
+ void EnableReplacementTable ( sal_Bool bState ) ;
+
+ sal_Bool IsFontHistoryEnabled ( ) const ;
+ void EnableFontHistory ( sal_Bool bState ) ;
+
+ sal_Bool IsFontWYSIWYGEnabled ( ) const ;
+ void EnableFontWYSIWYG ( sal_Bool bState ) ;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return list of key names of ouer configuration management which represent oue module tree
+ @descr These methods return a static const list of key names. We need it to get needed values from our
+ configuration management.
+
+ @seealso -
+
+ @param -
+ @return A list of needed configuration keys is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static Sequence< OUString > impl_GetPropertyNames();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ sal_Bool m_bReplacementTable ;
+ sal_Bool m_bFontHistory ;
+ sal_Bool m_bFontWYSIWYG ;
+};
+
+//_________________________________________________________________________________________________________________
+// definitions
+//_________________________________________________________________________________________________________________
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtFontOptions_Impl::SvtFontOptions_Impl()
+ // Init baseclasses first
+ : ConfigItem ( ROOTNODE_FONT )
+ // Init member then.
+ , m_bReplacementTable ( sal_False )
+ , m_bFontHistory ( sal_False )
+ , m_bFontWYSIWYG ( sal_False )
+{
+ // Use our static list of configuration keys to get his values.
+ Sequence< OUString > seqNames = impl_GetPropertyNames ( );
+ Sequence< Any > seqValues = GetProperties ( seqNames );
+
+ // Safe impossible cases.
+ // We need values from ALL configuration keys.
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtFontOptions_Impl::SvtFontOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+ // Copy values from list in right order to ouer internal member.
+ sal_Int32 nPropertyCount = seqValues.getLength();
+ for( sal_Int32 nProperty=0; nProperty>= m_bReplacementTable;
+ }
+ break;
+ case PROPERTYHANDLE_FONTHISTORY : {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtFontOptions_Impl::SvtFontOptions_Impl()\nWho has changed the value type of \"Office.Common\\Font\\View\\History\"?" );
+ seqValues[nProperty] >>= m_bFontHistory;
+ }
+ break;
+ case PROPERTYHANDLE_FONTWYSIWYG : {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtFontOptions_Impl::SvtFontOptions_Impl()\nWho has changed the value type of \"Office.Common\\Font\\View\\ShowFontBoxWYSIWYG\"?" );
+ seqValues[nProperty] >>= m_bFontWYSIWYG;
+ }
+ break;
+ }
+ }
+
+ // Enable notification mechanism of ouer baseclass.
+ // We need it to get information about changes outside these class on ouer used configuration keys!
+ EnableNotification( seqNames );
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtFontOptions_Impl::~SvtFontOptions_Impl()
+{
+ // We must save our current values .. if user forget it!
+ if( IsModified() == sal_True )
+ {
+ Commit();
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtFontOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
+{
+ // Use given list of updated properties to get his values from configuration directly!
+ Sequence< Any > seqValues = GetProperties( seqPropertyNames );
+ // Safe impossible cases.
+ // We need values from ALL notified configuration keys.
+ DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtFontOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
+ // Step over list of property names and get right value from coreesponding value list to set it on internal members!
+ sal_Int32 nCount = seqPropertyNames.getLength();
+ for( sal_Int32 nProperty=0; nProperty>= m_bReplacementTable;
+ }
+ else
+ if( seqPropertyNames[nProperty] == PROPERTYNAME_FONTHISTORY )
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtFontOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\Font\\View\\History\"?" );
+ seqValues[nProperty] >>= m_bFontHistory;
+ }
+ else
+ if( seqPropertyNames[nProperty] == PROPERTYNAME_FONTWYSIWYG )
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtFontOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\Font\\View\\ShowFontBoxWYSIWYG\"?" );
+ seqValues[nProperty] >>= m_bFontWYSIWYG;
+ }
+ #if OSL_DEBUG_LEVEL > 1
+ else DBG_ASSERT( sal_False, "SvtFontOptions_Impl::Notify()\nUnkown property detected ... I can't handle these!\n" );
+ #endif
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtFontOptions_Impl::Commit()
+{
+ // Get names of supported properties, create a list for values and copy current values to it.
+ Sequence< OUString > seqNames = impl_GetPropertyNames();
+ sal_Int32 nCount = seqNames.getLength();
+ Sequence< Any > seqValues ( nCount );
+ for( sal_Int32 nProperty=0; nProperty SvtFontOptions_Impl::impl_GetPropertyNames()
+{
+ // Build static list of configuration key names.
+ static const OUString pProperties[] =
+ {
+ PROPERTYNAME_REPLACEMENTTABLE ,
+ PROPERTYNAME_FONTHISTORY ,
+ PROPERTYNAME_FONTWYSIWYG ,
+ };
+ // Initialize return sequence with these list ...
+ static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ // ... and return it.
+ return seqPropertyNames;
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtFontOptions_Impl* SvtFontOptions::m_pDataContainer = NULL ;
+sal_Int32 SvtFontOptions::m_nRefCount = 0 ;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtFontOptions::SvtFontOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already exist!
+ if( m_pDataContainer == NULL )
+ {
+ RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtFontOptions_Impl::ctor()");
+ m_pDataContainer = new SvtFontOptions_Impl;
+
+ ItemHolder1::holdConfigItem(E_FONTOPTIONS);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtFontOptions::~SvtFontOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtFontOptions::IsReplacementTableEnabled() const
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ return m_pDataContainer->IsReplacementTableEnabled();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtFontOptions::EnableReplacementTable( sal_Bool bState )
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ m_pDataContainer->EnableReplacementTable( bState );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtFontOptions::IsFontHistoryEnabled() const
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ return m_pDataContainer->IsFontHistoryEnabled();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtFontOptions::EnableFontHistory( sal_Bool bState )
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ m_pDataContainer->EnableFontHistory( bState );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_Bool SvtFontOptions::IsFontWYSIWYGEnabled() const
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ return m_pDataContainer->IsFontWYSIWYGEnabled();
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtFontOptions::EnableFontWYSIWYG( sal_Bool bState )
+{
+ MutexGuard aGuard( impl_GetOwnStaticMutex() );
+ m_pDataContainer->EnableFontWYSIWYG( bState );
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtFontOptions::impl_GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
new file mode 100644
index 000000000000..73d006a27507
--- /dev/null
+++ b/unotools/source/config/historyoptions.cxx
@@ -0,0 +1,748 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: historyoptions.cxx,v $
+ * $Revision: 1.21.234.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#ifndef GCC
+#endif
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef __SGI_STL_DEQUE
+#include
+#endif
+
+#ifndef __SGI_STL_ALGORITHM
+#include
+#endif
+
+#include
+#include "itemholder1.hxx"
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include
+#endif
+
+#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
+#include
+#endif
+
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include
+#endif
+
+#ifndef _SVT_LOGHELPER_HXX
+#include
+#endif
+
+//_________________________________________________________________________________________________________________
+// namespaces
+//_________________________________________________________________________________________________________________
+
+using namespace ::std ;
+using namespace ::utl ;
+using namespace ::rtl ;
+using namespace ::osl ;
+using namespace ::com::sun::star::uno ;
+using namespace ::com::sun::star::beans ;
+
+namespace css = ::com::sun::star;
+
+//_________________________________________________________________________________________________________________
+// const
+//_________________________________________________________________________________________________________________
+
+namespace {
+ static const ::sal_Int32 s_nOffsetURL = 0;
+ static const ::sal_Int32 s_nOffsetFilter = 1;
+ static const ::sal_Int32 s_nOffsetTitle = 2;
+ static const ::sal_Int32 s_nOffsetPassword = 3;
+}
+
+//_________________________________________________________________________________________________________________
+// private declarations!
+//_________________________________________________________________________________________________________________
+
+struct IMPL_THistoryItem
+{
+ IMPL_THistoryItem()
+ {
+ }
+
+ IMPL_THistoryItem( const OUString& sNewURL ,
+ const OUString& sNewFilter ,
+ const OUString& sNewTitle ,
+ const OUString& sNewPassword )
+ {
+ sURL = sNewURL ;
+ sFilter = sNewFilter ;
+ sTitle = sNewTitle ;
+ sPassword = sNewPassword ;
+ }
+
+ sal_Bool operator==( const OUString& sSearchedURL )
+ {
+ return( sURL == sSearchedURL );
+ }
+
+ OUString sURL ;
+ OUString sFilter ;
+ OUString sTitle ;
+ OUString sPassword ;
+};
+
+//*****************************************************************************************************************
+// class SvtHistoryOptions_Impl
+// redesigned
+//*****************************************************************************************************************
+class SvtHistoryOptions_Impl
+{
+public:
+ SvtHistoryOptions_Impl();
+ ~SvtHistoryOptions_Impl();
+
+ sal_uInt32 GetSize( EHistoryType eHistory );
+ void SetSize( EHistoryType eHistory, sal_uInt32 nSize );
+ void Clear( EHistoryType eHistory );
+ Sequence< Sequence< PropertyValue > > GetList( EHistoryType eHistory );
+ void AppendItem( EHistoryType eHistory ,
+ const OUString& sURL ,
+ const OUString& sFilter ,
+ const OUString& sTitle ,
+ const OUString& sPassword );
+
+private:
+ void impl_truncateList (EHistoryType eHistory, sal_uInt32 nSize);
+
+private:
+ css::uno::Reference< css::container::XNameAccess > m_xCfg;
+ css::uno::Reference< css::container::XNameAccess > m_xCommonXCU;
+};
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtHistoryOptions_Impl::SvtHistoryOptions_Impl()
+{
+ try
+ {
+ m_xCfg = Reference< css::container::XNameAccess > (
+ ::comphelper::ConfigurationHelper::openConfig(
+ utl::getProcessServiceFactory(),
+ s_sHistories,
+ ::comphelper::ConfigurationHelper::E_STANDARD),
+ css::uno::UNO_QUERY );
+
+ m_xCommonXCU = Reference< css::container::XNameAccess > (
+ ::comphelper::ConfigurationHelper::openConfig(
+ utl::getProcessServiceFactory(),
+ s_sCommonHistory,
+ ::comphelper::ConfigurationHelper::E_STANDARD),
+ css::uno::UNO_QUERY );
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ m_xCfg.clear();
+ m_xCommonXCU.clear();
+
+ LogHelper::logIt(ex);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtHistoryOptions_Impl::~SvtHistoryOptions_Impl()
+{
+}
+
+//*****************************************************************************************************************
+// public method
+// Attention: We return the max. size of our internal lists - That is the capacity not the size!
+//*****************************************************************************************************************
+sal_uInt32 SvtHistoryOptions_Impl::GetSize( EHistoryType eHistory )
+{
+ sal_uInt32 nSize = 0 ;
+ css::uno::Reference< css::beans::XPropertySet > xListAccess(m_xCommonXCU, css::uno::UNO_QUERY);
+
+ try
+ {
+ switch( eHistory )
+ {
+ case ePICKLIST:
+ xListAccess->getPropertyValue(s_sPickListSize) >>= nSize;
+ break;
+
+ case eHISTORY:
+ xListAccess->getPropertyValue(s_sURLHistorySize) >>= nSize;
+ break;
+
+ case eHELPBOOKMARKS:
+ xListAccess->getPropertyValue(s_sHelpBookmarksSize) >>= nSize;
+ break;
+
+ default:
+ break;
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+
+ return nSize;
+}
+
+//*****************************************************************************************************************
+// public method
+// Attention: We return the max. size of our internal lists - That is the capacity not the size!
+//*****************************************************************************************************************
+void SvtHistoryOptions_Impl::SetSize( EHistoryType eHistory, sal_uInt32 nSize )
+{
+ css::uno::Reference< css::beans::XPropertySet > xListAccess(m_xCommonXCU, css::uno::UNO_QUERY);
+ if (! xListAccess.is ())
+ return;
+
+ try
+ {
+ switch( eHistory )
+ {
+ case ePICKLIST:
+ if(nSize!=GetSize(ePICKLIST))
+ {
+ xListAccess->setPropertyValue(s_sPickListSize, css::uno::makeAny(nSize));
+ ::comphelper::ConfigurationHelper::flush(m_xCommonXCU);
+ }
+ break;
+
+ case eHISTORY:
+ if(nSize!=GetSize(eHISTORY))
+ {
+ xListAccess->setPropertyValue(s_sURLHistorySize, css::uno::makeAny(nSize));
+ ::comphelper::ConfigurationHelper::flush(m_xCommonXCU);
+ }
+ break;
+
+ case eHELPBOOKMARKS:
+ if(nSize!=GetSize(eHELPBOOKMARKS))
+ {
+ xListAccess->setPropertyValue(s_sHelpBookmarksSize, css::uno::makeAny(nSize));
+ ::comphelper::ConfigurationHelper::flush(m_xCommonXCU);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ impl_truncateList (eHistory, nSize);
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+}
+
+//*****************************************************************************************************************
+void SvtHistoryOptions_Impl::impl_truncateList ( EHistoryType eHistory, sal_uInt32 nSize )
+{
+ css::uno::Reference< css::container::XNameAccess > xList;
+ css::uno::Reference< css::container::XNameContainer > xItemList;
+ css::uno::Reference< css::container::XNameContainer > xOrderList;
+ css::uno::Reference< css::beans::XPropertySet > xSet;
+
+ try
+ {
+ switch( eHistory )
+ {
+ case ePICKLIST:
+ m_xCfg->getByName(s_sPickList) >>= xList;
+ break;
+
+ case eHISTORY:
+ m_xCfg->getByName(s_sURLHistory) >>= xList;
+ break;
+
+ case eHELPBOOKMARKS:
+ m_xCfg->getByName(s_sHelpBookmarks) >>= xList;
+ break;
+
+ default:
+ break;
+ }
+
+ // If too much items in current list ...
+ // truncate the oldest items BEFORE you set the new one.
+ if ( ! xList.is())
+ return;
+
+ xList->getByName(s_sOrderList) >>= xOrderList;
+ xList->getByName(s_sItemList) >>= xItemList;
+
+ const sal_uInt32 nLength = xOrderList->getElementNames().getLength();
+ if (nSize < nLength)
+ {
+ for (sal_uInt32 i=nLength-1; i>=nSize; --i)
+ {
+ ::rtl::OUString sTmp;
+ const ::rtl::OUString sRemove = ::rtl::OUString::valueOf((sal_Int32)i);
+ xOrderList->getByName(sRemove) >>= xSet;
+ xSet->getPropertyValue(s_sHistoryItemRef) >>= sTmp;
+ xItemList->removeByName(sTmp);
+ xOrderList->removeByName(sRemove);
+ }
+
+ ::comphelper::ConfigurationHelper::flush(m_xCfg);
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+// Clear specified history list
+//*****************************************************************************************************************
+void SvtHistoryOptions_Impl::Clear( EHistoryType eHistory )
+{
+ css::uno::Reference< css::container::XNameAccess > xListAccess;
+ css::uno::Reference< css::container::XNameContainer > xNode;
+ Sequence< ::rtl::OUString > lOrders;
+
+ try
+ {
+ switch( eHistory )
+ {
+ case ePICKLIST:
+ {
+ m_xCfg->getByName(s_sPickList) >>= xListAccess;
+ break;
+ }
+
+ case eHISTORY:
+ {
+ m_xCfg->getByName(s_sURLHistory) >>= xListAccess;
+ break;
+ }
+
+ case eHELPBOOKMARKS:
+ {
+ m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess;
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if (xListAccess.is())
+ {
+ // clear ItemList
+ xListAccess->getByName(s_sItemList) >>= xNode ;
+ lOrders = xNode->getElementNames();
+ const sal_Int32 nLength = lOrders.getLength();
+ for(sal_Int32 i=0; iremoveByName(lOrders[i]);
+
+ // clear OrderList
+ xListAccess->getByName(s_sOrderList) >>= xNode ;
+ lOrders = xNode->getElementNames();
+ for(sal_Int32 j=0; jremoveByName(lOrders[j]);
+
+ ::comphelper::ConfigurationHelper::flush(m_xCfg);
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+// get a sequence list from the items
+//*****************************************************************************************************************
+Sequence< Sequence< PropertyValue > > SvtHistoryOptions_Impl::GetList( EHistoryType eHistory )
+{
+ impl_truncateList (eHistory, GetSize (eHistory));
+
+ Sequence< Sequence< PropertyValue > > seqReturn; // Set default return value.
+ Sequence< PropertyValue > seqProperties( 4 );
+ Sequence< ::rtl::OUString > lOrders;
+
+ css::uno::Reference< css::container::XNameAccess > xListAccess;
+ css::uno::Reference< css::container::XNameAccess > xItemList;
+ css::uno::Reference< css::container::XNameAccess > xOrderList;
+ css::uno::Reference< css::beans::XPropertySet > xSet;
+
+ seqProperties[s_nOffsetURL ].Name = HISTORY_PROPERTYNAME_URL;
+ seqProperties[s_nOffsetFilter ].Name = HISTORY_PROPERTYNAME_FILTER;
+ seqProperties[s_nOffsetTitle ].Name = HISTORY_PROPERTYNAME_TITLE;
+ seqProperties[s_nOffsetPassword ].Name = HISTORY_PROPERTYNAME_PASSWORD;
+
+ try
+ {
+ switch( eHistory )
+ {
+ case ePICKLIST:
+ {
+ m_xCfg->getByName(s_sPickList) >>= xListAccess;
+ break;
+ }
+
+ case eHISTORY:
+ {
+ m_xCfg->getByName(s_sURLHistory) >>= xListAccess;
+ break;
+ }
+
+ case eHELPBOOKMARKS:
+ {
+ m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess;
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if (xListAccess.is())
+ {
+ xListAccess->getByName(s_sItemList) >>= xItemList;
+ xListAccess->getByName(s_sOrderList) >>= xOrderList;
+
+ const sal_Int32 nLength = xOrderList->getElementNames().getLength();
+ Sequence< Sequence< PropertyValue > > aRet(nLength);
+
+ for(sal_Int32 nItem=0; nItemgetByName(::rtl::OUString::valueOf(nItem)) >>= xSet;
+ xSet->getPropertyValue(s_sHistoryItemRef) >>= sUrl;
+
+ xItemList->getByName(sUrl) >>= xSet;
+ seqProperties[s_nOffsetURL ].Value <<= sUrl;
+ xSet->getPropertyValue(s_sFilter) >>= seqProperties[s_nOffsetFilter ].Value;
+ xSet->getPropertyValue(s_sTitle) >>= seqProperties[s_nOffsetTitle ].Value;
+ xSet->getPropertyValue(s_sPassword) >>= seqProperties[s_nOffsetPassword ].Value;
+ aRet[nItem] = seqProperties;
+ }
+ seqReturn = aRet;
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+
+ return seqReturn;
+}
+
+//*****************************************************************************************************************
+// public method
+// implements a deque in XML
+//*****************************************************************************************************************
+void SvtHistoryOptions_Impl::AppendItem( EHistoryType eHistory ,
+ const OUString& sURL ,
+ const OUString& sFilter ,
+ const OUString& sTitle ,
+ const OUString& sPassword )
+{
+ impl_truncateList (eHistory, GetSize (eHistory));
+
+ css::uno::Reference< css::container::XNameAccess > xListAccess;
+ sal_Int32 nMaxSize = 0;
+
+ switch(eHistory)
+ {
+ case ePICKLIST:
+ {
+ m_xCfg->getByName(s_sPickList) >>= xListAccess;
+ nMaxSize = GetSize(ePICKLIST);
+ }
+ break;
+ case eHISTORY:
+ {
+ m_xCfg->getByName(s_sURLHistory) >>= xListAccess;
+ nMaxSize = GetSize(eHISTORY);
+ }
+ break;
+ case eHELPBOOKMARKS:
+ {
+ m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess;
+ nMaxSize = GetSize(eHELPBOOKMARKS);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (nMaxSize==0)
+ return;
+
+ css::uno::Reference< css::container::XNameContainer > xItemList;
+ css::uno::Reference< css::container::XNameContainer > xOrderList;
+ css::uno::Reference< css::beans::XPropertySet > xSet;
+
+ try
+ {
+ xListAccess->getByName(s_sItemList) >>= xItemList;
+ xListAccess->getByName(s_sOrderList) >>= xOrderList;
+ sal_Int32 nLength = xOrderList->getElementNames().getLength();
+
+ // The item to be appended is already existing!
+ if (xItemList->hasByName(sURL))
+ {
+ for (sal_Int32 i=0; igetByName(::rtl::OUString::valueOf(i)) >>= xSet;
+ xSet->getPropertyValue(s_sHistoryItemRef) >>= sTmp;
+
+ if(sURL == sTmp)
+ {
+ ::rtl::OUString sFind;
+ xOrderList->getByName( ::rtl::OUString::valueOf(i) ) >>= xSet;
+ xSet->getPropertyValue(s_sHistoryItemRef) >>= sFind;
+ for (sal_Int32 j=i-1; j>=0; --j)
+ {
+ css::uno::Reference< css::beans::XPropertySet > xPrevSet;
+ css::uno::Reference< css::beans::XPropertySet > xNextSet;
+ xOrderList->getByName( ::rtl::OUString::valueOf(j+1) ) >>= xPrevSet;
+ xOrderList->getByName( ::rtl::OUString::valueOf(j) ) >>= xNextSet;
+
+ ::rtl::OUString sTemp;
+ xNextSet->getPropertyValue(s_sHistoryItemRef) >>= sTemp;
+ xPrevSet->setPropertyValue(s_sHistoryItemRef, css::uno::makeAny(sTemp));
+ }
+ xOrderList->getByName( ::rtl::OUString::valueOf((sal_Int32)0) ) >>= xSet;
+ xSet->setPropertyValue(s_sHistoryItemRef, css::uno::makeAny(sFind));
+
+ ::comphelper::ConfigurationHelper::flush(m_xCfg);
+ break;
+ }
+ }
+ }
+
+ // The item to be appended is not existing!
+ else
+ {
+ css::uno::Reference< css::lang::XSingleServiceFactory > xFac;
+ css::uno::Reference< css::uno::XInterface > xInst;
+ css::uno::Reference< css::beans::XPropertySet > xPrevSet;
+ css::uno::Reference< css::beans::XPropertySet > xNextSet;
+
+ // Append new item to OrderList.
+ if ( nLength == nMaxSize )
+ {
+ ::rtl::OUString sRemove;
+ xOrderList->getByName(::rtl::OUString::valueOf(nLength-1)) >>= xSet;
+ xSet->getPropertyValue(s_sHistoryItemRef) >>= sRemove;
+ xItemList->removeByName(sRemove);
+ }
+ if ( nLength != nMaxSize )
+ {
+ xFac = css::uno::Reference< css::lang::XSingleServiceFactory >(xOrderList, css::uno::UNO_QUERY);
+ xInst = xFac->createInstance();
+ ::rtl::OUString sPush = ::rtl::OUString::valueOf(nLength++);
+ xOrderList->insertByName(sPush, css::uno::makeAny(xInst));
+ }
+ for (sal_Int32 j=nLength-1; j>0; --j)
+ {
+ xOrderList->getByName( ::rtl::OUString::valueOf(j) ) >>= xPrevSet;
+ xOrderList->getByName( ::rtl::OUString::valueOf(j-1) ) >>= xNextSet;
+ ::rtl::OUString sTemp;
+ xNextSet->getPropertyValue(s_sHistoryItemRef) >>= sTemp;
+ xPrevSet->setPropertyValue(s_sHistoryItemRef, css::uno::makeAny(sTemp));
+ }
+ xOrderList->getByName( ::rtl::OUString::valueOf((sal_Int32)0) ) >>= xSet;
+ xSet->setPropertyValue(s_sHistoryItemRef, css::uno::makeAny(sURL));
+
+ // Append the item to ItemList.
+ xFac = css::uno::Reference< css::lang::XSingleServiceFactory >(xItemList, css::uno::UNO_QUERY);
+ xInst = xFac->createInstance();
+ xItemList->insertByName(sURL, css::uno::makeAny(xInst));
+ xSet = css::uno::Reference< css::beans::XPropertySet >(xInst, css::uno::UNO_QUERY);
+ xSet->setPropertyValue(s_sFilter, css::uno::makeAny(sFilter));
+ xSet->setPropertyValue(s_sTitle, css::uno::makeAny(sTitle));
+ xSet->setPropertyValue(s_sPassword, css::uno::makeAny(sPassword));
+
+ ::comphelper::ConfigurationHelper::flush(m_xCfg);
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ LogHelper::logIt(ex);
+ }
+}
+
+//*****************************************************************************************************************
+// initialize static member
+// DON'T DO IT IN YOUR HEADER!
+// see definition for further informations
+//*****************************************************************************************************************
+SvtHistoryOptions_Impl* SvtHistoryOptions::m_pDataContainer = NULL ;
+sal_Int32 SvtHistoryOptions::m_nRefCount = 0 ;
+
+//*****************************************************************************************************************
+// constructor
+//*****************************************************************************************************************
+SvtHistoryOptions::SvtHistoryOptions()
+{
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Increase ouer refcount ...
+ ++m_nRefCount;
+ // ... and initialize ouer data container only if it not already exist!
+ if( m_pDataContainer == NULL )
+ {
+ RTL_LOGFILE_CONTEXT(aLog, "svtools ( ??? ) ::SvtHistoryOptions_Impl::ctor()");
+ m_pDataContainer = new SvtHistoryOptions_Impl;
+
+ ItemHolder1::holdConfigItem(E_HISTORYOPTIONS);
+ }
+}
+
+//*****************************************************************************************************************
+// destructor
+//*****************************************************************************************************************
+SvtHistoryOptions::~SvtHistoryOptions()
+{
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ // Decrease ouer refcount.
+ --m_nRefCount;
+ // If last instance was deleted ...
+ // we must destroy ouer static data container!
+ if( m_nRefCount <= 0 )
+ {
+ delete m_pDataContainer;
+ m_pDataContainer = NULL;
+ }
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+sal_uInt32 SvtHistoryOptions::GetSize( EHistoryType eHistory ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetSize( eHistory );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtHistoryOptions::SetSize( EHistoryType eHistory, sal_uInt32 nSize )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetSize( eHistory, nSize );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtHistoryOptions::Clear( EHistoryType eHistory )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->Clear( eHistory );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+Sequence< Sequence< PropertyValue > > SvtHistoryOptions::GetList( EHistoryType eHistory ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetList( eHistory );
+}
+
+//*****************************************************************************************************************
+// public method
+//*****************************************************************************************************************
+void SvtHistoryOptions::AppendItem( EHistoryType eHistory ,
+ const OUString& sURL ,
+ const OUString& sFilter ,
+ const OUString& sTitle ,
+ const OUString& sPassword )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->AppendItem( eHistory, sURL, sFilter, sTitle, sPassword );
+}
+
+//*****************************************************************************************************************
+// private method
+//*****************************************************************************************************************
+Mutex& SvtHistoryOptions::GetOwnStaticMutex()
+{
+ // Initialize static mutex only for one time!
+ static Mutex* pMutex = NULL;
+ // If these method first called (Mutex not already exist!) ...
+ if( pMutex == NULL )
+ {
+ // ... we must create a new one. Protect follow code with the global mutex -
+ // It must be - we create a static variable!
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
+ if( pMutex == NULL )
+ {
+ // Create the new mutex and set it for return on static variable.
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
+ // Return new created or already existing mutex object.
+ return *pMutex;
+}
diff --git a/unotools/source/config/inetoptions.cxx b/unotools/source/config/inetoptions.cxx
new file mode 100644
index 000000000000..13c72d73152d
--- /dev/null
+++ b/unotools/source/config/inetoptions.cxx
@@ -0,0 +1,557 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: inetoptions.cxx,v $
+ * $Revision: 1.33 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+#include
+#include "rtl/instance.hxx"
+#include
+#ifndef _WILDCARD_HXX
+#include
+#endif
+
+#include
+#include