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>
37 #include "optutil.hxx"
40 //==================================================================
42 //==================================================================
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
83 ScGridOptions() : SvxOptionsGrid() {}
84 ScGridOptions( const SvxOptionsGrid
& rOpt
) : SvxOptionsGrid( rOpt
) {}
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
100 ScViewOptions( const ScViewOptions
& rCpy
);
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
)); }
123 BOOL aOptArr
[MAX_OPT
];
124 ScVObjMode aModeArr
[MAX_TYPE
];
127 ScGridOptions aGridOpt
;
130 //==================================================================
131 // Item fuer Einstellungsdialog - Ansicht
132 //==================================================================
134 class SC_DLLPUBLIC ScTpViewItem
: public SfxPoolItem
138 //UNUSED2008-05 ScTpViewItem( USHORT nWhich );
139 ScTpViewItem( USHORT nWhich
, const ScViewOptions
& rOpt
);
140 ScTpViewItem( const ScTpViewItem
& rItem
);
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
; }
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();
175 void SetOptions( const ScViewOptions
& rNew
);