Update ooo320-m1
[ooovba.git] / sc / source / ui / inc / select.hxx
blob883d473e3162666d215d345f982556c5eaddf60b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: select.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_SELECT_HXX
32 #define SC_SELECT_HXX
34 #ifndef _SELENG_HXX //autogen
35 #include <vcl/seleng.hxx>
36 #endif
38 #include "viewdata.hxx" // ScSplitPos
40 // ---------------------------------------------------------------------------
42 class ScTabView;
43 class ScViewData;
46 class ScViewSelectionEngine : public SelectionEngine
48 private:
49 ScSplitPos eWhich;
50 public:
51 ScViewSelectionEngine( Window* pWindow, ScTabView* pView,
52 ScSplitPos eSplitPos );
54 ScSplitPos GetWhich() const { return eWhich; }
55 void SetWhich(ScSplitPos eNew) { eWhich = eNew; }
59 class ScViewFunctionSet : public FunctionSet // View (Gridwin / Tastatur)
61 private:
62 ScViewData* pViewData;
63 ScViewSelectionEngine* pEngine;
65 BOOL bAnchor;
66 BOOL bStarted;
67 ScAddress aAnchorPos;
69 ScSplitPos GetWhich();
71 ULONG CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
72 bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
74 public:
75 ScViewFunctionSet( ScViewData* pNewViewData );
77 void SetSelectionEngine( ScViewSelectionEngine* pSelEngine );
79 void SetAnchor( SCCOL nPosX, SCROW nPosY );
80 void SetAnchorFlag( BOOL bSet );
82 virtual void BeginDrag();
83 virtual void CreateAnchor();
84 virtual void DestroyAnchor();
85 virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
86 virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
87 virtual void DeselectAtPoint( const Point& rPointPixel );
88 virtual void DeselectAll();
90 BOOL SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScroll );
94 // ---------------------------------------------------------------------------
97 class ScHeaderFunctionSet : public FunctionSet // Spalten- / Zeilenkoepfe
99 private:
100 ScViewData* pViewData;
101 BOOL bColumn; // Col- / Rowbar
102 ScSplitPos eWhich;
104 BOOL bAnchor;
105 SCCOLROW nCursorPos;
107 public:
108 ScHeaderFunctionSet( ScViewData* pNewViewData );
110 void SetColumn( BOOL bSet );
111 void SetWhich( ScSplitPos eNew );
113 virtual void BeginDrag();
114 virtual void CreateAnchor();
115 virtual void DestroyAnchor();
116 virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
117 virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
118 virtual void DeselectAtPoint( const Point& rPointPixel );
119 virtual void DeselectAll();
121 void SetAnchorFlag(BOOL bSet) { bAnchor = bSet; }
125 class ScHeaderSelectionEngine : public SelectionEngine
127 public:
128 ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet );
133 #endif