xref: /aoo41x/main/sc/source/ui/inc/tabview.hxx (revision 0deba7fb)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
1038d50f7bSAndrew Rist  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1238d50f7bSAndrew Rist  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
1938d50f7bSAndrew Rist  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_TABVIEW_HXX
24cdf0e10cSrcweir #define SC_TABVIEW_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/scrbar.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //REMOVE	#ifndef SO2_DECL_SVINPLACECLIENT_DEFINED
29cdf0e10cSrcweir //REMOVE	#define SO2_DECL_SVINPLACECLIENT_DEFINED
30cdf0e10cSrcweir //REMOVE	SO2_DECL_REF(SvInPlaceClient)
31cdf0e10cSrcweir //REMOVE	#endif
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <sfx2/ipclient.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "viewutil.hxx"
36cdf0e10cSrcweir #include "select.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class ScEditEngineDefaulter;
39cdf0e10cSrcweir class ScGridWindow;
40cdf0e10cSrcweir class ScOutlineWindow;
41cdf0e10cSrcweir class ScRowBar;
42cdf0e10cSrcweir class ScColBar;
43cdf0e10cSrcweir class ScTabControl;
44cdf0e10cSrcweir class ScTabViewShell;
45cdf0e10cSrcweir class SfxPrinter;
46cdf0e10cSrcweir class ScDrawView;
47cdf0e10cSrcweir class SvBorder;
48cdf0e10cSrcweir class FuPoor;
49cdf0e10cSrcweir class Splitter;
50cdf0e10cSrcweir class ScTabSplitter;
51cdf0e10cSrcweir class SdrView;
52cdf0e10cSrcweir class SdrObject;
53cdf0e10cSrcweir class ScHintWindow;
54cdf0e10cSrcweir class ScPageBreakData;
55cdf0e10cSrcweir class ScHighlightRanges;
56cdf0e10cSrcweir struct ChartSelectionInfo;
57cdf0e10cSrcweir class SdrHdlList;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir namespace com { namespace sun { namespace star {
60cdf0e10cSrcweir namespace chart2 { namespace data {
61cdf0e10cSrcweir     struct HighlightedRange;
62cdf0e10cSrcweir }}}}}
63cdf0e10cSrcweir 
64cdf0e10cSrcweir #define	SPLIT_HANDLE_SIZE	3
65cdf0e10cSrcweir #define SC_FORCEMODE_NONE	0xff
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // ---------------------------------------------------------------------------
68cdf0e10cSrcweir //		Hilfs - Fenster
69cdf0e10cSrcweir 
70cdf0e10cSrcweir class ScCornerButton : public Window
71cdf0e10cSrcweir {
72cdf0e10cSrcweir private:
73cdf0e10cSrcweir 	ScViewData*		pViewData;
74cdf0e10cSrcweir 	sal_Bool			bAdd;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir protected:
77cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
78cdf0e10cSrcweir 	virtual void	Resize();
79cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
80cdf0e10cSrcweir public:
81cdf0e10cSrcweir 					ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAdditional );
82cdf0e10cSrcweir 					~ScCornerButton();
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	virtual	void	StateChanged( StateChangedType nType );
85cdf0e10cSrcweir 	virtual	void	DataChanged( const DataChangedEvent& rDCEvt );
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89cdf0e10cSrcweir // ---------------------------------------------------------------------------
90cdf0e10cSrcweir 
91cdf0e10cSrcweir class ScTabView
92cdf0e10cSrcweir {
93cdf0e10cSrcweir private:
94cdf0e10cSrcweir 	Window*				pFrameWin;				// als erstes !!!
95cdf0e10cSrcweir 	ScViewData			aViewData;				// muss ganz vorne stehen !
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	ScViewSelectionEngine*	pSelEngine;
98cdf0e10cSrcweir 	ScViewFunctionSet		aFunctionSet;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	ScHeaderSelectionEngine* pHdrSelEng;
101cdf0e10cSrcweir 	ScHeaderFunctionSet		 aHdrFunc;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     SfxInPlaceClient*   pIPClient;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	ScDrawView*			pDrawView;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	Size				aFrameSize;				// wie bei DoResize uebergeben
108cdf0e10cSrcweir 	Point				aBorderPos;
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	sal_Bool				bDrawSelMode;			// nur Zeichenobjekte selektieren ?
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	FuPoor* 			pDrawActual;
113cdf0e10cSrcweir 	FuPoor*				pDrawOld;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	ScGridWindow*		pGridWin[4];
116cdf0e10cSrcweir 	ScColBar*			pColBar[2];
117cdf0e10cSrcweir 	ScRowBar*			pRowBar[2];
118cdf0e10cSrcweir 	ScOutlineWindow*	pColOutline[2];
119cdf0e10cSrcweir 	ScOutlineWindow*	pRowOutline[2];
120cdf0e10cSrcweir 	ScTabSplitter*		pHSplitter;
121cdf0e10cSrcweir 	ScTabSplitter*		pVSplitter;
122cdf0e10cSrcweir 	ScTabControl*		pTabControl;
123cdf0e10cSrcweir 	ScrollBar			aVScrollTop;
124cdf0e10cSrcweir 	ScrollBar			aVScrollBottom;			// anfangs sichtbar
125cdf0e10cSrcweir 	ScrollBar			aHScrollLeft;			// anfangs sichtbar
126cdf0e10cSrcweir 	ScrollBar			aHScrollRight;
127cdf0e10cSrcweir 	ScCornerButton		aCornerButton;
128cdf0e10cSrcweir 	ScCornerButton		aTopButton;
129cdf0e10cSrcweir 	ScrollBarBox		aScrollBarBox;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	ScHintWindow*		pInputHintWindow;		// Eingabemeldung bei Gueltigkeit
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	ScPageBreakData*	pPageBreakData;			// fuer Seitenumbruch-Modus
134cdf0e10cSrcweir 	ScHighlightRanges*	pHighlightRanges;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     ScDocument*         pBrushDocument;         // cell formats for format paint brush
137cdf0e10cSrcweir     SfxItemSet*         pDrawBrushSet;          // drawing object attributes for paint brush
138cdf0e10cSrcweir     sal_Bool                bLockPaintBrush;        // keep for more than one use?
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	Timer				aScrollTimer;
141cdf0e10cSrcweir 	ScGridWindow*		pTimerWindow;
142cdf0e10cSrcweir 	MouseEvent			aTimerMEvt;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	sal_uLong				nTipVisible;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	sal_Bool				bDragging;				// fuer Scrollbars
147cdf0e10cSrcweir 	long				nPrevDragPos;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 	sal_Bool				bIsBlockMode;           // Block markieren
150cdf0e10cSrcweir 	sal_Bool				bBlockNeg;				// wird Markierung aufgehoben?
151cdf0e10cSrcweir 	sal_Bool				bBlockCols;				// werden ganze Spalten markiert?
152cdf0e10cSrcweir 	sal_Bool				bBlockRows;				// werden ganze Zeilen markiert?
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 	SCCOL				nBlockStartX;
155cdf0e10cSrcweir     SCCOL               nBlockStartXOrig;
156cdf0e10cSrcweir 	SCCOL				nBlockEndX;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 	SCROW				nBlockStartY;
159cdf0e10cSrcweir     SCROW               nBlockStartYOrig;
160cdf0e10cSrcweir 	SCROW				nBlockEndY;
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	SCTAB				nBlockStartZ;
163cdf0e10cSrcweir 	SCTAB				nBlockEndZ;
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     SCCOL               nOldCurX;
166cdf0e10cSrcweir     SCROW               nOldCurY;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     double              mfPendingTabBarWidth;       // Tab bar width relative to frame window width.
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 	sal_Bool				bMinimized;
171cdf0e10cSrcweir 	sal_Bool				bInUpdateHeader;
172cdf0e10cSrcweir 	sal_Bool				bInActivatePart;
173cdf0e10cSrcweir 	sal_Bool				bInZoomUpdate;
174cdf0e10cSrcweir 	sal_Bool				bMoveIsShift;
175cdf0e10cSrcweir 	sal_Bool				bNewStartIfMarking;
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	void			Init();
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	void			DoAddWin( ScGridWindow* pWin );
180cdf0e10cSrcweir 
181cdf0e10cSrcweir 	void			InitScrollBar( ScrollBar& rScrollBar, long nMaxVal );
182cdf0e10cSrcweir 	DECL_LINK(		ScrollHdl, ScrollBar* );
183cdf0e10cSrcweir 	DECL_LINK(		EndScrollHdl, ScrollBar* );
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	DECL_LINK(		SplitHdl, Splitter* );
186cdf0e10cSrcweir 	void			DoHSplit(long nSplitPos);
187cdf0e10cSrcweir 	void			DoVSplit(long nSplitPos);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 	DECL_LINK(		TimerHdl, Timer* );
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 	void			UpdateVarZoom();
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     void            UpdateVisibleRange();
194cdf0e10cSrcweir 
195cdf0e10cSrcweir 	static void		SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL );
196cdf0e10cSrcweir 	static long		GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir protected:
199cdf0e10cSrcweir 	void			UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
200cdf0e10cSrcweir 										const SCROW* pPosY = NULL );
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	void			HideTip();
203cdf0e10cSrcweir 	void			ShowRefTip();
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	void			ZoomChanged();
206cdf0e10cSrcweir 	void			UpdateShow();
207cdf0e10cSrcweir 	void			GetBorderSize( SvBorder& rBorder, const Size& rSize );
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 	void			ResetDrawDragMode();
210cdf0e10cSrcweir 	sal_Bool			IsDrawTextEdit() const;
211cdf0e10cSrcweir 	void			DrawEnableAnim(sal_Bool bSet);
212cdf0e10cSrcweir 	//HMHvoid			DrawShowMarkHdl(sal_Bool bShow);
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 	void			MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 	void			HideNoteMarker();
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	void			UpdateIMap( SdrObject* pObj );
219cdf0e10cSrcweir 
220cdf0e10cSrcweir public:
221cdf0e10cSrcweir 					ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
222cdf0e10cSrcweir //UNUSED2009-05 	ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell );
223cdf0e10cSrcweir 					~ScTabView();
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	void			MakeDrawLayer();
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	void			HideListBox();
228cdf0e10cSrcweir 
HasHintWindow() const229cdf0e10cSrcweir 	sal_Bool			HasHintWindow() const	{ return pInputHintWindow != NULL; }
230cdf0e10cSrcweir 	void			RemoveHintWindow();
231cdf0e10cSrcweir 	void			TestHintWindow();
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	DECL_LINK(		TabBarResize, void* );
235cdf0e10cSrcweir     /** Sets an absolute tab bar width (in pixels). */
236cdf0e10cSrcweir 	void			SetTabBarWidth( long nNewWidth );
237cdf0e10cSrcweir     /** Sets a relative tab bar width.
238cdf0e10cSrcweir         @param fRelTabBarWidth  Tab bar width relative to frame window width (0.0 ... 1.0). */
239cdf0e10cSrcweir     void            SetRelTabBarWidth( double fRelTabBarWidth );
240cdf0e10cSrcweir     /** Sets a relative tab bar width. Tab bar is resized again in next DoResize().
241cdf0e10cSrcweir         @param fRelTabBarWidth  Tab bar width relative to frame window width (0.0 ... 1.0). */
242cdf0e10cSrcweir     void            SetPendingRelTabBarWidth( double fRelTabBarWidth );
243cdf0e10cSrcweir     /** Returns the current tab bar width in pixels. */
244cdf0e10cSrcweir     long            GetTabBarWidth() const;
245cdf0e10cSrcweir     /** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */
246cdf0e10cSrcweir     double          GetRelTabBarWidth() const;
247cdf0e10cSrcweir     /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */
248cdf0e10cSrcweir     double          GetPendingRelTabBarWidth() const;
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	void			DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner = sal_False );
251cdf0e10cSrcweir 	void			RepeatResize( sal_Bool bUpdateFix = sal_True );
252cdf0e10cSrcweir 	void			UpdateFixPos();
253cdf0e10cSrcweir 	Point			GetGridOffset() const;
254cdf0e10cSrcweir 
IsDrawSelMode() const255cdf0e10cSrcweir 	sal_Bool			IsDrawSelMode() const 		{ return bDrawSelMode; }
SetDrawSelMode(sal_Bool bNew)256cdf0e10cSrcweir 	void			SetDrawSelMode(sal_Bool bNew)	{ bDrawSelMode = bNew; }
257cdf0e10cSrcweir 
SetDrawFuncPtr(FuPoor * pFuncPtr)258cdf0e10cSrcweir 	void			SetDrawFuncPtr(FuPoor* pFuncPtr)	{ pDrawActual = pFuncPtr; }
SetDrawFuncOldPtr(FuPoor * pFuncPtr)259cdf0e10cSrcweir 	void			SetDrawFuncOldPtr(FuPoor* pFuncPtr)	{ pDrawOld = pFuncPtr; }
GetDrawFuncPtr()260cdf0e10cSrcweir 	FuPoor*			GetDrawFuncPtr()					{ return pDrawActual; }
GetDrawFuncOldPtr()261cdf0e10cSrcweir 	FuPoor*			GetDrawFuncOldPtr()					{ return pDrawOld; }
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 	void			DrawDeselectAll();
264cdf0e10cSrcweir 	void			DrawMarkListHasChanged();
265cdf0e10cSrcweir 	void			UpdateAnchorHandles();
266cdf0e10cSrcweir //UNUSED2008-05  String          GetSelectedChartName() const;
267cdf0e10cSrcweir 
GetPageBreakData()268cdf0e10cSrcweir 	ScPageBreakData* GetPageBreakData()		{ return pPageBreakData; }
GetHighlightRanges()269cdf0e10cSrcweir 	ScHighlightRanges* GetHighlightRanges()	{ return pHighlightRanges; }
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 	void			UpdatePageBreakData( sal_Bool bForcePaint = sal_False );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 	void			DrawMarkRect( const Rectangle& rRect );
274cdf0e10cSrcweir 
GetViewData()275cdf0e10cSrcweir 	ScViewData*			GetViewData() 		{ return &aViewData; }
GetViewData() const276cdf0e10cSrcweir 	const ScViewData*	GetViewData() const	{ return &aViewData; }
277cdf0e10cSrcweir 
GetFunctionSet()278cdf0e10cSrcweir 	ScViewFunctionSet*		GetFunctionSet()	{ return &aFunctionSet; }
GetSelEngine()279cdf0e10cSrcweir 	ScViewSelectionEngine*	GetSelEngine()		{ return pSelEngine; }
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	sal_Bool			SelMouseButtonDown( const MouseEvent& rMEvt );
282cdf0e10cSrcweir 
GetScDrawView()283cdf0e10cSrcweir 	ScDrawView*		GetScDrawView()			{ return pDrawView; }
284cdf0e10cSrcweir 	SdrView*		GetSdrView();			// gegen CLOKs
285cdf0e10cSrcweir 
IsMinimized() const286cdf0e10cSrcweir 	sal_Bool			IsMinimized() const		{ return bMinimized; }
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
289cdf0e10cSrcweir 	void			TabChanged( bool bSameTabButMoved = false );
290cdf0e10cSrcweir 	void			SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll );
291cdf0e10cSrcweir 	SC_DLLPUBLIC void            RefreshZoom();
292cdf0e10cSrcweir 	void			SetPagebreakMode( sal_Bool bSet );
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 	void			UpdateLayerLocks();
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 	void			UpdateDrawTextOutliner();
297cdf0e10cSrcweir 	void			DigitLanguageChanged();
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	void			UpdateInputLine();
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 	void			InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType,
302cdf0e10cSrcweir 									sal_Bool bPaint = sal_True );
303cdf0e10cSrcweir 	void			DoneRefMode( sal_Bool bContinue = sal_False );
304cdf0e10cSrcweir 	void			UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ );
305cdf0e10cSrcweir 	void			StopRefMode();
306cdf0e10cSrcweir 
307cdf0e10cSrcweir //UNUSED2008-05  void            EndSelection();
308cdf0e10cSrcweir 	void			StopMarking();
309cdf0e10cSrcweir 	void			FakeButtonUp( ScSplitPos eWhich );
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	Window*			GetActiveWin();
312cdf0e10cSrcweir 	Window*			GetWindowByPos( ScSplitPos ePos );
313cdf0e10cSrcweir 
314cdf0e10cSrcweir 	ScSplitPos		FindWindow( Window* pWindow ) const;
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 	void			SetActivePointer( const Pointer& rPointer );
317cdf0e10cSrcweir //UNUSED2008-05  void            SetActivePointer( const ResId& rId );
318cdf0e10cSrcweir 
319cdf0e10cSrcweir 	void			ActiveGrabFocus();
320cdf0e10cSrcweir //UNUSED2008-05  void            ActiveCaptureMouse();
321cdf0e10cSrcweir //UNUSED2008-05  void			ActiveReleaseMouse();
322cdf0e10cSrcweir //UNUSED2008-05  Point           ActivePixelToLogic( const Point& rDevicePoint );
323cdf0e10cSrcweir 
324cdf0e10cSrcweir 	void			ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl );
325cdf0e10cSrcweir 
326cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew = sal_False );
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 	SC_DLLPUBLIC void			CellContentChanged();
329cdf0e10cSrcweir 	void			SelectionChanged();
330cdf0e10cSrcweir 	void			CursorPosChanged();
331cdf0e10cSrcweir 	void			UpdateInputContext();
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 	void			CheckSelectionTransfer();
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 	void			InvertHorizontal( ScVSplitPos eWhich, long nDragPos );
336cdf0e10cSrcweir 	void			InvertVertical( ScHSplitPos eWhich, long nDragPos );
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 	Point			GetInsertPos();
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     Point           GetChartInsertPos( const Size& rSize, const ScRange& rCellRange );
341cdf0e10cSrcweir     Point           GetChartDialogPos( const Size& rDialogSize, const Rectangle& rLogicChart );
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	void			UpdateAutoFillMark();
344cdf0e10cSrcweir 
345cdf0e10cSrcweir 	void			HideCursor();				// nur aktiver Teil
346cdf0e10cSrcweir 	void			ShowCursor();
347cdf0e10cSrcweir 	void			HideAllCursors();
348cdf0e10cSrcweir 	void			ShowAllCursors();
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 	void			AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
351cdf0e10cSrcweir 									const ScSplitPos* pWhich = NULL );
352cdf0e10cSrcweir 
353cdf0e10cSrcweir     SvxZoomType     GetZoomType() const;
354cdf0e10cSrcweir     void            SetZoomType( SvxZoomType eNew, sal_Bool bAll );
355cdf0e10cSrcweir 	sal_uInt16			CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom );
356cdf0e10cSrcweir 
357cdf0e10cSrcweir //	void			CalcZoom( SvxZoomType eType, sal_uInt16& rZoom, SCCOL& rCol, SCROW& rRow );
358cdf0e10cSrcweir 
359cdf0e10cSrcweir     sal_Bool        HasPageFieldDataAtCursor() const;
360cdf0e10cSrcweir 	void			StartDataSelect();
361cdf0e10cSrcweir 
362cdf0e10cSrcweir 					//	MoveCursorAbs		- absolut
363cdf0e10cSrcweir 					//	MoveCursorRel		- einzelne Zellen
364cdf0e10cSrcweir 					//	MoveCursorPage		- Bildschirmseite
365cdf0e10cSrcweir 					//	MoveCursorArea		- Datenblock
366cdf0e10cSrcweir 					//	MoveCursorEnd		- links oben / benutzter Bereich
367cdf0e10cSrcweir 
368cdf0e10cSrcweir 	SC_DLLPUBLIC void			MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
369cdf0e10cSrcweir 									sal_Bool bShift, sal_Bool bControl,
370cdf0e10cSrcweir 									sal_Bool bKeepOld = sal_False, sal_Bool bKeepSel = sal_False );
371cdf0e10cSrcweir 	void			MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
372cdf0e10cSrcweir 									sal_Bool bShift, sal_Bool bKeepSel = sal_False );
373cdf0e10cSrcweir 	void			MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
374cdf0e10cSrcweir 									sal_Bool bShift, sal_Bool bKeepSel = sal_False );
375cdf0e10cSrcweir 	void			MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
376cdf0e10cSrcweir 									sal_Bool bShift, sal_Bool bKeepSel = sal_False );
377cdf0e10cSrcweir 	void			MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
378cdf0e10cSrcweir 									sal_Bool bShift, sal_Bool bKeepSel = sal_False );
379cdf0e10cSrcweir 	void			MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift );
380cdf0e10cSrcweir 
381cdf0e10cSrcweir 	void			MoveCursorEnter( sal_Bool bShift );		// Shift fuer Richtung (kein Markieren)
382cdf0e10cSrcweir 
383cdf0e10cSrcweir     sal_Bool            MoveCursorKeyInput( const KeyEvent& rKeyEvent );
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 	void			FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection = sal_True );
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 	void			SetNewStartIfMarking();
388cdf0e10cSrcweir 
389cdf0e10cSrcweir     // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
390cdf0e10cSrcweir     SC_DLLPUBLIC void SetTabNo( SCTAB nTab, sal_Bool bNew = sal_False, sal_Bool bExtendSelection = sal_False, bool bSameTabButMoved = false );
391cdf0e10cSrcweir     void            SelectNextTab( short nDir, sal_Bool bExtendSelection = sal_False );
392cdf0e10cSrcweir 
393cdf0e10cSrcweir 	void			ActivateView( sal_Bool bActivate, sal_Bool bFirst );
394cdf0e10cSrcweir 	void			ActivatePart( ScSplitPos eWhich );
IsInActivatePart() const395cdf0e10cSrcweir 	sal_Bool			IsInActivatePart() const	{ return bInActivatePart; }
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	void			SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt );
398cdf0e10cSrcweir 	void			ResetTimer();
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 	void 			ScrollX( long nDeltaX, ScHSplitPos eWhich, sal_Bool bUpdBars = sal_True );
401cdf0e10cSrcweir 	void 			ScrollY( long nDeltaY, ScVSplitPos eWhich, sal_Bool bUpdBars = sal_True );
402cdf0e10cSrcweir 	SC_DLLPUBLIC void			ScrollLines( long nDeltaX, long nDeltaY );				// aktives
403cdf0e10cSrcweir 
404cdf0e10cSrcweir 	sal_Bool			ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos );
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 	void			ScrollToObject( SdrObject* pDrawObj );
407cdf0e10cSrcweir 	void			MakeVisible( const Rectangle& rHMMRect );
408cdf0e10cSrcweir 
409cdf0e10cSrcweir 									// Zeichnen
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 	void			InvertBlockMark(SCCOL nBlockStartX, SCROW nBlockStartY,
412cdf0e10cSrcweir 								SCCOL nBlockEndX, SCROW nBlockEndY);
413cdf0e10cSrcweir 
414cdf0e10cSrcweir //UNUSED2008-05  void            DrawDragRect( SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
415cdf0e10cSrcweir //UNUSED2008-05                                ScSplitPos ePos );
416cdf0e10cSrcweir //UNUSED2008-05  void			PaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
417cdf0e10cSrcweir //UNUSED2008-05  void			PaintLeftRow( SCROW nRow );
418cdf0e10cSrcweir //UNUSED2008-05  void			PaintTopCol( SCCOL nCol );
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 	void			PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
421cdf0e10cSrcweir 										ScUpdateMode eMode = SC_UPDATE_ALL );
422cdf0e10cSrcweir 
423cdf0e10cSrcweir 	void			PaintGrid();
424cdf0e10cSrcweir 
425cdf0e10cSrcweir 	void			PaintTopArea( SCCOL nStartCol, SCCOL nEndCol );
426cdf0e10cSrcweir 	void			PaintTop();
427cdf0e10cSrcweir 
428cdf0e10cSrcweir 	void			PaintLeftArea( SCROW nStartRow, SCROW nEndRow );
429cdf0e10cSrcweir 	void			PaintLeft();
430cdf0e10cSrcweir 
431cdf0e10cSrcweir 	sal_Bool			PaintExtras();
432cdf0e10cSrcweir 
433cdf0e10cSrcweir 	void			RecalcPPT();
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 	void			CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress);
436cdf0e10cSrcweir 
437cdf0e10cSrcweir     void            UpdateSelectionOverlay();
438cdf0e10cSrcweir     void            UpdateShrinkOverlay();
439cdf0e10cSrcweir     void            UpdateAllOverlays();
440cdf0e10cSrcweir 
441cdf0e10cSrcweir 	void			UpdateFormulas();
442cdf0e10cSrcweir 	void			InterpretVisible();
443cdf0e10cSrcweir 	void			CheckNeedsRepaint();
444cdf0e10cSrcweir 
445cdf0e10cSrcweir 	void			PaintRangeFinder( long nNumber = -1 );
446cdf0e10cSrcweir 	void			AddHighlightRange( const ScRange& rRange, const Color& rColor );
447cdf0e10cSrcweir 	void			ClearHighlightRanges();
448cdf0e10cSrcweir 
449cdf0e10cSrcweir 	void			DoChartSelection( const ::com::sun::star::uno::Sequence<
450cdf0e10cSrcweir                                       ::com::sun::star::chart2::data::HighlightedRange > & rHilightRanges );
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 	long			GetGridWidth( ScHSplitPos eWhich );
453cdf0e10cSrcweir 	long			GetGridHeight( ScVSplitPos eWhich );
454cdf0e10cSrcweir 
455cdf0e10cSrcweir 	void			UpdateScrollBars();
456cdf0e10cSrcweir 	void			SetNewVisArea();
457cdf0e10cSrcweir 
458cdf0e10cSrcweir 	void			InvalidateAttribs();
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 	void			MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW nRow );
461cdf0e10cSrcweir 	void			KillEditView( sal_Bool bNoPaint );
462cdf0e10cSrcweir 	void			UpdateEditView();
463cdf0e10cSrcweir 
464cdf0e10cSrcweir 
465cdf0e10cSrcweir 									//	Bloecke
466cdf0e10cSrcweir 
467cdf0e10cSrcweir 	void			SelectAll( sal_Bool bContinue = sal_False );
468cdf0e10cSrcweir 	void			SelectAllTables();
469cdf0e10cSrcweir     void            DeselectAllTables();
470cdf0e10cSrcweir 
471cdf0e10cSrcweir 	void			MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
472cdf0e10cSrcweir                                 sal_Bool bCols = sal_False, sal_Bool bRows = sal_False, sal_Bool bCellSelection = sal_False );
473cdf0e10cSrcweir 	void			InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
474cdf0e10cSrcweir 									sal_Bool bTestNeg = sal_False,
475*0deba7fbSSteve Yin 									sal_Bool bCols = sal_False, sal_Bool bRows = sal_False, sal_Bool bForceNeg = sal_False );
476cdf0e10cSrcweir 	void			InitOwnBlockMode();
477cdf0e10cSrcweir 	void			DoneBlockMode( sal_Bool bContinue = sal_False );
478cdf0e10cSrcweir 
IsBlockMode() const479cdf0e10cSrcweir 	sal_Bool			IsBlockMode() const		{ return bIsBlockMode; }
480cdf0e10cSrcweir 
481cdf0e10cSrcweir 	void			MarkColumns();
482cdf0e10cSrcweir 	void			MarkRows();
483cdf0e10cSrcweir 	void			MarkDataArea( sal_Bool bIncludeCursor = sal_True );
484cdf0e10cSrcweir 	void			MarkMatrixFormula();
485cdf0e10cSrcweir 	void			Unmark();
486cdf0e10cSrcweir 
487cdf0e10cSrcweir     void            MarkRange( const ScRange& rRange, sal_Bool bSetCursor = sal_True, sal_Bool bContinue = sal_False );
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 	sal_Bool			IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
490cdf0e10cSrcweir 
491cdf0e10cSrcweir 	void			PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
492cdf0e10cSrcweir 	void			PaintBlock( sal_Bool bReset = sal_False );
493cdf0e10cSrcweir 
494cdf0e10cSrcweir     void            SetMarkData( const ScMarkData& rNew );
495cdf0e10cSrcweir     void            MarkDataChanged();
496cdf0e10cSrcweir 
497cdf0e10cSrcweir 	void			LockModifiers( sal_uInt16 nModifiers );
498cdf0e10cSrcweir 	sal_uInt16			GetLockedModifiers() const;
499cdf0e10cSrcweir 	void			ViewOptionsHasChanged( sal_Bool bHScrollChanged,
500cdf0e10cSrcweir 											sal_Bool bGraphicsChanged = sal_False);
501cdf0e10cSrcweir 
502cdf0e10cSrcweir 	Point			GetMousePosPixel();
503cdf0e10cSrcweir 
504cdf0e10cSrcweir 	void			SnapSplitPos( Point& rScreenPosPixel );
505cdf0e10cSrcweir 	void			FreezeSplitters( sal_Bool bFreeze );
506cdf0e10cSrcweir 	void			RemoveSplit();
507cdf0e10cSrcweir 	void			SplitAtCursor();
508cdf0e10cSrcweir 	void			SplitAtPixel( const Point& rPixel, sal_Bool bHor, sal_Bool bVer );
509cdf0e10cSrcweir 	void			InvalidateSplit();
510cdf0e10cSrcweir 
511cdf0e10cSrcweir 	void			ErrorMessage( sal_uInt16 nGlobStrId );
512cdf0e10cSrcweir 	Window*			GetParentOrChild( sal_uInt16 nChildId );
513cdf0e10cSrcweir 
514cdf0e10cSrcweir 	void			EnableRefInput(sal_Bool bFlag=sal_True);
515cdf0e10cSrcweir 
GetFrameWin() const516cdf0e10cSrcweir 	Window*			GetFrameWin() const	{ return pFrameWin; }
517cdf0e10cSrcweir 
HasPaintBrush() const518cdf0e10cSrcweir     sal_Bool            HasPaintBrush() const           { return pBrushDocument || pDrawBrushSet; }
GetBrushDocument() const519cdf0e10cSrcweir     ScDocument*     GetBrushDocument() const        { return pBrushDocument; }
GetDrawBrushSet() const520cdf0e10cSrcweir     SfxItemSet*     GetDrawBrushSet() const         { return pDrawBrushSet; }
IsPaintBrushLocked() const521cdf0e10cSrcweir     sal_Bool            IsPaintBrushLocked() const      { return bLockPaintBrush; }
522cdf0e10cSrcweir     void            SetBrushDocument( ScDocument* pNew, sal_Bool bLock );
523cdf0e10cSrcweir     void            SetDrawBrushSet( SfxItemSet* pNew, sal_Bool bLock );
524cdf0e10cSrcweir     void            ResetBrushDocument();
525cdf0e10cSrcweir };
526cdf0e10cSrcweir 
527cdf0e10cSrcweir 
528cdf0e10cSrcweir 
529cdf0e10cSrcweir #endif
530cdf0e10cSrcweir 
531