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