LibreOffice Module sc (master)  1
select.hxx
Go to the documentation of this file.
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 #pragma once
21 
22 #include <vcl/seleng.hxx>
23 
24 #include "viewdata.hxx"
25 
26 class ScTabView;
27 
29 {
30 private:
32 public:
34  ScSplitPos eSplitPos );
35 
36  ScSplitPos GetWhich() const { return eWhich; }
37  void SetWhich(ScSplitPos eNew) { eWhich = eNew; }
38 };
39 
40 class ScViewFunctionSet : public FunctionSet // View (Gridwin / keyboard)
41 {
42 private:
45 
46  bool bAnchor;
47  bool bStarted;
49 
50  ScSplitPos GetWhich() const;
51 
52  sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
53  bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
54 
55 public:
56  ScViewFunctionSet( ScViewData* pNewViewData );
57 
58  void SetSelectionEngine( ScViewSelectionEngine* pSelEngine );
59 
60  void SetAnchor( SCCOL nPosX, SCROW nPosY );
61  void SetAnchorFlag( bool bSet );
62 
63  virtual void BeginDrag() override;
64  virtual void CreateAnchor() override;
65  virtual void DestroyAnchor() override;
66  virtual void SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) override;
67  virtual bool IsSelectionAtPoint( const Point& rPointPixel ) override;
68  virtual void DeselectAtPoint( const Point& rPointPixel ) override;
69  virtual void DeselectAll() override;
70 
71  bool SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll );
72  bool CheckRefBounds(SCCOL nPosX, SCROW nPosY);
73 };
74 
75 class ScHeaderFunctionSet : public FunctionSet // Column / row headers
76 {
77 private:
79  bool bColumn; // Col- / Rowbar
81 
82  bool bAnchor;
84 
85 public:
86  ScHeaderFunctionSet( ScViewData* pNewViewData );
87 
88  void SetColumn( bool bSet );
89  void SetWhich( ScSplitPos eNew );
90 
91  virtual void BeginDrag() override;
92  virtual void CreateAnchor() override;
93  virtual void DestroyAnchor() override;
94  virtual void SetCursorAtPoint( const Point& rPointPixel, bool bDontSelectAtCursor = false ) override;
95  virtual bool IsSelectionAtPoint( const Point& rPointPixel ) override;
96  virtual void DeselectAtPoint( const Point& rPointPixel ) override;
97  virtual void DeselectAll() override;
98 
99  void SetAnchorFlag(bool bSet) { bAnchor = bSet; }
100 };
101 
103 {
104 public:
106 };
107 
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void BeginDrag() override
Definition: select.cxx:145
void SetWhich(ScSplitPos eNew)
Definition: select.hxx:37
virtual void SetCursorAtPoint(const Point &rPointPixel, bool bDontSelectAtCursor=false) override
Definition: select.cxx:287
virtual void DeselectAll() override
Definition: select.cxx:759
ScViewSelectionEngine(vcl::Window *pWindow, ScTabView *pView, ScSplitPos eSplitPos)
Definition: select.cxx:778
sal_uIntPtr sal_uLong
ScHeaderFunctionSet(ScViewData *pNewViewData)
Definition: select.cxx:788
ScViewSelectionEngine * pEngine
Definition: select.hxx:44
virtual bool IsSelectionAtPoint(const Point &rPointPixel) override
Definition: select.cxx:733
sal_uLong CalcUpdateInterval(const Size &rWinSize, const Point &rEffPos, bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll)
Definition: select.cxx:62
void SetSelectionEngine(ScViewSelectionEngine *pSelEngine)
Definition: select.cxx:139
ScSplitPos
Definition: viewdata.hxx:44
void SetColumn(bool bSet)
Definition: select.cxx:798
ScHeaderSelectionEngine(vcl::Window *pWindow, ScHeaderFunctionSet *pFuncSet)
Definition: select.cxx:972
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
ScSplitPos eWhich
Definition: select.hxx:31
void SetWhich(ScSplitPos eNew)
Definition: select.cxx:803
virtual bool IsSelectionAtPoint(const Point &rPointPixel) override
Definition: select.cxx:948
virtual void DeselectAll() override
Definition: select.cxx:966
ScViewData * pViewData
Definition: select.hxx:43
sal_Int16 SCCOL
Definition: types.hxx:21
virtual void CreateAnchor() override
Definition: select.cxx:813
SCCOLROW nCursorPos
Definition: select.hxx:83
ScSplitPos eWhich
Definition: select.hxx:80
virtual void BeginDrag() override
Definition: select.cxx:808
bool CheckRefBounds(SCCOL nPosX, SCROW nPosY)
Definition: select.cxx:419
virtual void SetCursorAtPoint(const Point &rPointPixel, bool bDontSelectAtCursor=false) override
Definition: select.cxx:839
ScSplitPos GetWhich() const
Definition: select.hxx:36
ScSplitPos GetWhich() const
Definition: select.cxx:54
void SetAnchorFlag(bool bSet)
Definition: select.hxx:99
sal_Int32 SCROW
Definition: types.hxx:17
ScAddress aAnchorPos
Definition: select.hxx:48
void SetAnchor(SCCOL nPosX, SCROW nPosY)
Definition: select.cxx:227
virtual void DestroyAnchor() override
Definition: select.cxx:271
virtual void DestroyAnchor() override
Definition: select.cxx:833
ScViewData * pViewData
Definition: select.hxx:78
virtual void DeselectAtPoint(const Point &rPointPixel) override
Definition: select.cxx:962
virtual void DeselectAtPoint(const Point &rPointPixel) override
Definition: select.cxx:754
virtual void CreateAnchor() override
Definition: select.cxx:216
void SetAnchorFlag(bool bSet)
Definition: select.cxx:282
bool SetCursorAtCell(SCCOL nPosX, SCROW nPosY, bool bScroll)
Definition: select.cxx:430
ScViewFunctionSet(ScViewData *pNewViewData)
Definition: select.cxx:45