diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-06 07:38:24 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-06 07:38:24 +0200 |
commit | f87ee64d502aec9365d98d53d5b913f6456eae6b (patch) | |
tree | 293ad32cd784b2b036b076020dd1b3f1256bdcd5 /unotools/inc | |
parent | 4de41d18fd2b96079b9a0aa9f1ef123e431fe938 (diff) |
#103496#: move VCL free ConfigItems to unotools
Diffstat (limited to 'unotools/inc')
38 files changed, 5576 insertions, 1 deletions
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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_ACCELCFG_HXX +#define INCLUDED_unotools_ACCELCFG_HXX + +#include <com/sun/star/awt/KeyEvent.hpp> +#include <unotools/options.hxx> + +#include <rtl/ustring.hxx> +#include <tools/stream.hxx> + +struct SvtAcceleratorConfigItem +{ + sal_uInt16 nCode; + sal_uInt16 nModifier; + ::rtl::OUString aCommand; +}; + +#include <list> +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_unotools_CACHEOPTIONS_HXX +#define INCLUDED_unotools_CACHEOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_CMDOPTIONS_HXX +#define INCLUDED_unotools_CMDOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/frame/XFrame.hpp> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_COMPATIBILITY_HXX +#define INCLUDED_unotools_COMPATIBILITY_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 <com/sun/star/uno/Sequence.h> #include <com/sun/star/uno/Reference.h> #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 + * <http://www.openoffice.org/license.html> + * 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 <unotools/options.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX +#define INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _EVENTCFG_HXX +#define _EVENTCFG_HXX + +#include "unotools/unotoolsdllapi.h" +#include <unotools/configitem.hxx> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/frame/XFrame.hpp> +#include <cppuhelper/weakref.hxx> +#include <cppuhelper/implbase2.hxx> +#include <hash_map> +#include <vector> + +#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<rtl::OUString>& 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX +#define INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SVT_FLTRCFG_HXX +#define _SVT_FLTRCFG_HXX + +// ----------------------------------------------------------------------- + +#include "unotools/unotoolsdllapi.h" +#include <unotools/configitem.hxx> + +struct SvtFilterOptions_Impl; +class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public utl::ConfigItem +{ + SvtFilterOptions_Impl* pImp; + + const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames(); +public: + SvtFilterOptions(); + virtual ~SvtFilterOptions(); + + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_FONTOPTIONS_HXX +#define INCLUDED_unotools_FONTOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX +#define INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 <rtl/ustring.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _unotools_INETOPTIONS_HXX_ +#define _unotools_INETOPTIONS_HXX_ + +#include "unotools/unotoolsdllapi.h" +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <sal/types.h> +#include <unotools/options.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_INTERNALOPTIONS_HXX +#define INCLUDED_unotools_INTERNALOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_unotools_ITEMHOLDERBASE_HXX_ +#define INCLUDED_unotools_ITEMHOLDERBASE_HXX_ + +//----------------------------------------------- +// includes + +#include <vector> +#include <osl/mutex.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _unotools_JAVAOPTIONS_HXX +#define _unotools_JAVAOPTIONS_HXX + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <unotools/configitem.hxx> + + +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _unotools_LINGUCFG_HXX_ +#define _unotools_LINGUCFG_HXX_ + +#include "unotools/unotoolsdllapi.h" +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/Any.h> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/util/XChangesBatch.hpp> +#include <tools/solar.h> +#include <rtl/ustring.hxx> +#include <unotools/configitem.hxx> +#include <osl/mutex.hxx> +#include <unotools/options.hxx> +#include <i18npool/lang.h> + +#include <vector> + +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 + * <http://www.openoffice.org/license.html> + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX +#define INCLUDED_unotools_LOCALISATIONOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include <sal/types.h> +#include "unotools/unotoolsdllapi.h" +#include <osl/mutex.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX +#define INCLUDED_SVTOOLS_MODULEOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <salhelper/singletonref.hxx> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <rtl/ustring.hxx> +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * 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 + * <http://www.openoffice.org/license.html> + * 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 <tools/string.hxx> +#include <unotools/options.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_PATHOPTIONS_HXX +#define INCLUDED_unotools_PATHOPTIONS_HXX + +#include "unotools/unotoolsdllapi.h" +#include <tools/string.hxx> +#include <com/sun/star/lang/Locale.hpp> +#include <unotools/options.hxx> + +#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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX +#define INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef unotools_REGOPTIONS_HXX +#define unotools_REGOPTIONS_HXX + +#include "unotools/unotoolsdllapi.h" +#include <tools/string.hxx> + +//........................................................................ +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 + <p>A return value of <TRUE/> does not mean that during this session, the dialog is allowed to + be executed. It simply means executing it is allowed <em>in general</em></p> + */ + DialogPermission getDialogPermission( ) const; + + /** claims that the current session is done with respect to the registration dialog. + + <p>This is not to be called if <method>getDialogPermission</method> returned dpDisabled previously<p> + <p>The behaviour changes as follows: + <ul> + <li>any subsequent calls to <method>getDialogPermission</method> will return dpNotThisSession, given + that it previously returned dpNotThisSession</li> + <li>any subsequent calls to <method>getDialogPermission</method> will return dpDisabled, given + that it previously returned dpThisSession</li> + <li>an internal (persistent) session counter is updated, so that during the next session, + <method>getDialogPermission</method> <em>may</em> return dpThisSession</li> + </ul></p> + */ + void markSessionDone( ); + + /** activates the reminder + + <p>If this method is called, the reminder for the dialog will be activated. + This means that during the next <arg>_nDaysFromNow</arg>-1 days, + <method>getDialogPermission</method> will return dpRemindLater</p>, + at the <arg>_nDaysFromNow</arg>th day from today onwards it will + return dpThisSession.</p> + + <p>It is not allowed to call this method if the dialog is currently disabled.</p> + + <p>If the current session has not been marked as done already + (i.e., <method>markSessionDone</method> has not been called, yet), this is + done implicitly when you call <method>activateReminder</method>.</p> + */ + void activateReminder( sal_Int32 _nDaysFromNow ); + + /** removes the reminder + + <p>If this method is called, the reminder for the dialog will be removed. + */ + void removeReminder(); + + /** checks if the reminder date has come + + <p>Returns <true/> 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_SAVEOPT_HXX +#define INCLUDED_unotools_SAVEOPT_HXX + +#include "unotools/unotoolsdllapi.h" +#include <unotools/options.hxx> + +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 + * <http://www.openoffice.org/license.html> + * 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX +#define INCLUDED_unotools_SECURITYOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 <TRUE/> if item is readonly; <FALSE/> 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _unotools_SOURCEVIEWCONFIG_HXX +#define _unotools_SOURCEVIEWCONFIG_HXX + +// include --------------------------------------------------------------- + +#include "unotools/unotoolsdllapi.h" +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +/* -----------------------------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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_STARTOPTIONS_HXX +#define INCLUDED_unotools_STARTOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_UNDOOPT_HXX +#define INCLUDED_unotools_UNDOOPT_HXX + +#include "unotools/unotoolsdllapi.h" +#include <sal/types.h> +#include <unotools/options.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_USEROPTIONS_HXX +#define INCLUDED_unotools_USEROPTIONS_HXX + +#include "unotools/unotoolsdllapi.h" +#include <unotools/configitem.hxx> +#include <tools/string.hxx> +#include <osl/mutex.hxx> +#include <unotools/options.hxx> + +// 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 <rtl/ustring.hxx> + +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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_VIEWOPTIONS_HXX +#define INCLUDED_unotools_VIEWOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include "unotools/unotoolsdllapi.h" +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/beans/NamedValue.hpp> +#include <unotools/configmgr.hxx> +#include <unotools/configitem.hxx> +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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_<YourName> [DialogType] + + /TabDialogs [set] + /TabDialog_001 [TabDialogType] + /TabDialog_Blubber [TabDialogType] + ... + /TabDialog_<YourName> [TabDialogType] + + /TabPages [set] + /TabPage_XXX [TabPageType] + /TabPage_Date [TabPageType] + ... + /TabPage_<YourName> [TabPageType] + + /Windows [set] + /Window_User [WindowType] + /Window_Options [WindowType] + ... + /Window_<YourName> [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 + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX +#define INCLUDED_unotools_WORKINGSETOPTIONS_HXX + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#include <sal/types.h> +#include <osl/mutex.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> + +//_________________________________________________________________________________________________________________ +// 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 + * <http://www.openoffice.org/license.html> + * 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 <com/sun/star/xml/sax/XDocumentHandler.hpp> +#endif +#include <cppuhelper/weak.hxx> + +#include <unotools/accelcfg.hxx> + +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 |