update dev300-m58
[ooovba.git] / sc / inc / viewopti.hxx
blob1ea25b7697c1e36efac541f9101342deb2d6c74a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewopti.hxx,v $
10 * $Revision: 1.8.32.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_VIEWOPTI_HXX
32 #define SC_VIEWOPTI_HXX
34 #include <svx/optgrid.hxx>
36 #ifndef _SVX_SVXIDS_HRC //autogen
37 #include <svx/svxids.hrc>
38 #endif
39 #include "scdllapi.h"
40 #include "optutil.hxx"
41 #include "global.hxx"
43 //==================================================================
44 // View-Optionen
45 //==================================================================
47 enum ScViewOption
49 VOPT_FORMULAS = 0,
50 VOPT_NULLVALS,
51 VOPT_SYNTAX,
52 VOPT_NOTES,
53 VOPT_VSCROLL,
54 VOPT_HSCROLL,
55 VOPT_TABCONTROLS,
56 VOPT_OUTLINER,
57 VOPT_HEADER,
58 VOPT_GRID,
59 VOPT_HELPLINES,
60 VOPT_ANCHOR,
61 VOPT_PAGEBREAKS,
62 VOPT_SOLIDHANDLES,
63 VOPT_CLIPMARKS,
64 VOPT_BIGHANDLES
67 enum ScVObjType
69 VOBJ_TYPE_OLE = 0,
70 VOBJ_TYPE_CHART,
71 VOBJ_TYPE_DRAW
74 #define MAX_OPT (USHORT)VOPT_BIGHANDLES+1
75 #define MAX_TYPE (USHORT)VOBJ_TYPE_DRAW+1
77 #define SC_STD_GRIDCOLOR COL_LIGHTGRAY
79 //==================================================================
80 // SvxGrid-Optionen mit Standard-Operatoren
81 //==================================================================
83 class ScGridOptions : public SvxOptionsGrid
85 public:
86 ScGridOptions() : SvxOptionsGrid() {}
87 ScGridOptions( const SvxOptionsGrid& rOpt ) : SvxOptionsGrid( rOpt ) {}
89 void SetDefaults();
90 const ScGridOptions& operator= ( const ScGridOptions& rCpy );
91 int operator== ( const ScGridOptions& rOpt ) const;
92 int operator!= ( const ScGridOptions& rOpt ) const { return !(operator==(rOpt)); }
95 //==================================================================
96 // Einstellungen - Ansicht
97 //==================================================================
99 class SC_DLLPUBLIC ScViewOptions
101 public:
102 ScViewOptions();
103 ScViewOptions( const ScViewOptions& rCpy );
104 ~ScViewOptions();
106 void SetDefaults();
108 void SetOption( ScViewOption eOpt, BOOL bNew = TRUE ) { aOptArr[eOpt] = bNew; }
109 BOOL GetOption( ScViewOption eOpt ) const { return aOptArr[eOpt]; }
111 void SetObjMode( ScVObjType eObj, ScVObjMode eMode ) { aModeArr[eObj] = eMode; }
112 ScVObjMode GetObjMode( ScVObjType eObj ) const { return aModeArr[eObj]; }
114 void SetGridColor( const Color& rCol, const String& rName ) { aGridCol = rCol; aGridColName = rName;}
115 Color GetGridColor( String* pStrName = NULL ) const;
117 const ScGridOptions& GetGridOptions() const { return aGridOpt; }
118 void SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; }
119 SvxGridItem* CreateGridItem( USHORT nId = SID_ATTR_GRID_OPTIONS ) const;
121 const ScViewOptions& operator= ( const ScViewOptions& rCpy );
122 int operator== ( const ScViewOptions& rOpt ) const;
123 int operator!= ( const ScViewOptions& rOpt ) const { return !(operator==(rOpt)); }
125 private:
126 BOOL aOptArr [MAX_OPT];
127 ScVObjMode aModeArr [MAX_TYPE];
128 Color aGridCol;
129 String aGridColName;
130 ScGridOptions aGridOpt;
133 //==================================================================
134 // Item fuer Einstellungsdialog - Ansicht
135 //==================================================================
137 class SC_DLLPUBLIC ScTpViewItem : public SfxPoolItem
139 public:
140 TYPEINFO();
141 //UNUSED2008-05 ScTpViewItem( USHORT nWhich );
142 ScTpViewItem( USHORT nWhich, const ScViewOptions& rOpt );
143 ScTpViewItem( const ScTpViewItem& rItem );
144 ~ScTpViewItem();
146 virtual String GetValueText() const;
147 virtual int operator==( const SfxPoolItem& ) const;
148 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
150 const ScViewOptions& GetViewOptions() const { return theOptions; }
152 private:
153 ScViewOptions theOptions;
157 //==================================================================
158 // CfgItem fuer View-Optionen
159 //==================================================================
161 class ScViewCfg : public ScViewOptions
163 ScLinkConfigItem aLayoutItem;
164 ScLinkConfigItem aDisplayItem;
165 ScLinkConfigItem aGridItem;
167 DECL_LINK( LayoutCommitHdl, void* );
168 DECL_LINK( DisplayCommitHdl, void* );
169 DECL_LINK( GridCommitHdl, void* );
171 com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
172 com::sun::star::uno::Sequence<rtl::OUString> GetDisplayPropertyNames();
173 com::sun::star::uno::Sequence<rtl::OUString> GetGridPropertyNames();
175 public:
176 ScViewCfg();
178 void SetOptions( const ScViewOptions& rNew );
182 #endif