xref: /trunk/main/sc/source/ui/inc/viewdata.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_VIEWDATA_HXX
24cdf0e10cSrcweir #define SC_VIEWDATA_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svx/zoomitem.hxx>
27cdf0e10cSrcweir #include "scdllapi.h"
28cdf0e10cSrcweir #include "viewopti.hxx"
29cdf0e10cSrcweir #include "markdata.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // ---------------------------------------------------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #define SC_SLIDER_SIZE      2
35cdf0e10cSrcweir #define SC_SMALL3DSHADOW    COL_BLACK
36cdf0e10cSrcweir #define SC_SIZE_NONE        65535
37cdf0e10cSrcweir const SCCOL SC_TABSTART_NONE = SCCOL_MAX;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #define SC_FILL_NONE        0
40cdf0e10cSrcweir #define SC_FILL_FILL        1
41cdf0e10cSrcweir #define SC_FILL_EMBED_LT    2
42cdf0e10cSrcweir #define SC_FILL_EMBED_RB    3
43cdf0e10cSrcweir #define SC_FILL_MATRIX      4
44cdf0e10cSrcweir 
45cdf0e10cSrcweir enum ScSplitMode { SC_SPLIT_NONE = 0, SC_SPLIT_NORMAL, SC_SPLIT_FIX };
46cdf0e10cSrcweir 
47cdf0e10cSrcweir enum ScSplitPos { SC_SPLIT_TOPLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMLEFT, SC_SPLIT_BOTTOMRIGHT };
48cdf0e10cSrcweir enum ScHSplitPos { SC_SPLIT_LEFT, SC_SPLIT_RIGHT };
49cdf0e10cSrcweir enum ScVSplitPos { SC_SPLIT_TOP, SC_SPLIT_BOTTOM };
50cdf0e10cSrcweir 
51cdf0e10cSrcweir inline ScHSplitPos WhichH( ScSplitPos ePos );
52cdf0e10cSrcweir inline ScVSplitPos WhichV( ScSplitPos ePos );
53cdf0e10cSrcweir inline ScSplitPos Which( ScHSplitPos eHPos );
54cdf0e10cSrcweir inline ScSplitPos Which( ScVSplitPos eVPos );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir //  Bildschirmverhalten bei Cursorbewegungen:
57cdf0e10cSrcweir enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, SC_FOLLOW_JUMP };
58cdf0e10cSrcweir 
59cdf0e10cSrcweir //  Mausmodi um Bereiche zu selektieren
60cdf0e10cSrcweir enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL,
61cdf0e10cSrcweir                     SC_REFTYPE_EMBED_LT, SC_REFTYPE_EMBED_RB };
62cdf0e10cSrcweir 
63cdf0e10cSrcweir /** States GetSimpleArea() returns for the underlying selection marks, so the
64cdf0e10cSrcweir     caller can react if the result is not of type SC_MARK_SIMPLE. */
65cdf0e10cSrcweir enum ScMarkType
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     SC_MARK_NONE            = 0,    // Not returned by GetSimpleArea(), used internally.
68cdf0e10cSrcweir                                     // Nothing marked always results in the
69cdf0e10cSrcweir                                     // current cursor position being selected and a simple mark.
70cdf0e10cSrcweir     SC_MARK_SIMPLE          = 1,    // Simple rectangular area marked, no filtered rows.
71cdf0e10cSrcweir     SC_MARK_FILTERED        = 2,    // At least one mark contains filtered rows.
72cdf0e10cSrcweir     SC_MARK_SIMPLE_FILTERED =       // Simple rectangular area marked containing filtered rows.
73cdf0e10cSrcweir         SC_MARK_SIMPLE |
74cdf0e10cSrcweir         SC_MARK_FILTERED,  // 3
75cdf0e10cSrcweir     SC_MARK_MULTI           = 4     // Multiple selection marks.
76cdf0e10cSrcweir     /* TODO: if filtered multi-selection was implemented, this would be the value to use. */
77cdf0e10cSrcweir #if 0
78cdf0e10cSrcweir         ,
79cdf0e10cSrcweir     SC_MARK_MULTI_FILTERED  =       // Multiple selection marks containing filtered rows.
80cdf0e10cSrcweir         SC_MARK_MULTI |
81cdf0e10cSrcweir         SC_MARK_FILTERED   // 6
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir class ScDocShell;
86cdf0e10cSrcweir class ScDocument;
87cdf0e10cSrcweir class ScDBFunc;
88cdf0e10cSrcweir class ScTabViewShell;
89cdf0e10cSrcweir class ScDrawView;
90cdf0e10cSrcweir class ScEditEngineDefaulter;
91cdf0e10cSrcweir class EditView;
92cdf0e10cSrcweir class EditStatus;
93cdf0e10cSrcweir class Outliner;
94cdf0e10cSrcweir class Window;
95cdf0e10cSrcweir class SfxObjectShell;
96cdf0e10cSrcweir class SfxBindings;
97cdf0e10cSrcweir class SfxDispatcher;
98cdf0e10cSrcweir class ScPatternAttr;
99cdf0e10cSrcweir class ScRangeListRef;
100cdf0e10cSrcweir class ScExtDocOptions;
101cdf0e10cSrcweir class ScViewData;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir //--------------------------------------------------------------------------
104cdf0e10cSrcweir 
105cdf0e10cSrcweir class ScViewDataTable                           // Daten pro Tabelle
106cdf0e10cSrcweir {
107cdf0e10cSrcweir friend class ScViewData;
108cdf0e10cSrcweir private:
109cdf0e10cSrcweir     SvxZoomType     eZoomType;                  // selected zoom type (normal view)
110cdf0e10cSrcweir     Fraction        aZoomX;                     // selected zoom X
111cdf0e10cSrcweir     Fraction        aZoomY;                     // selected zoom Y (displayed)
112cdf0e10cSrcweir     Fraction        aPageZoomX;                 // zoom in page break preview mode
113cdf0e10cSrcweir     Fraction        aPageZoomY;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     long            nTPosX[2];                  // MapMode - Offset (Twips)
116cdf0e10cSrcweir     long            nTPosY[2];
117cdf0e10cSrcweir     long            nMPosX[2];                  // MapMode - Offset (1/100 mm)
118cdf0e10cSrcweir     long            nMPosY[2];
119cdf0e10cSrcweir     long            nPixPosX[2];                // Offset in Pixeln
120cdf0e10cSrcweir     long            nPixPosY[2];
121cdf0e10cSrcweir     long            nHSplitPos;
122cdf0e10cSrcweir     long            nVSplitPos;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     ScSplitMode     eHSplitMode;
125cdf0e10cSrcweir     ScSplitMode     eVSplitMode;
126cdf0e10cSrcweir     ScSplitPos      eWhichActive;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     SCCOL           nFixPosX;                   // Zellposition des Splitters beim Fixieren
129cdf0e10cSrcweir     SCROW           nFixPosY;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     SCCOL           nCurX;
132cdf0e10cSrcweir     SCROW           nCurY;
133cdf0e10cSrcweir     SCCOL           nOldCurX;
134cdf0e10cSrcweir     SCROW           nOldCurY;
135cdf0e10cSrcweir     SCCOL           nPosX[2];
136cdf0e10cSrcweir     SCROW           nPosY[2];
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     sal_Bool            bOldCurValid;               // "virtuelle" Cursorpos. bei zusammengefassten
139cdf0e10cSrcweir 
140cdf0e10cSrcweir                     ScViewDataTable();
141cdf0e10cSrcweir                     ~ScViewDataTable();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     void            WriteUserDataSequence(
144cdf0e10cSrcweir                         com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings,
145cdf0e10cSrcweir                         const ScViewData& rViewData, SCTAB nTab );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     void            ReadUserDataSequence(
148cdf0e10cSrcweir                         const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings,
149cdf0e10cSrcweir                         ScViewData& rViewData, SCTAB nTab, bool& rHasZoom);
150cdf0e10cSrcweir };
151cdf0e10cSrcweir 
152cdf0e10cSrcweir // ---------------------------------------------------------------------------
153cdf0e10cSrcweir 
154cdf0e10cSrcweir class SC_DLLPUBLIC ScViewData
155cdf0e10cSrcweir {
156cdf0e10cSrcweir private:
157cdf0e10cSrcweir     double              nPPTX, nPPTY;               // Scaling-Faktoren
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     ScViewDataTable*    pTabData[MAXTABCOUNT];
160cdf0e10cSrcweir     ScViewDataTable*    pThisTab;                   // Daten der angezeigten Tabelle
161cdf0e10cSrcweir     ScDocShell*         pDocShell;
162cdf0e10cSrcweir     ScDocument*         pDoc;
163cdf0e10cSrcweir     ScDBFunc*           pView;
164cdf0e10cSrcweir     ScTabViewShell*     pViewShell;
165cdf0e10cSrcweir     EditView*           pEditView[4];               // gehoert dem Fenster
166cdf0e10cSrcweir     ScViewOptions*      pOptions;
167cdf0e10cSrcweir     EditView*           pSpellingView;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     ScMarkData          aMarkData;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     long                nEditMargin;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     Size                aScenButSize;               // Groesse eines Szenario-Buttons
174cdf0e10cSrcweir 
175cdf0e10cSrcweir     Size                aScrSize;
176cdf0e10cSrcweir     MapMode             aLogicMode;                 // skalierter 1/100mm-MapMode
177cdf0e10cSrcweir 
178cdf0e10cSrcweir     SvxZoomType         eDefZoomType;               // default zoom and type for missing TabData
179cdf0e10cSrcweir     Fraction            aDefZoomX;
180cdf0e10cSrcweir     Fraction            aDefZoomY;
181cdf0e10cSrcweir     Fraction            aDefPageZoomX;              // zoom in page break preview mode
182cdf0e10cSrcweir     Fraction            aDefPageZoomY;
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     ScRefType           eRefType;
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     SCTAB               nTabNo;                     // angezeigte Tabelle
187cdf0e10cSrcweir     SCTAB               nRefTabNo;                  // Tabelle auf die sich RefInput bezieht
188cdf0e10cSrcweir     SCCOL               nRefStartX;
189cdf0e10cSrcweir     SCROW               nRefStartY;
190cdf0e10cSrcweir     SCTAB               nRefStartZ;
191cdf0e10cSrcweir     SCCOL               nRefEndX;
192cdf0e10cSrcweir     SCROW               nRefEndY;
193cdf0e10cSrcweir     SCTAB               nRefEndZ;
194cdf0e10cSrcweir     SCCOL               nFillStartX;                // Fill-Cursor
195cdf0e10cSrcweir     SCROW               nFillStartY;
196cdf0e10cSrcweir     SCCOL               nFillEndX;
197cdf0e10cSrcweir     SCROW               nFillEndY;
198cdf0e10cSrcweir     SCCOL               nEditCol;                   // Position dazu
199cdf0e10cSrcweir     SCROW               nEditRow;
200cdf0e10cSrcweir     SCCOL               nEditStartCol;
201cdf0e10cSrcweir     SCCOL               nEditEndCol;                // Ende der Edit-View
202cdf0e10cSrcweir     SCROW               nEditEndRow;
203cdf0e10cSrcweir     SCCOL               nTabStartCol;               // fuer Enter nach Tab
204cdf0e10cSrcweir     ScRange             aDelRange;                  // fuer AutoFill-Loeschen
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     ScSplitPos          eEditActivePart;            // the part that was active when edit mode was started
207cdf0e10cSrcweir     sal_Bool                bEditActive[4];             // aktiv?
208cdf0e10cSrcweir     sal_Bool                bActive;                    // aktives Fenster ?
209cdf0e10cSrcweir     sal_Bool                bIsRefMode;                 // Referenzeingabe
210cdf0e10cSrcweir     sal_Bool                bDelMarkValid;              // nur gueltig bei SC_REFTYPE_FILL
211cdf0e10cSrcweir     sal_uInt8               nFillMode;                  // Modus
212cdf0e10cSrcweir     sal_Bool                bPagebreak;                 // Seitenumbruch-Vorschaumodus
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     sal_Bool                bSelCtrlMouseClick;         // special selection handling for ctrl-mouse-click
215cdf0e10cSrcweir 
216cdf0e10cSrcweir     SC_DLLPRIVATE DECL_LINK (EmptyEditHdl, EditStatus*);
217cdf0e10cSrcweir     SC_DLLPRIVATE DECL_LINK (EditEngineHdl, EditStatus*);
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     SC_DLLPRIVATE void          CalcPPT();
220cdf0e10cSrcweir     SC_DLLPRIVATE void          CreateTabData( SCTAB nNewTab );
221cdf0e10cSrcweir     SC_DLLPRIVATE void          CreateTabData( std::vector< SCTAB >& rvTabs );
222cdf0e10cSrcweir     SC_DLLPRIVATE void          CreateSelectedTabData();
223cdf0e10cSrcweir 
224cdf0e10cSrcweir public:
225cdf0e10cSrcweir                     ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh );
226cdf0e10cSrcweir                     ScViewData( const ScViewData& rViewData );
227cdf0e10cSrcweir                     ~ScViewData();
228cdf0e10cSrcweir 
229cdf0e10cSrcweir     void            InitData( ScDocument* pDocument );
230cdf0e10cSrcweir //UNUSED2008-05  void            InitFrom( const ScViewData* pRef );
231cdf0e10cSrcweir //UNUSED2008-05  void           SetDocShell( ScDocShell* pShell );
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 
GetDocShell() const234cdf0e10cSrcweir     ScDocShell*     GetDocShell() const     { return pDocShell; }
GetView() const235cdf0e10cSrcweir     ScDBFunc*       GetView() const         { return pView; }
GetViewShell() const236cdf0e10cSrcweir     ScTabViewShell* GetViewShell() const    { return pViewShell; }
237cdf0e10cSrcweir 
238cdf0e10cSrcweir     SfxObjectShell* GetSfxDocShell() const;
239cdf0e10cSrcweir     SfxBindings&    GetBindings();          // from ViewShell's ViewFrame
240cdf0e10cSrcweir     SfxDispatcher&  GetDispatcher();        // from ViewShell's ViewFrame
241cdf0e10cSrcweir 
GetMarkData()242cdf0e10cSrcweir     ScMarkData&     GetMarkData()           { return aMarkData; }
GetMarkData() const243cdf0e10cSrcweir     const ScMarkData& GetMarkData() const   { return aMarkData; }
244cdf0e10cSrcweir 
245cdf0e10cSrcweir     Window*         GetDialogParent();          // von tabvwsh weitergeleitet
246cdf0e10cSrcweir     Window*         GetActiveWin();             // von View
247cdf0e10cSrcweir     ScDrawView*     GetScDrawView();            // von View
248cdf0e10cSrcweir     sal_Bool            IsMinimized();              // von View
249cdf0e10cSrcweir 
250cdf0e10cSrcweir     void            UpdateInputHandler( sal_Bool bForce = sal_False, sal_Bool bStopEditing = sal_True );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     void            WriteUserData(String& rData);
253cdf0e10cSrcweir     void            ReadUserData(const String& rData);
254cdf0e10cSrcweir     void            WriteExtOptions( ScExtDocOptions& rOpt ) const;
255cdf0e10cSrcweir     void            ReadExtOptions( const ScExtDocOptions& rOpt );
256cdf0e10cSrcweir     void            WriteUserDataSequence(com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings);
257cdf0e10cSrcweir     void            ReadUserDataSequence(const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings);
258cdf0e10cSrcweir 
259cdf0e10cSrcweir     ScDocument*     GetDocument() const;
260cdf0e10cSrcweir 
261cdf0e10cSrcweir     void            SetViewShell( ScTabViewShell* pViewSh );
262cdf0e10cSrcweir 
IsActive() const263cdf0e10cSrcweir     sal_Bool            IsActive() const            { return bActive; }
Activate(sal_Bool bActivate)264cdf0e10cSrcweir     void            Activate(sal_Bool bActivate)    { bActive = bActivate; }
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     void            UpdateThis();
267cdf0e10cSrcweir 
268cdf0e10cSrcweir     void            InsertTab( SCTAB nTab );
269cdf0e10cSrcweir     void            DeleteTab( SCTAB nTab );
270cdf0e10cSrcweir     void            CopyTab( SCTAB nSrcTab, SCTAB nDestTab );
271cdf0e10cSrcweir     void            MoveTab( SCTAB nSrcTab, SCTAB nDestTab );
272cdf0e10cSrcweir 
GetRefTabNo() const273cdf0e10cSrcweir     SCTAB           GetRefTabNo() const                     { return nRefTabNo; }
SetRefTabNo(SCTAB nNewTab)274cdf0e10cSrcweir     void            SetRefTabNo( SCTAB nNewTab )            { nRefTabNo = nNewTab; }
275cdf0e10cSrcweir 
GetTabNo() const276cdf0e10cSrcweir     SCTAB           GetTabNo() const                        { return nTabNo; }
GetActivePart() const277cdf0e10cSrcweir     ScSplitPos      GetActivePart() const                   { return pThisTab->eWhichActive; }
GetPosX(ScHSplitPos eWhich) const278cdf0e10cSrcweir     SCCOL           GetPosX( ScHSplitPos eWhich ) const     { return pThisTab->nPosX[eWhich]; }
GetPosY(ScVSplitPos eWhich) const279cdf0e10cSrcweir     SCROW           GetPosY( ScVSplitPos eWhich ) const     { return pThisTab->nPosY[eWhich]; }
GetCurX() const280cdf0e10cSrcweir     SCCOL           GetCurX() const                         { return pThisTab->nCurX; }
GetCurY() const281cdf0e10cSrcweir     SCROW           GetCurY() const                         { return pThisTab->nCurY; }
HasOldCursor() const282cdf0e10cSrcweir     sal_Bool            HasOldCursor() const                    { return pThisTab->bOldCurValid; }
283cdf0e10cSrcweir     SCCOL           GetOldCurX() const;
284cdf0e10cSrcweir     SCROW           GetOldCurY() const;
GetHSplitMode() const285cdf0e10cSrcweir     ScSplitMode     GetHSplitMode() const                   { return pThisTab->eHSplitMode; }
GetVSplitMode() const286cdf0e10cSrcweir     ScSplitMode     GetVSplitMode() const                   { return pThisTab->eVSplitMode; }
GetHSplitPos() const287cdf0e10cSrcweir     long            GetHSplitPos() const                    { return pThisTab->nHSplitPos; }
GetVSplitPos() const288cdf0e10cSrcweir     long            GetVSplitPos() const                    { return pThisTab->nVSplitPos; }
GetFixPosX() const289cdf0e10cSrcweir     SCCOL           GetFixPosX() const                      { return pThisTab->nFixPosX; }
GetFixPosY() const290cdf0e10cSrcweir     SCROW           GetFixPosY() const                      { return pThisTab->nFixPosY; }
IsPagebreakMode() const291cdf0e10cSrcweir     sal_Bool            IsPagebreakMode() const                 { return bPagebreak; }
292cdf0e10cSrcweir 
293cdf0e10cSrcweir     void            SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
294cdf0e10cSrcweir     void            SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
SetCurX(SCCOL nNewCurX)295cdf0e10cSrcweir     void            SetCurX( SCCOL nNewCurX )                       { pThisTab->nCurX = nNewCurX; }
SetCurY(SCROW nNewCurY)296cdf0e10cSrcweir     void            SetCurY( SCROW nNewCurY )                       { pThisTab->nCurY = nNewCurY; }
297cdf0e10cSrcweir     void            SetOldCursor( SCCOL nNewX, SCROW nNewY );
298cdf0e10cSrcweir     void            ResetOldCursor();
SetHSplitMode(ScSplitMode eMode)299cdf0e10cSrcweir     void            SetHSplitMode( ScSplitMode eMode )              { pThisTab->eHSplitMode = eMode; }
SetVSplitMode(ScSplitMode eMode)300cdf0e10cSrcweir     void            SetVSplitMode( ScSplitMode eMode )              { pThisTab->eVSplitMode = eMode; }
SetHSplitPos(long nPos)301cdf0e10cSrcweir     void            SetHSplitPos( long nPos )                       { pThisTab->nHSplitPos = nPos; }
SetVSplitPos(long nPos)302cdf0e10cSrcweir     void            SetVSplitPos( long nPos )                       { pThisTab->nVSplitPos = nPos; }
SetFixPosX(SCCOL nPos)303cdf0e10cSrcweir     void            SetFixPosX( SCCOL nPos )                        { pThisTab->nFixPosX = nPos; }
SetFixPosY(SCROW nPos)304cdf0e10cSrcweir     void            SetFixPosY( SCROW nPos )                        { pThisTab->nFixPosY = nPos; }
305cdf0e10cSrcweir     void            SetPagebreakMode( sal_Bool bSet );
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     void            SetZoomType( SvxZoomType eNew, sal_Bool bAll );
308cdf0e10cSrcweir     void            SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs );
309cdf0e10cSrcweir     void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs );
310cdf0e10cSrcweir     void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll );
311cdf0e10cSrcweir     void            RefreshZoom();
312cdf0e10cSrcweir 
SetSelCtrlMouseClick(sal_Bool bTmp)313cdf0e10cSrcweir     void            SetSelCtrlMouseClick( sal_Bool bTmp ) { bSelCtrlMouseClick = bTmp; }
314cdf0e10cSrcweir 
GetZoomType() const315cdf0e10cSrcweir     SvxZoomType     GetZoomType() const     { return pThisTab->eZoomType; }
GetZoomX() const316cdf0e10cSrcweir     const Fraction& GetZoomX() const        { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; }
GetZoomY() const317cdf0e10cSrcweir     const Fraction& GetZoomY() const        { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir     const MapMode&  GetLogicMode( ScSplitPos eWhich );
320cdf0e10cSrcweir     const MapMode&  GetLogicMode();                     // Offset 0
321cdf0e10cSrcweir 
GetTPosX(ScHSplitPos eWhich) const322cdf0e10cSrcweir     long            GetTPosX( ScHSplitPos eWhich ) const        { return pThisTab->nTPosX[eWhich]; }
GetTPosY(ScVSplitPos eWhich) const323cdf0e10cSrcweir     long            GetTPosY( ScVSplitPos eWhich ) const        { return pThisTab->nTPosY[eWhich]; }
324cdf0e10cSrcweir 
GetPPTX() const325cdf0e10cSrcweir     double          GetPPTX() const { return nPPTX; }
GetPPTY() const326cdf0e10cSrcweir     double          GetPPTY() const { return nPPTY; }
327cdf0e10cSrcweir 
328cdf0e10cSrcweir     ScMarkType      GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab,
329cdf0e10cSrcweir                                     SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const;
330cdf0e10cSrcweir     ScMarkType      GetSimpleArea( ScRange& rRange ) const;
331cdf0e10cSrcweir                     /// May modify rNewMark using MarkToSimple().
332cdf0e10cSrcweir     ScMarkType      GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const;
333cdf0e10cSrcweir     void            GetMultiArea( ScRangeListRef& rRange ) const;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir     sal_Bool            SimpleColMarked();
336cdf0e10cSrcweir     sal_Bool            SimpleRowMarked();
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     sal_Bool            IsMultiMarked();
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     void            SetFillMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
341cdf0e10cSrcweir     void            SetDragMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
342cdf0e10cSrcweir                                     sal_uInt8 nMode );
343cdf0e10cSrcweir     void            GetFillData( SCCOL& rStartCol, SCROW& rStartRow,
344cdf0e10cSrcweir                                  SCCOL& rEndCol, SCROW& rEndRow );
345cdf0e10cSrcweir     void            ResetFillMode();
IsAnyFillMode()346cdf0e10cSrcweir     sal_Bool            IsAnyFillMode()             { return nFillMode != SC_FILL_NONE; }
IsFillMode()347cdf0e10cSrcweir     sal_Bool            IsFillMode()                { return nFillMode == SC_FILL_FILL; }
GetFillMode()348cdf0e10cSrcweir     sal_uInt8           GetFillMode()               { return nFillMode; }
349cdf0e10cSrcweir 
350cdf0e10cSrcweir                     // TRUE: Zelle ist zusammengefasst
351cdf0e10cSrcweir     sal_Bool            GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix );
352cdf0e10cSrcweir     sal_Bool            GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
353cdf0e10cSrcweir                                         SCsCOL& rPosX, SCsROW& rPosY,
354cdf0e10cSrcweir                                         sal_Bool bTestMerge = sal_True, sal_Bool bRepair = sal_False,
355cdf0e10cSrcweir                                         sal_Bool bNextIfLarge = sal_True );
356cdf0e10cSrcweir     void            GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
357cdf0e10cSrcweir                                         SCsCOL nPosX, SCsROW nPosY, sal_Bool& rLeft, sal_Bool& rTop );
358cdf0e10cSrcweir 
IsRefMode() const359cdf0e10cSrcweir     sal_Bool            IsRefMode() const                       { return bIsRefMode; }
GetRefType() const360cdf0e10cSrcweir     ScRefType       GetRefType() const                      { return eRefType; }
GetRefStartX() const361cdf0e10cSrcweir     SCCOL           GetRefStartX() const                    { return nRefStartX; }
GetRefStartY() const362cdf0e10cSrcweir     SCROW           GetRefStartY() const                    { return nRefStartY; }
GetRefStartZ() const363cdf0e10cSrcweir     SCTAB           GetRefStartZ() const                    { return nRefStartZ; }
GetRefEndX() const364cdf0e10cSrcweir     SCCOL           GetRefEndX() const                      { return nRefEndX; }
GetRefEndY() const365cdf0e10cSrcweir     SCROW           GetRefEndY() const                      { return nRefEndY; }
GetRefEndZ() const366cdf0e10cSrcweir     SCTAB           GetRefEndZ() const                      { return nRefEndZ; }
367cdf0e10cSrcweir 
SetRefMode(sal_Bool bNewMode,ScRefType eNewType)368cdf0e10cSrcweir     void            SetRefMode( sal_Bool bNewMode, ScRefType eNewType )
369cdf0e10cSrcweir                                     { bIsRefMode = bNewMode; eRefType = eNewType; }
370cdf0e10cSrcweir 
SetRefStart(SCCOL nNewX,SCROW nNewY,SCTAB nNewZ)371cdf0e10cSrcweir     void            SetRefStart( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ )
372cdf0e10cSrcweir                             { nRefStartX = nNewX; nRefStartY = nNewY; nRefStartZ = nNewZ; }
SetRefEnd(SCCOL nNewX,SCROW nNewY,SCTAB nNewZ)373cdf0e10cSrcweir     void            SetRefEnd( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ )
374cdf0e10cSrcweir                             { nRefEndX = nNewX; nRefEndY = nNewY; nRefEndZ = nNewZ; }
375cdf0e10cSrcweir 
ResetDelMark()376cdf0e10cSrcweir     void            ResetDelMark()                          { bDelMarkValid = sal_False; }
SetDelMark(const ScRange & rRange)377cdf0e10cSrcweir     void            SetDelMark( const ScRange& rRange )
378cdf0e10cSrcweir                             { aDelRange = rRange; bDelMarkValid = sal_True; }
379cdf0e10cSrcweir 
GetDelMark(ScRange & rRange) const380cdf0e10cSrcweir     sal_Bool            GetDelMark( ScRange& rRange ) const
381cdf0e10cSrcweir                             { rRange = aDelRange; return bDelMarkValid; }
382cdf0e10cSrcweir 
383cdf0e10cSrcweir     inline void     GetMoveCursor( SCCOL& rCurX, SCROW& rCurY );
384cdf0e10cSrcweir 
GetOptions() const385cdf0e10cSrcweir     const ScViewOptions&    GetOptions() const { return *pOptions; }
386cdf0e10cSrcweir     void                    SetOptions( const ScViewOptions& rOpt );
387cdf0e10cSrcweir 
IsGridMode() const388cdf0e10cSrcweir     sal_Bool    IsGridMode      () const            { return pOptions->GetOption( VOPT_GRID ); }
SetGridMode(sal_Bool bNewMode)389cdf0e10cSrcweir     void    SetGridMode     ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_GRID, bNewMode ); }
IsSyntaxMode() const390cdf0e10cSrcweir     sal_Bool    IsSyntaxMode    () const            { return pOptions->GetOption( VOPT_SYNTAX ); }
SetSyntaxMode(sal_Bool bNewMode)391cdf0e10cSrcweir     void    SetSyntaxMode   ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_SYNTAX, bNewMode ); }
IsHeaderMode() const392cdf0e10cSrcweir     sal_Bool    IsHeaderMode    () const            { return pOptions->GetOption( VOPT_HEADER ); }
SetHeaderMode(sal_Bool bNewMode)393cdf0e10cSrcweir     void    SetHeaderMode   ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_HEADER, bNewMode ); }
IsTabMode() const394cdf0e10cSrcweir     sal_Bool    IsTabMode       () const            { return pOptions->GetOption( VOPT_TABCONTROLS ); }
SetTabMode(sal_Bool bNewMode)395cdf0e10cSrcweir     void    SetTabMode      ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_TABCONTROLS, bNewMode ); }
IsVScrollMode() const396cdf0e10cSrcweir     sal_Bool    IsVScrollMode   () const            { return pOptions->GetOption( VOPT_VSCROLL ); }
SetVScrollMode(sal_Bool bNewMode)397cdf0e10cSrcweir     void    SetVScrollMode  ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_VSCROLL, bNewMode ); }
IsHScrollMode() const398cdf0e10cSrcweir     sal_Bool    IsHScrollMode   () const            { return pOptions->GetOption( VOPT_HSCROLL ); }
SetHScrollMode(sal_Bool bNewMode)399cdf0e10cSrcweir     void    SetHScrollMode  ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_HSCROLL, bNewMode ); }
IsOutlineMode() const400cdf0e10cSrcweir     sal_Bool    IsOutlineMode   () const            { return pOptions->GetOption( VOPT_OUTLINER ); }
SetOutlineMode(sal_Bool bNewMode)401cdf0e10cSrcweir     void    SetOutlineMode  ( sal_Bool bNewMode )   { pOptions->SetOption( VOPT_OUTLINER, bNewMode ); }
402cdf0e10cSrcweir 
403cdf0e10cSrcweir     void            KillEditView();
404cdf0e10cSrcweir     void            ResetEditView();
405cdf0e10cSrcweir     void            SetEditEngine( ScSplitPos eWhich,
406cdf0e10cSrcweir                                     ScEditEngineDefaulter* pNewEngine,
407cdf0e10cSrcweir                                     Window* pWin, SCCOL nNewX, SCROW nNewY );
408cdf0e10cSrcweir     void            GetEditView( ScSplitPos eWhich, EditView*& rViewPtr, SCCOL& rCol, SCROW& rRow );
HasEditView(ScSplitPos eWhich) const409cdf0e10cSrcweir     sal_Bool            HasEditView( ScSplitPos eWhich ) const
410cdf0e10cSrcweir                                         { return pEditView[eWhich] && bEditActive[eWhich]; }
GetEditView(ScSplitPos eWhich) const411cdf0e10cSrcweir     EditView*       GetEditView( ScSplitPos eWhich ) const
412cdf0e10cSrcweir                                         { return pEditView[eWhich]; }
413cdf0e10cSrcweir 
414cdf0e10cSrcweir     void            EditGrowX();
415cdf0e10cSrcweir     void            EditGrowY( sal_Bool bInitial = sal_False );
416cdf0e10cSrcweir 
GetEditActivePart() const417cdf0e10cSrcweir     ScSplitPos      GetEditActivePart() const       { return eEditActivePart; }
GetEditViewCol() const418cdf0e10cSrcweir     SCCOL           GetEditViewCol() const          { return nEditCol; }
GetEditViewRow() const419cdf0e10cSrcweir     SCROW           GetEditViewRow() const          { return nEditRow; }
GetEditStartCol() const420cdf0e10cSrcweir     SCCOL           GetEditStartCol() const         { return nEditStartCol; }
GetEditStartRow() const421cdf0e10cSrcweir     SCROW           GetEditStartRow() const         { return nEditRow; }        // never editing above the cell
GetEditEndCol() const422cdf0e10cSrcweir     SCCOL           GetEditEndCol() const           { return nEditEndCol; }
GetEditEndRow() const423cdf0e10cSrcweir     SCROW           GetEditEndRow() const           { return nEditEndRow; }
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     Rectangle       GetEditArea( ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, Window* pWin,
426cdf0e10cSrcweir                                     const ScPatternAttr* pPattern, sal_Bool bForceToTop );
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     void            SetTabNo( SCTAB nNewTab );
429cdf0e10cSrcweir     void            SetActivePart( ScSplitPos eNewActive );
430cdf0e10cSrcweir 
431cdf0e10cSrcweir     Point           GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
432cdf0e10cSrcweir                                 sal_Bool bAllowNeg = sal_False ) const;
433cdf0e10cSrcweir     Point           GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScHSplitPos eWhich ) const;
434cdf0e10cSrcweir     Point           GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScVSplitPos eWhich ) const;
435cdf0e10cSrcweir 
436cdf0e10cSrcweir     SCCOL           CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY = SC_SIZE_NONE ) const;
437cdf0e10cSrcweir     SCROW           CellsAtY( SCsROW nPosY, SCsROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX = SC_SIZE_NONE ) const;
438cdf0e10cSrcweir 
439cdf0e10cSrcweir     SCCOL           VisibleCellsX( ScHSplitPos eWhichX ) const;     // angezeigte komplette Zellen
440cdf0e10cSrcweir     SCROW           VisibleCellsY( ScVSplitPos eWhichY ) const;
441cdf0e10cSrcweir     SCCOL           PrevCellsX( ScHSplitPos eWhichX ) const;        // Zellen auf der vorgehenden Seite
442cdf0e10cSrcweir     SCROW           PrevCellsY( ScVSplitPos eWhichY ) const;
443cdf0e10cSrcweir //UNUSED2008-05  SCCOL           LastCellsX( ScHSplitPos eWhichX ) const;        // Zellen auf der letzten Seite
444cdf0e10cSrcweir //UNUSED2008-05  SCROW           LastCellsY( ScVSplitPos eWhichY ) const;
445cdf0e10cSrcweir 
446cdf0e10cSrcweir     sal_Bool            IsOle();
447cdf0e10cSrcweir //UNUSED2008-05  void            UpdateOle( ScSplitPos eWhich );
448cdf0e10cSrcweir     void            SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
449cdf0e10cSrcweir     void            SetScreen( const Rectangle& rVisArea );
450cdf0e10cSrcweir     void            SetScreenPos( const Point& rVisAreaStart );
451cdf0e10cSrcweir 
452cdf0e10cSrcweir     void            UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY );
453cdf0e10cSrcweir 
GetScrSize() const454cdf0e10cSrcweir     Size            GetScrSize() const              { return aScrSize; }
455cdf0e10cSrcweir 
456cdf0e10cSrcweir     void            RecalcPixPos();
GetPixPos(ScSplitPos eWhich) const457cdf0e10cSrcweir     Point           GetPixPos( ScSplitPos eWhich ) const
458cdf0e10cSrcweir                     { return Point( pThisTab->nPixPosX[WhichH(eWhich)],
459cdf0e10cSrcweir                                     pThisTab->nPixPosY[WhichV(eWhich)] ); }
SetSpellingView(EditView * pSpView)460cdf0e10cSrcweir     void            SetSpellingView( EditView* pSpView) { pSpellingView = pSpView; }
GetSpellingView() const461cdf0e10cSrcweir     EditView*       GetSpellingView() const { return pSpellingView; }
462cdf0e10cSrcweir 
463cdf0e10cSrcweir     void            UpdateOutlinerFlags( Outliner& rOutl ) const;
464cdf0e10cSrcweir 
465cdf0e10cSrcweir     Point           GetMousePosPixel();
466cdf0e10cSrcweir 
467cdf0e10cSrcweir     sal_Bool            UpdateFixX(SCTAB nTab = MAXTAB+1);
468cdf0e10cSrcweir     sal_Bool            UpdateFixY(SCTAB nTab = MAXTAB+1);
469cdf0e10cSrcweir 
GetTabStartCol() const470cdf0e10cSrcweir     SCCOL           GetTabStartCol() const          { return nTabStartCol; }
SetTabStartCol(SCCOL nNew)471cdf0e10cSrcweir     void            SetTabStartCol(SCCOL nNew)      { nTabStartCol = nNew; }
472cdf0e10cSrcweir 
473cdf0e10cSrcweir     ScAddress       GetCurPos() const;
474cdf0e10cSrcweir 
GetScenButSize() const475cdf0e10cSrcweir     const Size&     GetScenButSize() const              { return aScenButSize; }
SetScenButSize(const Size & rNew)476cdf0e10cSrcweir     void            SetScenButSize(const Size& rNew)    { aScenButSize = rNew; }
477cdf0e10cSrcweir 
IsSelCtrlMouseClick()478cdf0e10cSrcweir     sal_Bool            IsSelCtrlMouseClick() { return bSelCtrlMouseClick; }
479cdf0e10cSrcweir 
480cdf0e10cSrcweir     static inline long ToPixel( sal_uInt16 nTwips, double nFactor );
481cdf0e10cSrcweir 
482cdf0e10cSrcweir     /** while (rScrY <= nEndPixels && rPosY <= nEndRow) add pixels of row
483cdf0e10cSrcweir         heights converted with nPPTY to rScrY, optimized for row height
484cdf0e10cSrcweir         segments. Upon return rPosY is the last row evaluated <= nEndRow, rScrY
485cdf0e10cSrcweir         may be > nEndPixels!
486cdf0e10cSrcweir      */
487cdf0e10cSrcweir     static void     AddPixelsWhile( long & rScrY, long nEndPixels,
488cdf0e10cSrcweir                                     SCROW & rPosY, SCROW nEndRow, double nPPTY,
489cdf0e10cSrcweir                                     const ScDocument * pDoc, SCTAB nTabNo );
490cdf0e10cSrcweir 
491cdf0e10cSrcweir     /** while (rScrY <= nEndPixels && rPosY >= nStartRow) add pixels of row
492cdf0e10cSrcweir         heights converted with nPPTY to rScrY, optimized for row height
493cdf0e10cSrcweir         segments. Upon return rPosY is the last row evaluated >= nStartRow,
494cdf0e10cSrcweir         rScrY may be > nEndPixels!
495cdf0e10cSrcweir      */
496cdf0e10cSrcweir     static void     AddPixelsWhileBackward( long & rScrY, long nEndPixels,
497cdf0e10cSrcweir                                     SCROW & rPosY, SCROW nStartRow, double nPPTY,
498cdf0e10cSrcweir                                     const ScDocument * pDoc, SCTAB nTabNo );
499cdf0e10cSrcweir };
500cdf0e10cSrcweir 
501cdf0e10cSrcweir 
502cdf0e10cSrcweir // ---------------------------------------------------------------------------
503cdf0e10cSrcweir 
ToPixel(sal_uInt16 nTwips,double nFactor)504cdf0e10cSrcweir inline long ScViewData::ToPixel( sal_uInt16 nTwips, double nFactor )
505cdf0e10cSrcweir {
506cdf0e10cSrcweir     long nRet = (long)( nTwips * nFactor );
507cdf0e10cSrcweir     if ( !nRet && nTwips )
508cdf0e10cSrcweir         nRet = 1;
509cdf0e10cSrcweir     return nRet;
510cdf0e10cSrcweir }
511cdf0e10cSrcweir 
GetMoveCursor(SCCOL & rCurX,SCROW & rCurY)512cdf0e10cSrcweir inline void ScViewData::GetMoveCursor( SCCOL& rCurX, SCROW& rCurY )
513cdf0e10cSrcweir {
514cdf0e10cSrcweir     if ( bIsRefMode )
515cdf0e10cSrcweir     {
516cdf0e10cSrcweir         rCurX = nRefEndX;
517cdf0e10cSrcweir         rCurY = nRefEndY;
518cdf0e10cSrcweir     }
519cdf0e10cSrcweir     else
520cdf0e10cSrcweir     {
521cdf0e10cSrcweir         rCurX = GetCurX();
522cdf0e10cSrcweir         rCurY = GetCurY();
523cdf0e10cSrcweir     }
524cdf0e10cSrcweir }
525cdf0e10cSrcweir 
WhichH(ScSplitPos ePos)526cdf0e10cSrcweir inline ScHSplitPos WhichH( ScSplitPos ePos )
527cdf0e10cSrcweir {
528cdf0e10cSrcweir     return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_BOTTOMLEFT) ?
529cdf0e10cSrcweir                 SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
530cdf0e10cSrcweir }
531cdf0e10cSrcweir 
WhichV(ScSplitPos ePos)532cdf0e10cSrcweir inline ScVSplitPos WhichV( ScSplitPos ePos )
533cdf0e10cSrcweir {
534cdf0e10cSrcweir     return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_TOPRIGHT) ?
535cdf0e10cSrcweir                 SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
536cdf0e10cSrcweir }
537cdf0e10cSrcweir 
Which(ScHSplitPos eHPos)538cdf0e10cSrcweir inline ScSplitPos Which( ScHSplitPos eHPos )
539cdf0e10cSrcweir {
540cdf0e10cSrcweir     return (eHPos==SC_SPLIT_LEFT) ?
541cdf0e10cSrcweir                 SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
542cdf0e10cSrcweir }
543cdf0e10cSrcweir 
Which(ScVSplitPos eVPos)544cdf0e10cSrcweir inline ScSplitPos Which( ScVSplitPos eVPos )
545cdf0e10cSrcweir {
546cdf0e10cSrcweir     return (eVPos==SC_SPLIT_TOP) ?
547cdf0e10cSrcweir                 SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
548cdf0e10cSrcweir }
549cdf0e10cSrcweir 
550cdf0e10cSrcweir 
551cdf0e10cSrcweir 
552cdf0e10cSrcweir #endif
553