merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / fupoor.hxx
blob87544444e93f3f345279412d99a8b8ba2b3f2c85
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fupoor.hxx,v $
10 * $Revision: 1.7.128.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SC_FUPOOR_HXX
32 #define _SC_FUPOOR_HXX
34 #include <vcl/event.hxx>
35 #include <vcl/timer.hxx>
36 #include <sfx2/request.hxx>
38 class ScDrawView;
39 class ScTabViewShell;
40 class Window;
41 class SdrModel;
42 class Dialog;
44 // #98185# Create default drawing objects via keyboard
45 class SdrObject;
47 // Return-Werte fuer Command
48 #define SC_CMD_NONE 0
49 #define SC_CMD_USED 1
50 #define SC_CMD_IGNORE 2
52 /*************************************************************************
54 |* Basisklasse fuer alle Funktionen
56 \************************************************************************/
58 class FuPoor
60 protected:
61 ScDrawView* pView;
62 ScTabViewShell* pViewShell;
63 Window* pWindow;
64 SdrModel* pDrDoc;
66 SfxRequest aSfxRequest;
67 Dialog* pDialog;
69 Timer aScrollTimer; // fuer Autoscrolling
70 DECL_LINK( ScrollHdl, Timer * );
71 void ForceScroll(const Point& aPixPos);
73 Timer aDragTimer; // fuer Drag&Drop
74 DECL_LINK( DragTimerHdl, Timer * );
75 DECL_LINK( DragHdl, void * );
76 BOOL bIsInDragMode;
77 Point aMDPos; // Position von MouseButtonDown
79 // #95491# member to hold state of the mouse buttons for creation
80 // of own MouseEvents (like in ScrollHdl)
81 private:
82 sal_uInt16 mnCode;
84 public:
85 FuPoor(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView,
86 SdrModel* pDoc, SfxRequest& rReq);
87 virtual ~FuPoor();
89 // #95491# see member
90 void SetMouseButtonCode(sal_uInt16 nNew) { if(nNew != mnCode) mnCode = nNew; }
91 sal_uInt16 GetMouseButtonCode() const { return mnCode; }
93 virtual void Paint(const Rectangle&, Window*) {}
95 virtual void DoCut();
96 virtual void DoCopy();
97 virtual void DoPaste();
99 // Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet
100 virtual BOOL KeyInput(const KeyEvent& rKEvt);
101 virtual BOOL MouseMove(const MouseEvent&) { return FALSE; }
103 // #95491# moved from inline to *.cxx
104 virtual BOOL MouseButtonUp(const MouseEvent& rMEvt); // { return FALSE; }
106 // #95491# moved from inline to *.cxx
107 virtual BOOL MouseButtonDown(const MouseEvent& rMEvt); // { return FALSE; }
109 virtual BYTE Command(const CommandEvent& rCEvt);
111 virtual void Activate(); // Function aktivieren
112 virtual void Deactivate(); // Function deaktivieren
114 virtual void ScrollStart() {} // diese Funktionen werden von
115 virtual void ScrollEnd() {} // ForceScroll aufgerufen
117 void SetWindow(Window* pWin) { pWindow = pWin; }
119 USHORT GetSlotID() const { return( aSfxRequest.GetSlot() ); }
121 BOOL IsDetectiveHit( const Point& rLogicPos );
123 void StopDragTimer();
125 // #98185# Create default drawing objects via keyboard
126 virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
128 protected:
129 void ImpForceQuadratic(Rectangle& rRect);
131 public:
132 // #i33136#
133 virtual bool doConstructOrthogonal() const;
138 #endif // _SD_FUPOOR_HXX