Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / select.hxx
blob4a6eaf31855b3eaf3e30993a4c375cd7f03d18fc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 SC_SELECT_HXX
21 #define SC_SELECT_HXX
23 #include <vcl/seleng.hxx>
25 #include "viewdata.hxx"
27 // ---------------------------------------------------------------------------
29 class ScTabView;
30 class ScViewData;
33 class ScViewSelectionEngine : public SelectionEngine
35 private:
36 ScSplitPos eWhich;
37 public:
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)
48 private:
49 ScViewData* pViewData;
50 ScViewSelectionEngine* pEngine;
52 sal_Bool bAnchor;
53 sal_Bool bStarted;
54 ScAddress aAnchorPos;
56 ScSplitPos GetWhich();
58 sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
59 bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
61 public:
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
86 private:
87 ScViewData* pViewData;
88 sal_Bool bColumn; // Col- / Rowbar
89 ScSplitPos eWhich;
91 sal_Bool bAnchor;
92 SCCOLROW nCursorPos;
94 public:
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
114 public:
115 ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet );
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */