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 INCLUDED_SC_SOURCE_UI_INC_SELECT_HXX
21 : #define INCLUDED_SC_SOURCE_UI_INC_SELECT_HXX
22 :
23 : #include <vcl/seleng.hxx>
24 :
25 : #include "viewdata.hxx"
26 :
27 : class ScTabView;
28 : class ScViewData;
29 :
30 546 : class ScViewSelectionEngine : public SelectionEngine
31 : {
32 : private:
33 : ScSplitPos eWhich;
34 : public:
35 : ScViewSelectionEngine( vcl::Window* pWindow, ScTabView* pView,
36 : ScSplitPos eSplitPos );
37 :
38 0 : ScSplitPos GetWhich() const { return eWhich; }
39 20 : void SetWhich(ScSplitPos eNew) { eWhich = eNew; }
40 : };
41 :
42 546 : class ScViewFunctionSet : public FunctionSet // View (Gridwin / keyboard)
43 : {
44 : private:
45 : ScViewData* pViewData;
46 : ScViewSelectionEngine* pEngine;
47 :
48 : bool bAnchor;
49 : bool bStarted;
50 : ScAddress aAnchorPos;
51 :
52 : ScSplitPos GetWhich();
53 :
54 : sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
55 : bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
56 :
57 : public:
58 : ScViewFunctionSet( ScViewData* pNewViewData );
59 :
60 : void SetSelectionEngine( ScViewSelectionEngine* pSelEngine );
61 :
62 : void SetAnchor( SCCOL nPosX, SCROW nPosY );
63 : void SetAnchorFlag( bool bSet );
64 :
65 : virtual void BeginDrag() SAL_OVERRIDE;
66 : virtual void CreateAnchor() SAL_OVERRIDE;
67 : virtual void DestroyAnchor() SAL_OVERRIDE;
68 : virtual bool SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) SAL_OVERRIDE;
69 : virtual bool IsSelectionAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
70 : virtual void DeselectAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
71 : virtual void DeselectAll() SAL_OVERRIDE;
72 :
73 : bool SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, bool bScroll );
74 : };
75 :
76 546 : class ScHeaderFunctionSet : public FunctionSet // Column / row headers
77 : {
78 : private:
79 : ScViewData* pViewData;
80 : bool bColumn; // Col- / Rowbar
81 : ScSplitPos eWhich;
82 :
83 : bool bAnchor;
84 : SCCOLROW nCursorPos;
85 :
86 : public:
87 : ScHeaderFunctionSet( ScViewData* pNewViewData );
88 :
89 : void SetColumn( bool bSet );
90 : void SetWhich( ScSplitPos eNew );
91 :
92 : virtual void BeginDrag() SAL_OVERRIDE;
93 : virtual void CreateAnchor() SAL_OVERRIDE;
94 : virtual void DestroyAnchor() SAL_OVERRIDE;
95 : virtual bool SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) SAL_OVERRIDE;
96 : virtual bool IsSelectionAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
97 : virtual void DeselectAtPoint( const Point& rPointPixel ) SAL_OVERRIDE;
98 : virtual void DeselectAll() SAL_OVERRIDE;
99 :
100 136 : void SetAnchorFlag(bool bSet) { bAnchor = bSet; }
101 : };
102 :
103 546 : class ScHeaderSelectionEngine : public SelectionEngine
104 : {
105 : public:
106 : ScHeaderSelectionEngine( vcl::Window* pWindow, ScHeaderFunctionSet* pFuncSet );
107 : };
108 :
109 : #endif
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|