1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: select.hxx,v $
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 ************************************************************************/
34 #ifndef _SELENG_HXX //autogen
35 #include <vcl/seleng.hxx>
38 #include "viewdata.hxx" // ScSplitPos
40 // ---------------------------------------------------------------------------
46 class ScViewSelectionEngine
: public SelectionEngine
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)
62 ScViewData
* pViewData
;
63 ScViewSelectionEngine
* pEngine
;
69 ScSplitPos
GetWhich();
71 ULONG
CalcUpdateInterval( const Size
& rWinSize
, const Point
& rEffPos
,
72 bool bLeftScroll
, bool bTopScroll
, bool bRightScroll
, bool bBottomScroll
);
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
100 ScViewData
* pViewData
;
101 BOOL bColumn
; // Col- / Rowbar
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
128 ScHeaderSelectionEngine( Window
* pWindow
, ScHeaderFunctionSet
* pFuncSet
);