2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* 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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* 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).
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 19:41:15 +00:00
|
|
|
* 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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _USRPREF_HXX
|
|
|
|
#define _USRPREF_HXX
|
|
|
|
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
|
|
|
|
#include <unotools/configitem.hxx>
|
|
|
|
#include <fldupde.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include "viewopt.hxx"
|
2001-02-13 08:52:11 +00:00
|
|
|
#include <vcl/fldunit.hxx>
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
/* -----------------------------28.09.00 09:45--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
class SwMasterUsrPref;
|
|
|
|
class SwContentViewConfig : public utl::ConfigItem
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
SwMasterUsrPref& rParent;
|
|
|
|
BOOL bWeb;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
|
|
|
|
public:
|
|
|
|
SwContentViewConfig(BOOL bWeb, SwMasterUsrPref& rParent);
|
|
|
|
~SwContentViewConfig();
|
|
|
|
|
2007-06-27 11:50:12 +00:00
|
|
|
// utl::ConfigItem
|
|
|
|
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames );
|
|
|
|
virtual void Commit();
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
void Load();
|
|
|
|
void SetModified(){ConfigItem::SetModified();}
|
|
|
|
};
|
|
|
|
/* -----------------------------28.09.00 09:45--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
class SwLayoutViewConfig : public utl::ConfigItem
|
|
|
|
{
|
|
|
|
SwMasterUsrPref& rParent;
|
|
|
|
BOOL bWeb;
|
|
|
|
|
|
|
|
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
|
|
|
|
public:
|
|
|
|
SwLayoutViewConfig(BOOL bWeb, SwMasterUsrPref& rParent);
|
|
|
|
~SwLayoutViewConfig();
|
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
|
2000-09-28 14:25:03 +00:00
|
|
|
virtual void Commit();
|
|
|
|
void Load();
|
|
|
|
void SetModified(){ConfigItem::SetModified();}
|
|
|
|
};
|
2001-01-19 11:45:03 +00:00
|
|
|
/* -----------------------------19.01.01 13:06--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
class SwGridConfig : public utl::ConfigItem
|
|
|
|
{
|
|
|
|
SwMasterUsrPref& rParent;
|
|
|
|
BOOL bWeb;
|
|
|
|
|
|
|
|
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
|
|
|
|
public:
|
|
|
|
SwGridConfig(BOOL bWeb, SwMasterUsrPref& rParent);
|
|
|
|
~SwGridConfig();
|
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
virtual void Commit();
|
|
|
|
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
|
2001-01-19 11:45:03 +00:00
|
|
|
void Load();
|
|
|
|
void SetModified(){ConfigItem::SetModified();}
|
|
|
|
};
|
2001-01-24 15:08:03 +00:00
|
|
|
/* -----------------------------19.01.01 13:06--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
class SwCursorConfig : public utl::ConfigItem
|
|
|
|
{
|
|
|
|
SwMasterUsrPref& rParent;
|
|
|
|
|
|
|
|
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
|
|
|
|
public:
|
|
|
|
SwCursorConfig(SwMasterUsrPref& rParent);
|
|
|
|
~SwCursorConfig();
|
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
virtual void Commit();
|
|
|
|
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
|
2001-01-24 15:08:03 +00:00
|
|
|
void Load();
|
|
|
|
void SetModified(){ConfigItem::SetModified();}
|
|
|
|
};
|
2001-02-13 08:52:11 +00:00
|
|
|
/* -----------------------------28.09.00 09:45--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
class SwWebColorConfig : public utl::ConfigItem
|
|
|
|
{
|
|
|
|
SwMasterUsrPref& rParent;
|
|
|
|
com::sun::star::uno::Sequence<rtl::OUString> aPropNames;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SwWebColorConfig(SwMasterUsrPref& rParent);
|
|
|
|
~SwWebColorConfig();
|
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
virtual void Commit();
|
|
|
|
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
|
2001-02-13 08:52:11 +00:00
|
|
|
void Load();
|
|
|
|
void SetModified(){ConfigItem::SetModified();}
|
|
|
|
};
|
2000-09-28 14:25:03 +00:00
|
|
|
/* -----------------------------28.09.00 09:45--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
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;
|
2000-09-28 14:25:03 +00:00
|
|
|
|
2007-09-27 11:13:49 +00:00
|
|
|
SwFldUpdateFlags eFldUpdateFlags; //udpate of fields and charts
|
2000-09-28 14:25:03 +00:00
|
|
|
sal_Int32 nLinkUpdateMode;
|
|
|
|
FieldUnit eUserMetric;
|
2001-04-09 08:46:35 +00:00
|
|
|
FieldUnit eHScrollMetric;
|
|
|
|
sal_Bool bIsHScrollMetricSet;
|
|
|
|
FieldUnit eVScrollMetric;
|
|
|
|
sal_Bool bIsVScrollMetricSet;
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
sal_Int32 nDefTab; //default tab stop distance
|
|
|
|
|
2008-03-07 15:33:48 +00:00
|
|
|
sal_Bool bIsSquaredPageMode; //default page mode for text grid
|
2010-10-20 10:32:29 +02:00
|
|
|
sal_Bool bIsAlignMathObjectsToBaseline;
|
|
|
|
|
2007-11-06 15:26:43 +00:00
|
|
|
SwContentViewConfig aContentConfig;
|
|
|
|
SwLayoutViewConfig aLayoutConfig;
|
|
|
|
SwGridConfig aGridConfig;
|
|
|
|
SwCursorConfig aCursorConfig;
|
|
|
|
SwWebColorConfig* pWebColorConfig;
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
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);
|
2000-09-28 14:25:03 +00:00
|
|
|
|
|
|
|
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();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
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();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetUpdateLinkMode(sal_Int32 nSet, sal_Bool bNoModify = sal_False)
|
|
|
|
{
|
|
|
|
nLinkUpdateMode = nSet;
|
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
sal_Int32 GetUpdateLinkMode() const {return nLinkUpdateMode; }
|
|
|
|
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetUpdateFields(BOOL bSet, sal_Bool bNoModify = sal_False)
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
if(bSet && eFldUpdateFlags == AUTOUPD_OFF)
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
eFldUpdateFlags = AUTOUPD_FIELD_ONLY;
|
2001-06-25 13:46:04 +00:00
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
else if(!bSet)
|
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
eFldUpdateFlags = AUTOUPD_OFF;
|
2001-06-25 13:46:04 +00:00
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
};
|
2007-09-27 11:13:49 +00:00
|
|
|
sal_Bool IsUpdateFields()const {return eFldUpdateFlags != AUTOUPD_OFF; }
|
2000-09-28 14:25:03 +00:00
|
|
|
|
2007-09-27 11:13:49 +00:00
|
|
|
SwFldUpdateFlags GetFldUpdateFlags()const {return eFldUpdateFlags;}
|
|
|
|
void SetFldUpdateFlags(SwFldUpdateFlags eSet, sal_Bool bNoModify = sal_False)
|
2001-06-25 13:46:04 +00:00
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
eFldUpdateFlags = eSet;
|
2001-06-25 13:46:04 +00:00
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetUpdateCharts(BOOL bSet, sal_Bool bNoModify = sal_False)
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
|
|
|
if(bSet)
|
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
eFldUpdateFlags = AUTOUPD_FIELD_AND_CHARTS;
|
2001-06-25 13:46:04 +00:00
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
2007-09-27 11:13:49 +00:00
|
|
|
else if(eFldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS)
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
2007-09-27 11:13:49 +00:00
|
|
|
eFldUpdateFlags = AUTOUPD_FIELD_ONLY;
|
2001-06-25 13:46:04 +00:00
|
|
|
if(!bNoModify)
|
|
|
|
aContentConfig.SetModified();
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
};
|
2007-09-27 11:13:49 +00:00
|
|
|
sal_Bool IsUpdateCharts()const {return eFldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS; }
|
2000-09-28 14:25:03 +00:00
|
|
|
|
|
|
|
FieldUnit GetMetric() const { return eUserMetric;}
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetMetric(FieldUnit eSet, sal_Bool bNoModify = sal_False)
|
|
|
|
{
|
|
|
|
eUserMetric = eSet;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
|
2001-04-09 08:46:35 +00:00
|
|
|
sal_Bool IsHScrollMetric()const {return bIsHScrollMetricSet;}
|
|
|
|
FieldUnit GetHScrollMetric() const { return bIsHScrollMetricSet ? eHScrollMetric : eUserMetric;}
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetHScrollMetric(FieldUnit eSet, sal_Bool bNoModify = sal_False)
|
|
|
|
{
|
|
|
|
eHScrollMetric = eSet; bIsHScrollMetricSet = sal_True;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
2001-04-09 08:46:35 +00:00
|
|
|
|
|
|
|
sal_Bool IsVScrollMetric()const {return bIsVScrollMetricSet;}
|
|
|
|
FieldUnit GetVScrollMetric() const { return bIsVScrollMetricSet ? eVScrollMetric : eUserMetric;}
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetVScrollMetric(FieldUnit eSet, sal_Bool bNoModify = sal_False)
|
|
|
|
{
|
|
|
|
eVScrollMetric = eSet; bIsVScrollMetricSet = sal_True;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
2001-04-09 08:46:35 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
sal_Int32 GetDefTab() const { return nDefTab;}
|
2001-06-25 13:46:04 +00:00
|
|
|
void SetDefTab( sal_Int32 nSet, sal_Bool bNoModify = sal_False )
|
|
|
|
{
|
|
|
|
nDefTab = nSet;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
2001-02-13 08:52:11 +00:00
|
|
|
|
2008-03-07 15:33:48 +00:00
|
|
|
//default page mode for text grid
|
|
|
|
sal_Bool IsSquaredPageMode() const {return bIsSquaredPageMode;}
|
|
|
|
void SetDefaultPageMode( sal_Bool bVal, sal_Bool bNoModify = sal_False )
|
|
|
|
{
|
|
|
|
bIsSquaredPageMode = bVal;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
|
|
|
|
2010-10-20 10:32:29 +02:00
|
|
|
sal_Bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; }
|
|
|
|
void SetAlignMathObjectsToBaseline( sal_Bool bVal, sal_Bool bNoModify = sal_False )
|
|
|
|
{
|
|
|
|
bIsAlignMathObjectsToBaseline = bVal;
|
|
|
|
if(!bNoModify)
|
|
|
|
aLayoutConfig.SetModified();
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|