1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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>
40 #include "optutil.hxx"
43 //==================================================================
45 //==================================================================
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
86 ScGridOptions() : SvxOptionsGrid() {}
87 ScGridOptions( const SvxOptionsGrid
& rOpt
) : SvxOptionsGrid( rOpt
) {}
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
103 ScViewOptions( const ScViewOptions
& rCpy
);
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
)); }
126 BOOL aOptArr
[MAX_OPT
];
127 ScVObjMode aModeArr
[MAX_TYPE
];
130 ScGridOptions aGridOpt
;
133 //==================================================================
134 // Item fuer Einstellungsdialog - Ansicht
135 //==================================================================
137 class SC_DLLPUBLIC ScTpViewItem
: public SfxPoolItem
141 //UNUSED2008-05 ScTpViewItem( USHORT nWhich );
142 ScTpViewItem( USHORT nWhich
, const ScViewOptions
& rOpt
);
143 ScTpViewItem( const ScTpViewItem
& rItem
);
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
; }
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();
178 void SetOptions( const ScViewOptions
& rNew
);