xref: /aoo41x/main/sc/inc/appoptio.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SC_APPOPTIO_HXX
29*cdf0e10cSrcweir #define SC_APPOPTIO_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <vcl/field.hxx>
32*cdf0e10cSrcweir #include <svx/zoomitem.hxx>
33*cdf0e10cSrcweir #include <unotools/configitem.hxx>
34*cdf0e10cSrcweir #include "scdllapi.h"
35*cdf0e10cSrcweir #include "global.hxx"
36*cdf0e10cSrcweir #include "optutil.hxx"
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir class SC_DLLPUBLIC ScAppOptions
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir public:
41*cdf0e10cSrcweir 				ScAppOptions();
42*cdf0e10cSrcweir 				ScAppOptions( const ScAppOptions& rCpy );
43*cdf0e10cSrcweir 				~ScAppOptions();
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 	void		SetDefaults();
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir 	void		SetAppMetric( FieldUnit eUnit )	{ eMetric = eUnit;		}
48*cdf0e10cSrcweir 	FieldUnit	GetAppMetric() const			{ return eMetric;		}
49*cdf0e10cSrcweir 	void		SetZoom( sal_uInt16 nNew )			{ nZoom = nNew;			}
50*cdf0e10cSrcweir 	sal_uInt16		GetZoom() const					{ return nZoom;			}
51*cdf0e10cSrcweir 	void		SetZoomType( SvxZoomType eNew ) { eZoomType = eNew;		}
52*cdf0e10cSrcweir 	SvxZoomType	GetZoomType() const				{ return eZoomType;		}
53*cdf0e10cSrcweir     void        SetSynchronizeZoom( sal_Bool bNew ) { bSynchronizeZoom = bNew; }
54*cdf0e10cSrcweir     sal_Bool        GetSynchronizeZoom() const      { return bSynchronizeZoom; }
55*cdf0e10cSrcweir 	sal_uInt16		GetLRUFuncListCount() const		{ return nLRUFuncCount;	}
56*cdf0e10cSrcweir 	sal_uInt16*		GetLRUFuncList() const			{ return pLRUList;		}
57*cdf0e10cSrcweir 	void		SetLRUFuncList( const sal_uInt16* pList,
58*cdf0e10cSrcweir 								const sal_uInt16  nCount );
59*cdf0e10cSrcweir 	void		SetStatusFunc( sal_uInt16 nNew )	{ nStatusFunc = nNew;	}
60*cdf0e10cSrcweir 	sal_uInt16		GetStatusFunc() const			{ return nStatusFunc;	}
61*cdf0e10cSrcweir 	void		SetAutoComplete( sal_Bool bNew )	{ bAutoComplete = bNew; }
62*cdf0e10cSrcweir 	sal_Bool		GetAutoComplete() const			{ return bAutoComplete;	}
63*cdf0e10cSrcweir 	void		SetDetectiveAuto( sal_Bool bNew )	{ bDetectiveAuto = bNew; }
64*cdf0e10cSrcweir 	sal_Bool		GetDetectiveAuto() const		{ return bDetectiveAuto; }
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 	void		SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; }
67*cdf0e10cSrcweir 	sal_uInt32	GetTrackContentColor() const	 { return nTrackContentColor; }
68*cdf0e10cSrcweir 	void		SetTrackInsertColor(sal_uInt32 nNew)  { nTrackInsertColor = nNew;  }
69*cdf0e10cSrcweir 	sal_uInt32	GetTrackInsertColor() const		 { return nTrackInsertColor;  }
70*cdf0e10cSrcweir 	void		SetTrackDeleteColor(sal_uInt32 nNew)  { nTrackDeleteColor = nNew;  }
71*cdf0e10cSrcweir 	sal_uInt32	GetTrackDeleteColor() const		 { return nTrackDeleteColor;  }
72*cdf0e10cSrcweir 	void		SetTrackMoveColor(sal_uInt32 nNew)    { nTrackMoveColor = nNew;    }
73*cdf0e10cSrcweir 	sal_uInt32	GetTrackMoveColor() const		 { return nTrackMoveColor;    }
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	ScLkUpdMode GetLinkMode() const				{ return eLinkMode ;}
76*cdf0e10cSrcweir 	void		SetLinkMode( ScLkUpdMode nSet )	{ 	eLinkMode  = nSet;}
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir 	void		SetDefaultObjectSizeWidth(sal_Int32 nNew)	{ nDefaultObjectSizeWidth = nNew; }
79*cdf0e10cSrcweir 	sal_Int32		GetDefaultObjectSizeWidth() const		{ return nDefaultObjectSizeWidth; }
80*cdf0e10cSrcweir 	void		SetDefaultObjectSizeHeight(sal_Int32 nNew)	{ nDefaultObjectSizeHeight = nNew; }
81*cdf0e10cSrcweir 	sal_Int32		GetDefaultObjectSizeHeight() const		{ return nDefaultObjectSizeHeight; }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     void        SetShowSharedDocumentWarning( sal_Bool bNew )   { mbShowSharedDocumentWarning = bNew; }
84*cdf0e10cSrcweir     sal_Bool        GetShowSharedDocumentWarning() const        { return mbShowSharedDocumentWarning; }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 	const ScAppOptions&	operator=	( const ScAppOptions& rOpt );
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir private:
90*cdf0e10cSrcweir 	FieldUnit	eMetric;
91*cdf0e10cSrcweir 	sal_uInt16		nLRUFuncCount;
92*cdf0e10cSrcweir 	sal_uInt16*		pLRUList;
93*cdf0e10cSrcweir 	SvxZoomType eZoomType;
94*cdf0e10cSrcweir 	sal_uInt16		nZoom;
95*cdf0e10cSrcweir     sal_Bool        bSynchronizeZoom;
96*cdf0e10cSrcweir 	sal_uInt16		nStatusFunc;
97*cdf0e10cSrcweir 	sal_Bool		bAutoComplete;
98*cdf0e10cSrcweir 	sal_Bool		bDetectiveAuto;
99*cdf0e10cSrcweir 	sal_uInt32	nTrackContentColor;
100*cdf0e10cSrcweir 	sal_uInt32	nTrackInsertColor;
101*cdf0e10cSrcweir 	sal_uInt32	nTrackDeleteColor;
102*cdf0e10cSrcweir 	sal_uInt32	nTrackMoveColor;
103*cdf0e10cSrcweir 	ScLkUpdMode eLinkMode;
104*cdf0e10cSrcweir 	sal_Int32		nDefaultObjectSizeWidth;
105*cdf0e10cSrcweir 	sal_Int32		nDefaultObjectSizeHeight;
106*cdf0e10cSrcweir     sal_Bool        mbShowSharedDocumentWarning;
107*cdf0e10cSrcweir };
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir //==================================================================
111*cdf0e10cSrcweir //	Config Item containing app options
112*cdf0e10cSrcweir //==================================================================
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir class ScAppCfg : public ScAppOptions
115*cdf0e10cSrcweir {
116*cdf0e10cSrcweir 	//	spread about 5 config paths
117*cdf0e10cSrcweir 	//!	split ScAppOptions into different classes
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	ScLinkConfigItem	aLayoutItem;
120*cdf0e10cSrcweir 	ScLinkConfigItem	aInputItem;
121*cdf0e10cSrcweir 	ScLinkConfigItem	aRevisionItem;
122*cdf0e10cSrcweir 	ScLinkConfigItem	aContentItem;
123*cdf0e10cSrcweir 	ScLinkConfigItem	aSortListItem;
124*cdf0e10cSrcweir 	ScLinkConfigItem	aMiscItem;
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	DECL_LINK( LayoutCommitHdl, void* );
127*cdf0e10cSrcweir 	DECL_LINK( InputCommitHdl, void* );
128*cdf0e10cSrcweir 	DECL_LINK( RevisionCommitHdl, void* );
129*cdf0e10cSrcweir 	DECL_LINK( ContentCommitHdl, void* );
130*cdf0e10cSrcweir 	DECL_LINK( SortListCommitHdl, void* );
131*cdf0e10cSrcweir 	DECL_LINK( MiscCommitHdl, void* );
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
134*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetInputPropertyNames();
135*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetRevisionPropertyNames();
136*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetContentPropertyNames();
137*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetSortListPropertyNames();
138*cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetMiscPropertyNames();
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir public:
141*cdf0e10cSrcweir 			ScAppCfg();
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 	void	SetOptions( const ScAppOptions& rNew );
144*cdf0e10cSrcweir 	void	OptionsChanged();	// after direct access to ScAppOptions base class
145*cdf0e10cSrcweir };
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir #endif
149*cdf0e10cSrcweir 
150