xref: /aoo42x/main/sc/inc/viewopti.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_VIEWOPTI_HXX
25cdf0e10cSrcweir #define SC_VIEWOPTI_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/optgrid.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef _SVX_SVXIDS_HRC //autogen
30cdf0e10cSrcweir #include <svx/svxids.hrc>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include "scdllapi.h"
33cdf0e10cSrcweir #include "optutil.hxx"
34cdf0e10cSrcweir #include "global.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //==================================================================
37cdf0e10cSrcweir // View-Optionen
38cdf0e10cSrcweir //==================================================================
39cdf0e10cSrcweir 
40cdf0e10cSrcweir enum ScViewOption
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	VOPT_FORMULAS = 0,
43cdf0e10cSrcweir 	VOPT_NULLVALS,
44cdf0e10cSrcweir 	VOPT_SYNTAX,
45cdf0e10cSrcweir 	VOPT_NOTES,
46cdf0e10cSrcweir 	VOPT_VSCROLL,
47cdf0e10cSrcweir 	VOPT_HSCROLL,
48cdf0e10cSrcweir 	VOPT_TABCONTROLS,
49cdf0e10cSrcweir 	VOPT_OUTLINER,
50cdf0e10cSrcweir 	VOPT_HEADER,
51cdf0e10cSrcweir 	VOPT_GRID,
52cdf0e10cSrcweir 	VOPT_HELPLINES,
53cdf0e10cSrcweir 	VOPT_ANCHOR,
54cdf0e10cSrcweir 	VOPT_PAGEBREAKS,
55cdf0e10cSrcweir 	VOPT_SOLIDHANDLES,
56cdf0e10cSrcweir 	VOPT_CLIPMARKS,
57cdf0e10cSrcweir 	VOPT_BIGHANDLES
58cdf0e10cSrcweir };
59cdf0e10cSrcweir 
60cdf0e10cSrcweir enum ScVObjType
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	VOBJ_TYPE_OLE = 0,
63cdf0e10cSrcweir 	VOBJ_TYPE_CHART,
64cdf0e10cSrcweir 	VOBJ_TYPE_DRAW
65cdf0e10cSrcweir };
66cdf0e10cSrcweir 
67cdf0e10cSrcweir #define MAX_OPT				(sal_uInt16)VOPT_BIGHANDLES+1
68cdf0e10cSrcweir #define MAX_TYPE			(sal_uInt16)VOBJ_TYPE_DRAW+1
69cdf0e10cSrcweir 
70cdf0e10cSrcweir #define SC_STD_GRIDCOLOR	COL_LIGHTGRAY
71cdf0e10cSrcweir 
72cdf0e10cSrcweir //==================================================================
73cdf0e10cSrcweir // SvxGrid-Optionen mit Standard-Operatoren
74cdf0e10cSrcweir //==================================================================
75cdf0e10cSrcweir 
76cdf0e10cSrcweir class ScGridOptions : public SvxOptionsGrid
77cdf0e10cSrcweir {
78cdf0e10cSrcweir public:
ScGridOptions()79cdf0e10cSrcweir 				ScGridOptions() : SvxOptionsGrid() {}
ScGridOptions(const SvxOptionsGrid & rOpt)80cdf0e10cSrcweir 				ScGridOptions( const SvxOptionsGrid& rOpt ) : SvxOptionsGrid( rOpt ) {}
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void					SetDefaults();
83cdf0e10cSrcweir 	const ScGridOptions&	operator=  ( const ScGridOptions& rCpy );
84cdf0e10cSrcweir 	int						operator== ( const ScGridOptions& rOpt ) const;
operator !=(const ScGridOptions & rOpt) const85cdf0e10cSrcweir 	int						operator!= ( const ScGridOptions& rOpt ) const { return !(operator==(rOpt)); }
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir //==================================================================
89cdf0e10cSrcweir // Einstellungen - Ansicht
90cdf0e10cSrcweir //==================================================================
91cdf0e10cSrcweir 
92cdf0e10cSrcweir class SC_DLLPUBLIC ScViewOptions
93cdf0e10cSrcweir {
94cdf0e10cSrcweir public:
95cdf0e10cSrcweir 				ScViewOptions();
96cdf0e10cSrcweir 				ScViewOptions( const ScViewOptions& rCpy );
97cdf0e10cSrcweir 				~ScViewOptions();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void					SetDefaults();
100cdf0e10cSrcweir 
SetOption(ScViewOption eOpt,sal_Bool bNew=sal_True)101cdf0e10cSrcweir 	void					SetOption( ScViewOption eOpt, sal_Bool bNew = sal_True )	{ aOptArr[eOpt] = bNew; }
GetOption(ScViewOption eOpt) const102cdf0e10cSrcweir 	sal_Bool					GetOption( ScViewOption eOpt ) const 				{ return aOptArr[eOpt]; }
103cdf0e10cSrcweir 
SetObjMode(ScVObjType eObj,ScVObjMode eMode)104cdf0e10cSrcweir 	void					SetObjMode( ScVObjType eObj, ScVObjMode eMode )	{ aModeArr[eObj] = eMode; }
GetObjMode(ScVObjType eObj) const105cdf0e10cSrcweir 	ScVObjMode				GetObjMode( ScVObjType eObj ) const				{ return aModeArr[eObj]; }
106cdf0e10cSrcweir 
SetGridColor(const Color & rCol,const String & rName)107cdf0e10cSrcweir 	void					SetGridColor( const Color& rCol, const String& rName ) { aGridCol = rCol; aGridColName = rName;}
108cdf0e10cSrcweir 	Color					GetGridColor( String* pStrName = NULL ) const;
109cdf0e10cSrcweir 
GetGridOptions() const110cdf0e10cSrcweir 	const ScGridOptions&	GetGridOptions() const 						{ return aGridOpt; }
SetGridOptions(const ScGridOptions & rNew)111cdf0e10cSrcweir 	void					SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; }
112cdf0e10cSrcweir 	SvxGridItem*			CreateGridItem( sal_uInt16 nId = SID_ATTR_GRID_OPTIONS ) const;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	const ScViewOptions&	operator=  ( const ScViewOptions& rCpy );
115cdf0e10cSrcweir 	int						operator== ( const ScViewOptions& rOpt ) const;
operator !=(const ScViewOptions & rOpt) const116cdf0e10cSrcweir 	int						operator!= ( const ScViewOptions& rOpt ) const { return !(operator==(rOpt)); }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir private:
119cdf0e10cSrcweir 	sal_Bool			aOptArr		[MAX_OPT];
120cdf0e10cSrcweir 	ScVObjMode		aModeArr	[MAX_TYPE];
121cdf0e10cSrcweir 	Color			aGridCol;
122cdf0e10cSrcweir 	String			aGridColName;
123cdf0e10cSrcweir 	ScGridOptions	aGridOpt;
124cdf0e10cSrcweir };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir //==================================================================
127cdf0e10cSrcweir // Item fuer Einstellungsdialog - Ansicht
128cdf0e10cSrcweir //==================================================================
129cdf0e10cSrcweir 
130cdf0e10cSrcweir class SC_DLLPUBLIC ScTpViewItem : public SfxPoolItem
131cdf0e10cSrcweir {
132cdf0e10cSrcweir public:
133cdf0e10cSrcweir 				TYPEINFO();
134cdf0e10cSrcweir //UNUSED2008-05  ScTpViewItem( sal_uInt16 nWhich );
135cdf0e10cSrcweir 				ScTpViewItem( sal_uInt16 nWhich, const ScViewOptions& rOpt );
136cdf0e10cSrcweir 				ScTpViewItem( const ScTpViewItem&  rItem );
137cdf0e10cSrcweir 				~ScTpViewItem();
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 	virtual String          GetValueText() const;
140cdf0e10cSrcweir 	virtual int             operator==( const SfxPoolItem& ) const;
141cdf0e10cSrcweir 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
142cdf0e10cSrcweir 
GetViewOptions() const143cdf0e10cSrcweir 	const ScViewOptions&	GetViewOptions() const { return theOptions; }
144cdf0e10cSrcweir 
145cdf0e10cSrcweir private:
146cdf0e10cSrcweir 	ScViewOptions	theOptions;
147cdf0e10cSrcweir };
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 
150cdf0e10cSrcweir //==================================================================
151cdf0e10cSrcweir // CfgItem fuer View-Optionen
152cdf0e10cSrcweir //==================================================================
153cdf0e10cSrcweir 
154cdf0e10cSrcweir class ScViewCfg : public ScViewOptions
155cdf0e10cSrcweir {
156cdf0e10cSrcweir 	ScLinkConfigItem	aLayoutItem;
157cdf0e10cSrcweir 	ScLinkConfigItem	aDisplayItem;
158cdf0e10cSrcweir 	ScLinkConfigItem	aGridItem;
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	DECL_LINK( LayoutCommitHdl, void* );
161cdf0e10cSrcweir 	DECL_LINK( DisplayCommitHdl, void* );
162cdf0e10cSrcweir 	DECL_LINK( GridCommitHdl, void* );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
165cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetDisplayPropertyNames();
166cdf0e10cSrcweir 	com::sun::star::uno::Sequence<rtl::OUString> GetGridPropertyNames();
167cdf0e10cSrcweir 
168cdf0e10cSrcweir public:
169cdf0e10cSrcweir 			ScViewCfg();
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	void			SetOptions( const ScViewOptions& rNew );
172cdf0e10cSrcweir };
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 
175cdf0e10cSrcweir #endif
176