xref: /aoo41x/main/sd/source/ui/inc/fudraw.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_FU_DRAW_HXX
29 #define SD_FU_DRAW_HXX
30 
31 #ifndef _SV_POINTR_HXX //autogen
32 #include <vcl/pointr.hxx>
33 #endif
34 #include "fupoor.hxx"
35 
36 struct SdrViewEvent;
37 class SdrObject;
38 
39 namespace sd {
40 
41 /*************************************************************************
42 |*
43 |* Basisklasse fuer alle Drawmodul-spezifischen Funktionen
44 |*
45 \************************************************************************/
46 
47 class FuDraw
48     : public FuPoor
49 {
50 public:
51 	TYPEINFO();
52 
53 	virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
54 	virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
55 	virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
56 	virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
57 	virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
58 
59 	virtual void ScrollStart();
60 	virtual void ScrollEnd();
61 
62 	virtual void Activate();
63 	virtual void Deactivate();
64 
65 	virtual void ForcePointer(const MouseEvent* pMEvt = NULL);
66 
67 	virtual void DoubleClick(const MouseEvent& rMEvt);
68 
69 	sal_Bool	SetPointer(SdrObject* pObj, const Point& rPos);
70 	sal_Bool    SetHelpText(SdrObject* pObj, const Point& rPos, const SdrViewEvent& rVEvt);
71 
72 	void    SetPermanent(sal_Bool bSet) { bPermanent = bSet; }
73 
74 	/** is called when the currenct function should be aborted. <p>
75 		This is used when a function gets a KEY_ESCAPE but can also
76 		be called directly.
77 
78 		@returns true if a active function was aborted
79 	*/
80 	virtual bool cancel();
81 
82 protected:
83 	FuDraw (ViewShell* pViewSh,
84         ::sd::Window* pWin,
85         ::sd::View* pView,
86         SdDrawDocument* pDoc,
87         SfxRequest& rReq);
88 
89 	virtual ~FuDraw();
90 
91 	Pointer aNewPointer;
92 	Pointer aOldPointer;
93 	sal_Bool	bMBDown;
94 	sal_Bool	bDragHelpLine;
95 	sal_uInt16	nHelpLine;
96 	sal_Bool    bPermanent;
97 
98 };
99 
100 } // end of namespace sd
101 
102 #endif		// _SD_FUDRAW_HXX
103