merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / viewopti.hxx
blob44625ad2aeb510b7888a76713a515b923e05613d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef SC_VIEWOPTI_HXX
29 #define SC_VIEWOPTI_HXX
31 #include <svx/optgrid.hxx>
33 #ifndef _SVX_SVXIDS_HRC //autogen
34 #include <svx/svxids.hrc>
35 #endif
36 #include "scdllapi.h"
37 #include "optutil.hxx"
38 #include "global.hxx"
40 //==================================================================
41 // View-Optionen
42 //==================================================================
44 enum ScViewOption
46 VOPT_FORMULAS = 0,
47 VOPT_NULLVALS,
48 VOPT_SYNTAX,
49 VOPT_NOTES,
50 VOPT_VSCROLL,
51 VOPT_HSCROLL,
52 VOPT_TABCONTROLS,
53 VOPT_OUTLINER,
54 VOPT_HEADER,
55 VOPT_GRID,
56 VOPT_HELPLINES,
57 VOPT_ANCHOR,
58 VOPT_PAGEBREAKS,
59 VOPT_SOLIDHANDLES,
60 VOPT_CLIPMARKS,
61 VOPT_BIGHANDLES
64 enum ScVObjType
66 VOBJ_TYPE_OLE = 0,
67 VOBJ_TYPE_CHART,
68 VOBJ_TYPE_DRAW
71 #define MAX_OPT (USHORT)VOPT_BIGHANDLES+1
72 #define MAX_TYPE (USHORT)VOBJ_TYPE_DRAW+1
74 #define SC_STD_GRIDCOLOR COL_LIGHTGRAY
76 //==================================================================
77 // SvxGrid-Optionen mit Standard-Operatoren
78 //==================================================================
80 class ScGridOptions : public SvxOptionsGrid
82 public:
83 ScGridOptions() : SvxOptionsGrid() {}
84 ScGridOptions( const SvxOptionsGrid& rOpt ) : SvxOptionsGrid( rOpt ) {}
86 void SetDefaults();
87 const ScGridOptions& operator= ( const ScGridOptions& rCpy );
88 int operator== ( const ScGridOptions& rOpt ) const;
89 int operator!= ( const ScGridOptions& rOpt ) const { return !(operator==(rOpt)); }
92 //==================================================================
93 // Einstellungen - Ansicht
94 //==================================================================
96 class SC_DLLPUBLIC ScViewOptions
98 public:
99 ScViewOptions();
100 ScViewOptions( const ScViewOptions& rCpy );
101 ~ScViewOptions();
103 void SetDefaults();
105 void SetOption( ScViewOption eOpt, BOOL bNew = TRUE ) { aOptArr[eOpt] = bNew; }
106 BOOL GetOption( ScViewOption eOpt ) const { return aOptArr[eOpt]; }
108 void SetObjMode( ScVObjType eObj, ScVObjMode eMode ) { aModeArr[eObj] = eMode; }
109 ScVObjMode GetObjMode( ScVObjType eObj ) const { return aModeArr[eObj]; }
111 void SetGridColor( const Color& rCol, const String& rName ) { aGridCol = rCol; aGridColName = rName;}
112 Color GetGridColor( String* pStrName = NULL ) const;
114 const ScGridOptions& GetGridOptions() const { return aGridOpt; }
115 void SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; }
116 SvxGridItem* CreateGridItem( USHORT nId = SID_ATTR_GRID_OPTIONS ) const;
118 const ScViewOptions& operator= ( const ScViewOptions& rCpy );
119 int operator== ( const ScViewOptions& rOpt ) const;
120 int operator!= ( const ScViewOptions& rOpt ) const { return !(operator==(rOpt)); }
122 private:
123 BOOL aOptArr [MAX_OPT];
124 ScVObjMode aModeArr [MAX_TYPE];
125 Color aGridCol;
126 String aGridColName;
127 ScGridOptions aGridOpt;
130 //==================================================================
131 // Item fuer Einstellungsdialog - Ansicht
132 //==================================================================
134 class SC_DLLPUBLIC ScTpViewItem : public SfxPoolItem
136 public:
137 TYPEINFO();
138 //UNUSED2008-05 ScTpViewItem( USHORT nWhich );
139 ScTpViewItem( USHORT nWhich, const ScViewOptions& rOpt );
140 ScTpViewItem( const ScTpViewItem& rItem );
141 ~ScTpViewItem();
143 virtual String GetValueText() const;
144 virtual int operator==( const SfxPoolItem& ) const;
145 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
147 const ScViewOptions& GetViewOptions() const { return theOptions; }
149 private:
150 ScViewOptions theOptions;
154 //==================================================================
155 // CfgItem fuer View-Optionen
156 //==================================================================
158 class ScViewCfg : public ScViewOptions
160 ScLinkConfigItem aLayoutItem;
161 ScLinkConfigItem aDisplayItem;
162 ScLinkConfigItem aGridItem;
164 DECL_LINK( LayoutCommitHdl, void* );
165 DECL_LINK( DisplayCommitHdl, void* );
166 DECL_LINK( GridCommitHdl, void* );
168 com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
169 com::sun::star::uno::Sequence<rtl::OUString> GetDisplayPropertyNames();
170 com::sun::star::uno::Sequence<rtl::OUString> GetGridPropertyNames();
172 public:
173 ScViewCfg();
175 void SetOptions( const ScViewOptions& rNew );
179 #endif