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