1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef SC_VIEWUTIL_HXX 28*cdf0e10cSrcweir #define SC_VIEWUTIL_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include "address.hxx" 31*cdf0e10cSrcweir #include <tools/solar.h> 32*cdf0e10cSrcweir #include <sal/types.h> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir class String; 35*cdf0e10cSrcweir class SfxItemSet; 36*cdf0e10cSrcweir class SfxBindings; 37*cdf0e10cSrcweir class SvxFontItem; 38*cdf0e10cSrcweir class SfxViewShell; 39*cdf0e10cSrcweir class SfxViewFrame; 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir class ScChangeAction; 42*cdf0e10cSrcweir class ScChangeViewSettings; 43*cdf0e10cSrcweir class ScDocument; 44*cdf0e10cSrcweir class ScAddress; 45*cdf0e10cSrcweir class ScRange; 46*cdf0e10cSrcweir class ScMarkData; 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS }; 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir // --------------------------------------------------------------------------- 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir class ScViewUtil // static Methoden 53*cdf0e10cSrcweir { 54*cdf0e10cSrcweir public: 55*cdf0e10cSrcweir static sal_Bool ExecuteCharMap( const SvxFontItem& rOldFont, 56*cdf0e10cSrcweir SfxViewFrame& rFrame, 57*cdf0e10cSrcweir SvxFontItem& rNewFont, 58*cdf0e10cSrcweir String& rString ); 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir static sal_Bool IsActionShown( const ScChangeAction& rAction, 61*cdf0e10cSrcweir const ScChangeViewSettings& rSettings, 62*cdf0e10cSrcweir ScDocument& rDocument ); 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, 65*cdf0e10cSrcweir sal_uInt16 nWhichId, sal_uInt16 nScript ); 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir static sal_Int32 GetTransliterationType( sal_uInt16 nSlotID ); 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc ); 72*cdf0e10cSrcweir /** Fit a range to cover nRows number of unfiltered rows. 73*cdf0e10cSrcweir @return <TRUE/> if the resulting range covers nRows unfiltered rows. */ 74*cdf0e10cSrcweir static bool FitToUnfilteredRows( ScRange & rRange, ScDocument * pDoc, size_t nRows ); 75*cdf0e10cSrcweir static void UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc ); 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir static void HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal_uInt16 nSlotId ); 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir /** Returns true, if the passed view shell is in full screen mode. */ 80*cdf0e10cSrcweir static bool IsFullScreen( SfxViewShell& rViewShell ); 81*cdf0e10cSrcweir /** Enters or leaves full screen mode at the passed view shell. */ 82*cdf0e10cSrcweir static void SetFullScreen( SfxViewShell& rViewShell, bool bSet ); 83*cdf0e10cSrcweir }; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir // --------------------------------------------------------------------------- 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir class ScUpdateRect 88*cdf0e10cSrcweir { 89*cdf0e10cSrcweir private: 90*cdf0e10cSrcweir SCCOL nOldStartX; 91*cdf0e10cSrcweir SCROW nOldStartY; 92*cdf0e10cSrcweir SCCOL nOldEndX; 93*cdf0e10cSrcweir SCROW nOldEndY; 94*cdf0e10cSrcweir SCCOL nNewStartX; 95*cdf0e10cSrcweir SCROW nNewStartY; 96*cdf0e10cSrcweir SCCOL nNewEndX; 97*cdf0e10cSrcweir SCROW nNewEndY; 98*cdf0e10cSrcweir SCCOL nContX1; 99*cdf0e10cSrcweir SCROW nContY1; 100*cdf0e10cSrcweir SCCOL nContX2; 101*cdf0e10cSrcweir SCROW nContY2; 102*cdf0e10cSrcweir public: 103*cdf0e10cSrcweir ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); 104*cdf0e10cSrcweir void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); 105*cdf0e10cSrcweir sal_Bool GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); 106*cdf0e10cSrcweir #ifdef OLD_SELECTION_PAINT 107*cdf0e10cSrcweir sal_Bool GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, sal_Bool& rCont ); 108*cdf0e10cSrcweir void GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); 109*cdf0e10cSrcweir #endif 110*cdf0e10cSrcweir }; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir #endif 116*cdf0e10cSrcweir 117