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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_SELECT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_SELECT_HXX
23 #include <vcl/seleng.hxx>
25 #include "viewdata.hxx"
30 class ScViewSelectionEngine
: public SelectionEngine
35 ScViewSelectionEngine( vcl::Window
* pWindow
, ScTabView
* pView
,
36 ScSplitPos eSplitPos
);
38 ScSplitPos
GetWhich() const { return eWhich
; }
39 void SetWhich(ScSplitPos eNew
) { eWhich
= eNew
; }
42 class ScViewFunctionSet
: public FunctionSet
// View (Gridwin / keyboard)
45 ScViewData
* pViewData
;
46 ScViewSelectionEngine
* pEngine
;
52 ScSplitPos
GetWhich();
54 sal_uLong
CalcUpdateInterval( const Size
& rWinSize
, const Point
& rEffPos
,
55 bool bLeftScroll
, bool bTopScroll
, bool bRightScroll
, bool bBottomScroll
);
58 ScViewFunctionSet( ScViewData
* pNewViewData
);
60 void SetSelectionEngine( ScViewSelectionEngine
* pSelEngine
);
62 void SetAnchor( SCCOL nPosX
, SCROW nPosY
);
63 void SetAnchorFlag( bool bSet
);
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
;
73 bool SetCursorAtCell( SCsCOL nPosX
, SCsROW nPosY
, bool bScroll
);
76 class ScHeaderFunctionSet
: public FunctionSet
// Column / row headers
79 ScViewData
* pViewData
;
80 bool bColumn
; // Col- / Rowbar
87 ScHeaderFunctionSet( ScViewData
* pNewViewData
);
89 void SetColumn( bool bSet
);
90 void SetWhich( ScSplitPos eNew
);
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
;
100 void SetAnchorFlag(bool bSet
) { bAnchor
= bSet
; }
103 class ScHeaderSelectionEngine
: public SelectionEngine
106 ScHeaderSelectionEngine( vcl::Window
* pWindow
, ScHeaderFunctionSet
* pFuncSet
);
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */