1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <vcl/seleng.hxx>
24 #include "viewdata.hxx"
28 class ScViewSelectionEngine
: public SelectionEngine
33 ScViewSelectionEngine( vcl::Window
* pWindow
, ScTabView
* pView
,
34 ScSplitPos eSplitPos
);
36 ScSplitPos
GetWhich() const { return eWhich
; }
37 void SetWhich(ScSplitPos eNew
) { eWhich
= eNew
; }
40 class ScViewFunctionSet
: public FunctionSet
// View (Gridwin / keyboard)
43 ScViewData
* m_pViewData
;
44 ScViewSelectionEngine
* m_pEngine
;
48 ScAddress m_aAnchorPos
;
50 ScSplitPos
GetWhich() const;
52 sal_uInt64
CalcUpdateInterval( const Size
& rWinSize
, const Point
& rEffPos
,
53 bool bLeftScroll
, bool bTopScroll
, bool bRightScroll
, bool bBottomScroll
);
56 ScViewFunctionSet( ScViewData
* pNewViewData
);
58 void SetSelectionEngine( ScViewSelectionEngine
* pSelEngine
);
60 void SetAnchor( SCCOL nPosX
, SCROW nPosY
);
61 void SetAnchorFlag( bool bSet
);
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
;
71 bool SetCursorAtCell( SCCOL nPosX
, SCROW nPosY
, bool bScroll
);
72 bool CheckRefBounds(SCCOL nPosX
, SCROW nPosY
);
75 class ScHeaderFunctionSet
: public FunctionSet
// Column / row headers
78 ScViewData
* pViewData
;
79 bool bColumn
; // Col- / Rowbar
86 ScHeaderFunctionSet( ScViewData
* pNewViewData
);
88 void SetColumn( bool bSet
);
89 void SetWhich( ScSplitPos eNew
);
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
;
99 void SetAnchorFlag(bool bSet
) { bAnchor
= bSet
; }
102 class ScHeaderSelectionEngine
: public SelectionEngine
105 ScHeaderSelectionEngine( vcl::Window
* pWindow
, ScHeaderFunctionSet
* pFuncSet
);
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */