1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_SELECT_HXX 25cdf0e10cSrcweir #define SC_SELECT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _SELENG_HXX //autogen 28cdf0e10cSrcweir #include <vcl/seleng.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include "viewdata.hxx" // ScSplitPos 32cdf0e10cSrcweir 33cdf0e10cSrcweir // --------------------------------------------------------------------------- 34cdf0e10cSrcweir 35cdf0e10cSrcweir class ScTabView; 36cdf0e10cSrcweir class ScViewData; 37cdf0e10cSrcweir 38cdf0e10cSrcweir 39cdf0e10cSrcweir class ScViewSelectionEngine : public SelectionEngine 40cdf0e10cSrcweir { 41cdf0e10cSrcweir private: 42cdf0e10cSrcweir ScSplitPos eWhich; 43cdf0e10cSrcweir public: 44cdf0e10cSrcweir ScViewSelectionEngine( Window* pWindow, ScTabView* pView, 45cdf0e10cSrcweir ScSplitPos eSplitPos ); 46cdf0e10cSrcweir GetWhich() const47cdf0e10cSrcweir ScSplitPos GetWhich() const { return eWhich; } SetWhich(ScSplitPos eNew)48cdf0e10cSrcweir void SetWhich(ScSplitPos eNew) { eWhich = eNew; } 49cdf0e10cSrcweir }; 50cdf0e10cSrcweir 51cdf0e10cSrcweir 52cdf0e10cSrcweir class ScViewFunctionSet : public FunctionSet // View (Gridwin / Tastatur) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir private: 55cdf0e10cSrcweir ScViewData* pViewData; 56cdf0e10cSrcweir ScViewSelectionEngine* pEngine; 57cdf0e10cSrcweir 58cdf0e10cSrcweir sal_Bool bAnchor; 59cdf0e10cSrcweir sal_Bool bStarted; 60cdf0e10cSrcweir ScAddress aAnchorPos; 61cdf0e10cSrcweir 62cdf0e10cSrcweir ScSplitPos GetWhich(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir public: 65cdf0e10cSrcweir ScViewFunctionSet( ScViewData* pNewViewData ); 66cdf0e10cSrcweir 67cdf0e10cSrcweir void SetSelectionEngine( ScViewSelectionEngine* pSelEngine ); 68cdf0e10cSrcweir 69cdf0e10cSrcweir void SetAnchor( SCCOL nPosX, SCROW nPosY ); 70cdf0e10cSrcweir void SetAnchorFlag( sal_Bool bSet ); 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual void BeginDrag(); 73cdf0e10cSrcweir virtual void CreateAnchor(); 74cdf0e10cSrcweir virtual void DestroyAnchor(); 75cdf0e10cSrcweir virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); 76cdf0e10cSrcweir virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); 77cdf0e10cSrcweir virtual void DeselectAtPoint( const Point& rPointPixel ); 78cdf0e10cSrcweir virtual void DeselectAll(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir sal_Bool SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Bool bScroll ); 81cdf0e10cSrcweir }; 82cdf0e10cSrcweir 83cdf0e10cSrcweir 84cdf0e10cSrcweir // --------------------------------------------------------------------------- 85cdf0e10cSrcweir 86cdf0e10cSrcweir 87cdf0e10cSrcweir class ScHeaderFunctionSet : public FunctionSet // Spalten- / Zeilenkoepfe 88cdf0e10cSrcweir { 89cdf0e10cSrcweir private: 90cdf0e10cSrcweir ScViewData* pViewData; 91cdf0e10cSrcweir sal_Bool bColumn; // Col- / Rowbar 92cdf0e10cSrcweir ScSplitPos eWhich; 93cdf0e10cSrcweir 94cdf0e10cSrcweir sal_Bool bAnchor; 95cdf0e10cSrcweir SCCOLROW nCursorPos; 96cdf0e10cSrcweir 97cdf0e10cSrcweir public: 98cdf0e10cSrcweir ScHeaderFunctionSet( ScViewData* pNewViewData ); 99cdf0e10cSrcweir 100cdf0e10cSrcweir void SetColumn( sal_Bool bSet ); 101cdf0e10cSrcweir void SetWhich( ScSplitPos eNew ); 102cdf0e10cSrcweir 103cdf0e10cSrcweir virtual void BeginDrag(); 104cdf0e10cSrcweir virtual void CreateAnchor(); 105cdf0e10cSrcweir virtual void DestroyAnchor(); 106cdf0e10cSrcweir virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); 107cdf0e10cSrcweir virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); 108cdf0e10cSrcweir virtual void DeselectAtPoint( const Point& rPointPixel ); 109cdf0e10cSrcweir virtual void DeselectAll(); 110cdf0e10cSrcweir SetAnchorFlag(sal_Bool bSet)111cdf0e10cSrcweir void SetAnchorFlag(sal_Bool bSet) { bAnchor = bSet; } 112cdf0e10cSrcweir }; 113cdf0e10cSrcweir 114cdf0e10cSrcweir 115cdf0e10cSrcweir class ScHeaderSelectionEngine : public SelectionEngine 116cdf0e10cSrcweir { 117cdf0e10cSrcweir public: 118cdf0e10cSrcweir ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet ); 119cdf0e10cSrcweir }; 120cdf0e10cSrcweir 121cdf0e10cSrcweir 122cdf0e10cSrcweir 123cdf0e10cSrcweir #endif 124