xref: /AOO41X/main/sc/source/ui/inc/fupoor.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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
10cdf0e10cSrcweir  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SC_FUPOOR_HXX
25cdf0e10cSrcweir #define _SC_FUPOOR_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/event.hxx>
28cdf0e10cSrcweir #include <vcl/timer.hxx>
29cdf0e10cSrcweir #include <sfx2/request.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class ScDrawView;
32cdf0e10cSrcweir class ScTabViewShell;
33cdf0e10cSrcweir class Window;
34cdf0e10cSrcweir class SdrModel;
35cdf0e10cSrcweir class Dialog;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // #98185# Create default drawing objects via keyboard
38cdf0e10cSrcweir class SdrObject;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //  Return-Werte fuer Command
41cdf0e10cSrcweir #define SC_CMD_NONE     0
42cdf0e10cSrcweir #define SC_CMD_USED     1
43cdf0e10cSrcweir #define SC_CMD_IGNORE   2
44cdf0e10cSrcweir 
45cdf0e10cSrcweir /*************************************************************************
46cdf0e10cSrcweir |*
47cdf0e10cSrcweir |* Basisklasse fuer alle Funktionen
48cdf0e10cSrcweir |*
49cdf0e10cSrcweir \************************************************************************/
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class FuPoor
52cdf0e10cSrcweir {
53cdf0e10cSrcweir protected:
54cdf0e10cSrcweir     ScDrawView*     pView;
55cdf0e10cSrcweir     ScTabViewShell* pViewShell;
56cdf0e10cSrcweir     Window*         pWindow;
57cdf0e10cSrcweir     SdrModel*       pDrDoc;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     SfxRequest      aSfxRequest;
60cdf0e10cSrcweir     Dialog*         pDialog;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir     Timer           aScrollTimer;           // fuer Autoscrolling
63cdf0e10cSrcweir     DECL_LINK( ScrollHdl, Timer * );
64cdf0e10cSrcweir     void ForceScroll(const Point& aPixPos);
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     Timer           aDragTimer;             // fuer Drag&Drop
67cdf0e10cSrcweir     DECL_LINK( DragTimerHdl, Timer * );
68cdf0e10cSrcweir     DECL_LINK( DragHdl, void * );
69cdf0e10cSrcweir     sal_Bool            bIsInDragMode;
70cdf0e10cSrcweir     Point           aMDPos;                 // Position von MouseButtonDown
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     // #95491# member to hold state of the mouse buttons for creation
73cdf0e10cSrcweir     // of own MouseEvents (like in ScrollHdl)
74cdf0e10cSrcweir private:
75cdf0e10cSrcweir     sal_uInt16      mnCode;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir     FuPoor(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView,
79cdf0e10cSrcweir            SdrModel* pDoc, SfxRequest& rReq);
80cdf0e10cSrcweir     virtual ~FuPoor();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     // #95491# see member
SetMouseButtonCode(sal_uInt16 nNew)83cdf0e10cSrcweir     void SetMouseButtonCode(sal_uInt16 nNew) { if(nNew != mnCode) mnCode = nNew; }
GetMouseButtonCode() const84cdf0e10cSrcweir     sal_uInt16 GetMouseButtonCode() const { return mnCode; }
85cdf0e10cSrcweir 
Paint(const Rectangle &,Window *)86cdf0e10cSrcweir     virtual void Paint(const Rectangle&, Window*) {}
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     virtual void DoCut();
89cdf0e10cSrcweir     virtual void DoCopy();
90cdf0e10cSrcweir     virtual void DoPaste();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     // Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet
93cdf0e10cSrcweir     virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
MouseMove(const MouseEvent &)94cdf0e10cSrcweir     virtual sal_Bool MouseMove(const MouseEvent&) { return sal_False; }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     // #95491# moved from inline to *.cxx
97cdf0e10cSrcweir     virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); // { return sal_False; }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     // #95491# moved from inline to *.cxx
100cdf0e10cSrcweir     virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); // { return sal_False; }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     virtual sal_uInt8 Command(const CommandEvent& rCEvt);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     virtual void Activate();        // Function aktivieren
105cdf0e10cSrcweir     virtual void Deactivate();      // Function deaktivieren
106cdf0e10cSrcweir 
ScrollStart()107cdf0e10cSrcweir     virtual void ScrollStart() {}   // diese Funktionen werden von
ScrollEnd()108cdf0e10cSrcweir     virtual void ScrollEnd() {}     // ForceScroll aufgerufen
109cdf0e10cSrcweir 
SetWindow(Window * pWin)110cdf0e10cSrcweir     void SetWindow(Window* pWin) { pWindow = pWin; }
111cdf0e10cSrcweir 
GetSlotID() const112cdf0e10cSrcweir     sal_uInt16 GetSlotID() const { return( aSfxRequest.GetSlot() ); }
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     sal_Bool    IsDetectiveHit( const Point& rLogicPos );
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     void    StopDragTimer();
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     // #98185# Create default drawing objects via keyboard
119cdf0e10cSrcweir     virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir protected:
122cdf0e10cSrcweir     void ImpForceQuadratic(Rectangle& rRect);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir public:
125cdf0e10cSrcweir     // #i33136#
126cdf0e10cSrcweir     virtual bool doConstructOrthogonal() const;
127cdf0e10cSrcweir };
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 
131cdf0e10cSrcweir #endif      // _SD_FUPOOR_HXX
132cdf0e10cSrcweir 
133