1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef SC_VIEWUTIL_HXX 24 #define SC_VIEWUTIL_HXX 25 26 #include "address.hxx" 27 #include <tools/solar.h> 28 #include <sal/types.h> 29 30 class String; 31 class SfxItemSet; 32 class SfxBindings; 33 class SvxFontItem; 34 class SfxViewShell; 35 class SfxViewFrame; 36 37 class ScChangeAction; 38 class ScChangeViewSettings; 39 class ScDocument; 40 class ScAddress; 41 class ScRange; 42 class ScMarkData; 43 44 enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS }; 45 46 // --------------------------------------------------------------------------- 47 48 class ScViewUtil // static Methoden 49 { 50 public: 51 static sal_Bool ExecuteCharMap( const SvxFontItem& rOldFont, 52 SfxViewFrame& rFrame, 53 SvxFontItem& rNewFont, 54 String& rString ); 55 56 static sal_Bool IsActionShown( const ScChangeAction& rAction, 57 const ScChangeViewSettings& rSettings, 58 ScDocument& rDocument ); 59 60 static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, 61 sal_uInt16 nWhichId, sal_uInt16 nScript ); 62 63 static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); 64 65 static sal_Int32 GetTransliterationType( sal_uInt16 nSlotID ); 66 67 static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc ); 68 /** Fit a range to cover nRows number of unfiltered rows. 69 @return <TRUE/> if the resulting range covers nRows unfiltered rows. */ 70 static bool FitToUnfilteredRows( ScRange & rRange, ScDocument * pDoc, size_t nRows ); 71 static void UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc ); 72 73 static void HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal_uInt16 nSlotId ); 74 75 /** Returns true, if the passed view shell is in full screen mode. */ 76 static bool IsFullScreen( SfxViewShell& rViewShell ); 77 /** Enters or leaves full screen mode at the passed view shell. */ 78 static void SetFullScreen( SfxViewShell& rViewShell, bool bSet ); 79 }; 80 81 // --------------------------------------------------------------------------- 82 83 class ScUpdateRect 84 { 85 private: 86 SCCOL nOldStartX; 87 SCROW nOldStartY; 88 SCCOL nOldEndX; 89 SCROW nOldEndY; 90 SCCOL nNewStartX; 91 SCROW nNewStartY; 92 SCCOL nNewEndX; 93 SCROW nNewEndY; 94 SCCOL nContX1; 95 SCROW nContY1; 96 SCCOL nContX2; 97 SCROW nContY2; 98 public: 99 ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); 100 void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); 101 sal_Bool GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); 102 #ifdef OLD_SELECTION_PAINT 103 sal_Bool GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, sal_Bool& rCont ); 104 void GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); 105 #endif 106 }; 107 108 109 110 111 #endif 112 113