Files
libreoffice/sw/source/uibase/inc/usrpref.hxx

291 lines
9.4 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_USRPREF_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_USRPREF_HXX
2000-09-18 16:15:01 +00:00
#include <unotools/configitem.hxx>
#include <fldupde.hxx>
2000-09-18 16:15:01 +00:00
#include "viewopt.hxx"
2010-11-23 18:41:04 +01:00
#include <tools/fldunit.hxx>
2001-02-13 08:52:11 +00:00
class SwMasterUsrPref;
class SwContentViewConfig : public utl::ConfigItem
2000-09-18 16:15:01 +00:00
{
private:
SwMasterUsrPref& rParent;
bool bWeb;
2000-09-18 16:15:01 +00:00
com::sun::star::uno::Sequence<OUString> GetPropertyNames();
virtual void ImplCommit() SAL_OVERRIDE;
public:
SwContentViewConfig(bool bWeb, SwMasterUsrPref& rParent);
virtual ~SwContentViewConfig();
// utl::ConfigItem
virtual void Notify( const com::sun::star::uno::Sequence< OUString > &rPropertyNames ) SAL_OVERRIDE;
void Load();
void SetModified(){ConfigItem::SetModified();}
};
class SwLayoutViewConfig : public utl::ConfigItem
{
private:
SwMasterUsrPref& rParent;
bool bWeb;
com::sun::star::uno::Sequence<OUString> GetPropertyNames();
virtual void ImplCommit() SAL_OVERRIDE;
public:
SwLayoutViewConfig(bool bWeb, SwMasterUsrPref& rParent);
virtual ~SwLayoutViewConfig();
virtual void Notify( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) SAL_OVERRIDE;
void Load();
void SetModified(){ConfigItem::SetModified();}
};
2001-01-19 11:45:03 +00:00
class SwGridConfig : public utl::ConfigItem
{
private:
2001-01-19 11:45:03 +00:00
SwMasterUsrPref& rParent;
static com::sun::star::uno::Sequence<OUString> GetPropertyNames();
virtual void ImplCommit() SAL_OVERRIDE;
public:
SwGridConfig(bool bWeb, SwMasterUsrPref& rParent);
virtual ~SwGridConfig();
2001-01-19 11:45:03 +00:00
virtual void Notify( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) SAL_OVERRIDE;
2001-01-19 11:45:03 +00:00
void Load();
void SetModified(){ConfigItem::SetModified();}
};
2001-01-24 15:08:03 +00:00
class SwCursorConfig : public utl::ConfigItem
{
private:
2001-01-24 15:08:03 +00:00
SwMasterUsrPref& rParent;
static com::sun::star::uno::Sequence<OUString> GetPropertyNames();
virtual void ImplCommit() SAL_OVERRIDE;
public:
SwCursorConfig(SwMasterUsrPref& rParent);
virtual ~SwCursorConfig();
2001-01-24 15:08:03 +00:00
virtual void Notify( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) SAL_OVERRIDE;
2001-01-24 15:08:03 +00:00
void Load();
void SetModified(){ConfigItem::SetModified();}
};
2001-02-13 08:52:11 +00:00
class SwWebColorConfig : public utl::ConfigItem
{
private:
2001-02-13 08:52:11 +00:00
SwMasterUsrPref& rParent;
com::sun::star::uno::Sequence<OUString> aPropNames;
2001-02-13 08:52:11 +00:00
virtual void ImplCommit() SAL_OVERRIDE;
public:
SwWebColorConfig(SwMasterUsrPref& rParent);
virtual ~SwWebColorConfig();
2001-02-13 08:52:11 +00:00
virtual void Notify( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) SAL_OVERRIDE;
2001-02-13 08:52:11 +00:00
void Load();
void SetModified(){ConfigItem::SetModified();}
};
class SwMasterUsrPref : public SwViewOption
{
friend class SwContentViewConfig;
friend class SwLayoutViewConfig;
2001-01-19 11:45:03 +00:00
friend class SwGridConfig;
2001-01-24 15:08:03 +00:00
friend class SwCursorConfig;
2001-02-13 08:52:11 +00:00
friend class SwWebColorConfig;
SwFieldUpdateFlags eFieldUpdateFlags; //update of fields and charts
sal_Int32 nLinkUpdateMode;
FieldUnit eUserMetric;
FieldUnit eHScrollMetric;
bool bIsHScrollMetricSet;
FieldUnit eVScrollMetric;
bool bIsVScrollMetricSet;
sal_Int32 nDefTab; //default tab stop distance
bool bIsSquaredPageMode; //default page mode for text grid
bool bIsAlignMathObjectsToBaseline;
SwContentViewConfig aContentConfig;
SwLayoutViewConfig aLayoutConfig;
SwGridConfig aGridConfig;
SwCursorConfig aCursorConfig;
SwWebColorConfig* pWebColorConfig;
bool bApplyCharUnit; // apply_char_unit
public:
SwMasterUsrPref(bool bWeb);
2001-02-13 08:52:11 +00:00
~SwMasterUsrPref();
2000-09-18 16:15:01 +00:00
void SetUsrPref(const SwViewOption &rCopy);
void Commit()
{
aContentConfig.Commit();
aLayoutConfig.Commit();
2001-01-19 11:45:03 +00:00
aGridConfig.Commit();
2001-01-24 15:08:03 +00:00
aCursorConfig.Commit();
2001-02-13 08:52:11 +00:00
if(pWebColorConfig)
pWebColorConfig->Commit();
}
void SetModified()
{
aContentConfig.SetModified();
aLayoutConfig.SetModified();
2001-01-19 11:45:03 +00:00
aGridConfig.SetModified();
2001-01-24 15:08:03 +00:00
aCursorConfig.SetModified();
2001-02-13 08:52:11 +00:00
if(pWebColorConfig)
pWebColorConfig->SetModified();
}
void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify = false)
{
nLinkUpdateMode = nSet;
if(!bNoModify)
aContentConfig.SetModified();
}
sal_Int32 GetUpdateLinkMode() const {return nLinkUpdateMode; }
void SetUpdateFields(bool bSet, bool bNoModify = false)
{
if(bSet && eFieldUpdateFlags == AUTOUPD_OFF)
{
eFieldUpdateFlags = AUTOUPD_FIELD_ONLY;
if(!bNoModify)
aContentConfig.SetModified();
}
else if(!bSet)
{
eFieldUpdateFlags = AUTOUPD_OFF;
if(!bNoModify)
aContentConfig.SetModified();
}
};
bool IsUpdateFields()const {return eFieldUpdateFlags != AUTOUPD_OFF; }
SwFieldUpdateFlags GetFieldUpdateFlags()const {return eFieldUpdateFlags;}
void SetFieldUpdateFlags(SwFieldUpdateFlags eSet, bool bNoModify = false)
{
eFieldUpdateFlags = eSet;
if(!bNoModify)
aContentConfig.SetModified();
}
void SetUpdateCharts(bool bSet, bool bNoModify = false)
{
if(bSet)
{
eFieldUpdateFlags = AUTOUPD_FIELD_AND_CHARTS;
if(!bNoModify)
aContentConfig.SetModified();
}
else if(eFieldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS)
{
eFieldUpdateFlags = AUTOUPD_FIELD_ONLY;
if(!bNoModify)
aContentConfig.SetModified();
}
};
bool IsUpdateCharts()const {return eFieldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS; }
FieldUnit GetMetric() const { return eUserMetric;}
void SetMetric(FieldUnit eSet, bool bNoModify = false)
{
eUserMetric = eSet;
if(!bNoModify)
aLayoutConfig.SetModified();
}
bool IsHScrollMetric()const {return bIsHScrollMetricSet;}
FieldUnit GetHScrollMetric() const { return bIsHScrollMetricSet ? eHScrollMetric : eUserMetric;}
void SetHScrollMetric(FieldUnit eSet, bool bNoModify = false)
{
eHScrollMetric = eSet; bIsHScrollMetricSet = true;
if(!bNoModify)
aLayoutConfig.SetModified();
}
bool IsVScrollMetric()const {return bIsVScrollMetricSet;}
FieldUnit GetVScrollMetric() const { return bIsVScrollMetricSet ? eVScrollMetric : eUserMetric;}
void SetVScrollMetric(FieldUnit eSet, bool bNoModify = false)
{
eVScrollMetric = eSet; bIsVScrollMetricSet = true;
if(!bNoModify)
aLayoutConfig.SetModified();
}
bool IsApplyCharUnit() const
{
return bApplyCharUnit;
}
void SetApplyCharUnit(bool bSet, bool bNoModify = false)
{
bApplyCharUnit = bSet;
if(!bNoModify)
aLayoutConfig.SetModified();
}
sal_Int32 GetDefTab() const { return nDefTab;}
void SetDefTab( sal_Int32 nSet, bool bNoModify = false )
{
nDefTab = nSet;
if(!bNoModify)
aLayoutConfig.SetModified();
}
2001-02-13 08:52:11 +00:00
//default page mode for text grid
bool IsSquaredPageMode() const {return bIsSquaredPageMode;}
void SetDefaultPageMode( bool bVal, bool bNoModify = false )
{
bIsSquaredPageMode = bVal;
if(!bNoModify)
aLayoutConfig.SetModified();
}
bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; }
void SetAlignMathObjectsToBaseline( bool bVal, bool bNoModify = false )
{
bIsAlignMathObjectsToBaseline = bVal;
if(!bNoModify)
aLayoutConfig.SetModified();
}
2000-09-18 16:15:01 +00:00
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */