Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef SC_SELECT_HXX
21 : #define SC_SELECT_HXX
22 :
23 : #include <vcl/seleng.hxx>
24 :
25 : #include "viewdata.hxx"
26 :
27 : class ScTabView;
28 : class ScViewData;
29 :
30 :
31 0 : class ScViewSelectionEngine : public SelectionEngine
32 : {
33 : private:
34 : ScSplitPos eWhich;
35 : public:
36 : ScViewSelectionEngine( Window* pWindow, ScTabView* pView,
37 : ScSplitPos eSplitPos );
38 :
39 0 : ScSplitPos GetWhich() const { return eWhich; }
40 0 : void SetWhich(ScSplitPos eNew) { eWhich = eNew; }
41 : };
42 :
43 :
44 0 : class ScViewFunctionSet : public FunctionSet // View (Gridwin / keyboard)
45 : {
46 : private:
47 : ScViewData* pViewData;
48 : ScViewSelectionEngine* pEngine;
49 :
50 : bool bAnchor;
51 : bool bStarted;
52 : ScAddress aAnchorPos;
53 :
54 : ScSplitPos GetWhich();
55 :
56 : sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
57 : bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
58 :
59 : public:
60 : ScViewFunctionSet( ScViewData* pNewViewData );
61 :
62 : void SetSelectionEngine( ScViewSelectionEngine* pSelEngine );
63 :
64 : void SetAnchor( SCCOL nPosX, SCROW nPosY );
65 : void SetAnchorFlag( bool bSet );
66 :
67 : virtual void BeginDrag() SAL_OVERRIDE;
68 : virtual void CreateAnchor() SAL_OVERRIDE;
69 : virtual void DestroyAnchor() SAL_OVERRIDE;
70 : virtual bool SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) SAL_OVERRIDE;
71 : virtual bool IsSelectionAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
72 : virtual void DeselectAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
73 : virtual void DeselectAll() SAL_OVERRIDE;
74 :
75 : bool SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, bool bScroll );
76 : };
77 :
78 :
79 :
80 0 : class ScHeaderFunctionSet : public FunctionSet // Column / row headers
81 : {
82 : private:
83 : ScViewData* pViewData;
84 : bool bColumn; // Col- / Rowbar
85 : ScSplitPos eWhich;
86 :
87 : bool bAnchor;
88 : SCCOLROW nCursorPos;
89 :
90 : public:
91 : ScHeaderFunctionSet( ScViewData* pNewViewData );
92 :
93 : void SetColumn( bool bSet );
94 : void SetWhich( ScSplitPos eNew );
95 :
96 : virtual void BeginDrag() SAL_OVERRIDE;
97 : virtual void CreateAnchor() SAL_OVERRIDE;
98 : virtual void DestroyAnchor() SAL_OVERRIDE;
99 : virtual bool SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) SAL_OVERRIDE;
100 : virtual bool IsSelectionAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
101 : virtual void DeselectAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
102 : virtual void DeselectAll() SAL_OVERRIDE;
103 :
104 0 : void SetAnchorFlag(bool bSet) { bAnchor = bSet; }
105 : };
106 :
107 :
108 0 : class ScHeaderSelectionEngine : public SelectionEngine
109 : {
110 : public:
111 : ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet );
112 : };
113 :
114 : #endif
115 :
116 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|