Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_SELECT_HXX
30 : : #define SC_SELECT_HXX
31 : :
32 : : #include <vcl/seleng.hxx>
33 : :
34 : : #include "viewdata.hxx" // ScSplitPos
35 : :
36 : : // ---------------------------------------------------------------------------
37 : :
38 : : class ScTabView;
39 : : class ScViewData;
40 : :
41 : :
42 : 225 : class ScViewSelectionEngine : public SelectionEngine
43 : : {
44 : : private:
45 : : ScSplitPos eWhich;
46 : : public:
47 : : ScViewSelectionEngine( Window* pWindow, ScTabView* pView,
48 : : ScSplitPos eSplitPos );
49 : :
50 : 0 : ScSplitPos GetWhich() const { return eWhich; }
51 : 0 : void SetWhich(ScSplitPos eNew) { eWhich = eNew; }
52 : : };
53 : :
54 : :
55 [ - + ]: 225 : class ScViewFunctionSet : public FunctionSet // View (Gridwin / keyboard)
56 : : {
57 : : private:
58 : : ScViewData* pViewData;
59 : : ScViewSelectionEngine* pEngine;
60 : :
61 : : sal_Bool bAnchor;
62 : : sal_Bool bStarted;
63 : : ScAddress aAnchorPos;
64 : :
65 : : ScSplitPos GetWhich();
66 : :
67 : : sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
68 : : bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
69 : :
70 : : public:
71 : : ScViewFunctionSet( ScViewData* pNewViewData );
72 : :
73 : : void SetSelectionEngine( ScViewSelectionEngine* pSelEngine );
74 : :
75 : : void SetAnchor( SCCOL nPosX, SCROW nPosY );
76 : : void SetAnchorFlag( sal_Bool bSet );
77 : :
78 : : virtual void BeginDrag();
79 : : virtual void CreateAnchor();
80 : : virtual void DestroyAnchor();
81 : : virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false );
82 : : virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
83 : : virtual void DeselectAtPoint( const Point& rPointPixel );
84 : : virtual void DeselectAll();
85 : :
86 : : sal_Bool SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Bool bScroll );
87 : : };
88 : :
89 : :
90 : : // ---------------------------------------------------------------------------
91 : :
92 : :
93 [ - + ]: 225 : class ScHeaderFunctionSet : public FunctionSet // Column / row headers
94 : : {
95 : : private:
96 : : ScViewData* pViewData;
97 : : sal_Bool bColumn; // Col- / Rowbar
98 : : ScSplitPos eWhich;
99 : :
100 : : sal_Bool bAnchor;
101 : : SCCOLROW nCursorPos;
102 : :
103 : : public:
104 : : ScHeaderFunctionSet( ScViewData* pNewViewData );
105 : :
106 : : void SetColumn( sal_Bool bSet );
107 : : void SetWhich( ScSplitPos eNew );
108 : :
109 : : virtual void BeginDrag();
110 : : virtual void CreateAnchor();
111 : : virtual void DestroyAnchor();
112 : : virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false );
113 : : virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
114 : : virtual void DeselectAtPoint( const Point& rPointPixel );
115 : : virtual void DeselectAll();
116 : :
117 : 5 : void SetAnchorFlag(sal_Bool bSet) { bAnchor = bSet; }
118 : : };
119 : :
120 : :
121 : 225 : class ScHeaderSelectionEngine : public SelectionEngine
122 : : {
123 : : public:
124 : : ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet );
125 : : };
126 : :
127 : :
128 : :
129 : : #endif
130 : :
131 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|