xref: /trunk/main/sc/source/ui/inc/viewutil.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef SC_VIEWUTIL_HXX
28 #define SC_VIEWUTIL_HXX
29 
30 #include "address.hxx"
31 #include <tools/solar.h>
32 #include <sal/types.h>
33 
34 class String;
35 class SfxItemSet;
36 class SfxBindings;
37 class SvxFontItem;
38 class SfxViewShell;
39 class SfxViewFrame;
40 
41 class ScChangeAction;
42 class ScChangeViewSettings;
43 class ScDocument;
44 class ScAddress;
45 class ScRange;
46 class ScMarkData;
47 
48 enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS };
49 
50 // ---------------------------------------------------------------------------
51 
52 class ScViewUtil								// static Methoden
53 {
54 public:
55 	static sal_Bool	ExecuteCharMap( const SvxFontItem&	rOldFont,
56 								SfxViewFrame&		rFrame,
57 								SvxFontItem&		rNewFont,
58 								String&				rString );
59 
60 	static sal_Bool IsActionShown( const ScChangeAction& rAction,
61 								const ScChangeViewSettings& rSettings,
62 								ScDocument& rDocument );
63 
64 	static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet,
65 								sal_uInt16 nWhichId, sal_uInt16 nScript );
66 
67 	static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos );
68 
69 	static sal_Int32 GetTransliterationType( sal_uInt16 nSlotID );
70 
71     static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc );
72     /** Fit a range to cover nRows number of unfiltered rows.
73         @return <TRUE/> if the resulting range covers nRows unfiltered rows. */
74     static bool FitToUnfilteredRows( ScRange & rRange, ScDocument * pDoc, size_t nRows );
75     static void UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc );
76 
77     static void HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal_uInt16 nSlotId );
78 
79     /** Returns true, if the passed view shell is in full screen mode. */
80     static bool IsFullScreen( SfxViewShell& rViewShell );
81     /** Enters or leaves full screen mode at the passed view shell. */
82     static void SetFullScreen( SfxViewShell& rViewShell, bool bSet );
83 };
84 
85 // ---------------------------------------------------------------------------
86 
87 class ScUpdateRect
88 {
89 private:
90 	SCCOL	nOldStartX;
91 	SCROW	nOldStartY;
92 	SCCOL	nOldEndX;
93 	SCROW	nOldEndY;
94 	SCCOL	nNewStartX;
95 	SCROW	nNewStartY;
96 	SCCOL	nNewEndX;
97 	SCROW	nNewEndY;
98 	SCCOL	nContX1;
99 	SCROW	nContY1;
100 	SCCOL	nContX2;
101 	SCROW	nContY2;
102 public:
103 			ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
104 	void	SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
105 	sal_Bool	GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
106 #ifdef OLD_SELECTION_PAINT
107 	sal_Bool	GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, sal_Bool& rCont );
108     void    GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
109 #endif
110 };
111 
112 
113 
114 
115 #endif
116 
117