Update ooo320-m1
[ooovba.git] / sc / source / ui / inc / viewutil.hxx
blob18b4d68cd15f24074b56e694a77bdc6eb898ab75
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: viewutil.hxx,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
30 #ifndef SC_VIEWUTIL_HXX
31 #define SC_VIEWUTIL_HXX
33 #include "address.hxx"
34 #include <tools/solar.h>
35 #include <sal/types.h>
37 class String;
38 class SfxItemSet;
39 class SfxBindings;
40 class SvxFontItem;
41 class SfxViewShell;
42 class SfxViewFrame;
44 class ScChangeAction;
45 class ScChangeViewSettings;
46 class ScDocument;
47 class ScAddress;
48 class ScRange;
49 class ScMarkData;
51 enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS };
53 // ---------------------------------------------------------------------------
55 class ScViewUtil // static Methoden
57 public:
58 static BOOL ExecuteCharMap( const SvxFontItem& rOldFont,
59 SfxViewFrame& rFrame,
60 SvxFontItem& rNewFont,
61 String& rString );
63 static BOOL IsActionShown( const ScChangeAction& rAction,
64 const ScChangeViewSettings& rSettings,
65 ScDocument& rDocument );
67 static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet,
68 USHORT nWhichId, USHORT nScript );
70 static USHORT GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos );
72 static sal_Int32 GetTransliterationType( USHORT nSlotID );
74 static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc );
75 /** Fit a range to cover nRows number of unfiltered rows.
76 @return <TRUE/> if the resulting range covers nRows unfiltered rows. */
77 static bool FitToUnfilteredRows( ScRange & rRange, ScDocument * pDoc, size_t nRows );
78 static void UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc );
80 static void HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, USHORT nSlotId );
82 /** Returns true, if the passed view shell is in full screen mode. */
83 static bool IsFullScreen( SfxViewShell& rViewShell );
84 /** Enters or leaves full screen mode at the passed view shell. */
85 static void SetFullScreen( SfxViewShell& rViewShell, bool bSet );
88 // ---------------------------------------------------------------------------
90 class ScUpdateRect
92 private:
93 SCCOL nOldStartX;
94 SCROW nOldStartY;
95 SCCOL nOldEndX;
96 SCROW nOldEndY;
97 SCCOL nNewStartX;
98 SCROW nNewStartY;
99 SCCOL nNewEndX;
100 SCROW nNewEndY;
101 SCCOL nContX1;
102 SCROW nContY1;
103 SCCOL nContX2;
104 SCROW nContY2;
105 public:
106 ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
107 void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
108 BOOL GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
109 #ifdef OLD_SELECTION_PAINT
110 BOOL GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, BOOL& rCont );
111 void GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
112 #endif
118 #endif