xref: /aoo4110/main/sd/source/ui/inc/fudraw.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_FU_DRAW_HXX
25 #define SD_FU_DRAW_HXX
26 
27 #ifndef _SV_POINTR_HXX //autogen
28 #include <vcl/pointr.hxx>
29 #endif
30 #include "fupoor.hxx"
31 
32 struct SdrViewEvent;
33 class SdrObject;
34 
35 namespace sd {
36 
37 /*************************************************************************
38 |*
39 |* Basisklasse fuer alle Drawmodul-spezifischen Funktionen
40 |*
41 \************************************************************************/
42 
43 class FuDraw
44     : public FuPoor
45 {
46 public:
47 	TYPEINFO();
48 
49 	virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
50 	virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
51 	virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
52 	virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
53 	virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
54 
55 	virtual void ScrollStart();
56 	virtual void ScrollEnd();
57 
58 	virtual void Activate();
59 	virtual void Deactivate();
60 
61 	virtual void ForcePointer(const MouseEvent* pMEvt = NULL);
62 
63 	virtual void DoubleClick(const MouseEvent& rMEvt);
64 
65 	sal_Bool	SetPointer(SdrObject* pObj, const Point& rPos);
66 	sal_Bool    SetHelpText(SdrObject* pObj, const Point& rPos, const SdrViewEvent& rVEvt);
67 
SetPermanent(sal_Bool bSet)68 	void    SetPermanent(sal_Bool bSet) { bPermanent = bSet; }
69 
70 	/** is called when the currenct function should be aborted. <p>
71 		This is used when a function gets a KEY_ESCAPE but can also
72 		be called directly.
73 
74 		@returns true if a active function was aborted
75 	*/
76 	virtual bool cancel();
77 
78 protected:
79 	FuDraw (ViewShell* pViewSh,
80         ::sd::Window* pWin,
81         ::sd::View* pView,
82         SdDrawDocument* pDoc,
83         SfxRequest& rReq);
84 
85 	virtual ~FuDraw();
86 
87 	Pointer aNewPointer;
88 	Pointer aOldPointer;
89 	sal_Bool	bMBDown;
90 	sal_Bool	bDragHelpLine;
91 	sal_uInt16	nHelpLine;
92 	sal_Bool    bPermanent;
93 
94 };
95 
96 } // end of namespace sd
97 
98 #endif		// _SD_FUDRAW_HXX
99