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 .
23 #include <vcl/seleng.hxx>
25 #include "viewdata.hxx"
27 // ---------------------------------------------------------------------------
33 class ScViewSelectionEngine
: public SelectionEngine
38 ScViewSelectionEngine( Window
* pWindow
, ScTabView
* pView
,
39 ScSplitPos eSplitPos
);
41 ScSplitPos
GetWhich() const { return eWhich
; }
42 void SetWhich(ScSplitPos eNew
) { eWhich
= eNew
; }
46 class ScViewFunctionSet
: public FunctionSet
// View (Gridwin / keyboard)
49 ScViewData
* pViewData
;
50 ScViewSelectionEngine
* pEngine
;
56 ScSplitPos
GetWhich();
58 sal_uLong
CalcUpdateInterval( const Size
& rWinSize
, const Point
& rEffPos
,
59 bool bLeftScroll
, bool bTopScroll
, bool bRightScroll
, bool bBottomScroll
);
62 ScViewFunctionSet( ScViewData
* pNewViewData
);
64 void SetSelectionEngine( ScViewSelectionEngine
* pSelEngine
);
66 void SetAnchor( SCCOL nPosX
, SCROW nPosY
);
67 void SetAnchorFlag( sal_Bool bSet
);
69 virtual void BeginDrag();
70 virtual void CreateAnchor();
71 virtual void DestroyAnchor();
72 virtual sal_Bool
SetCursorAtPoint( const Point
& rPointPixel
, sal_Bool bDontSelectAtCursor
= false );
73 virtual sal_Bool
IsSelectionAtPoint( const Point
& rPointPixel
);
74 virtual void DeselectAtPoint( const Point
& rPointPixel
);
75 virtual void DeselectAll();
77 sal_Bool
SetCursorAtCell( SCsCOL nPosX
, SCsROW nPosY
, sal_Bool bScroll
);
81 // ---------------------------------------------------------------------------
84 class ScHeaderFunctionSet
: public FunctionSet
// Column / row headers
87 ScViewData
* pViewData
;
88 sal_Bool bColumn
; // Col- / Rowbar
95 ScHeaderFunctionSet( ScViewData
* pNewViewData
);
97 void SetColumn( sal_Bool bSet
);
98 void SetWhich( ScSplitPos eNew
);
100 virtual void BeginDrag();
101 virtual void CreateAnchor();
102 virtual void DestroyAnchor();
103 virtual sal_Bool
SetCursorAtPoint( const Point
& rPointPixel
, sal_Bool bDontSelectAtCursor
= false );
104 virtual sal_Bool
IsSelectionAtPoint( const Point
& rPointPixel
);
105 virtual void DeselectAtPoint( const Point
& rPointPixel
);
106 virtual void DeselectAll();
108 void SetAnchorFlag(sal_Bool bSet
) { bAnchor
= bSet
; }
112 class ScHeaderSelectionEngine
: public SelectionEngine
115 ScHeaderSelectionEngine( Window
* pWindow
, ScHeaderFunctionSet
* pFuncSet
);
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */