tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / select.hxx
blob299463afddd244e63589d85a4ae2ff7677d18011
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 #pragma once
22 #include <vcl/seleng.hxx>
24 #include "viewdata.hxx"
26 class ScTabView;
28 class ScViewSelectionEngine : public SelectionEngine
30 private:
31 ScSplitPos eWhich;
32 public:
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)
42 private:
43 ScViewData* m_pViewData;
44 ScViewSelectionEngine* m_pEngine;
46 bool m_bAnchor;
47 bool m_bStarted;
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 );
55 public:
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
77 private:
78 ScViewData* pViewData;
79 bool bColumn; // Col- / Rowbar
80 ScSplitPos eWhich;
82 bool bAnchor;
83 SCCOLROW nCursorPos;
85 public:
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
104 public:
105 ScHeaderSelectionEngine( vcl::Window* pWindow, ScHeaderFunctionSet* pFuncSet );
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */