xref: /aoo41x/main/sd/source/ui/inc/fusel.hxx (revision c45d927a)
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_SELECTION_HXX
25 #define SD_FU_SELECTION_HXX
26 
27 #include "fudraw.hxx"
28 
29 #include <com/sun/star/media/XPlayer.hpp>
30 
31 class SdrHdl;
32 class SdrObject;
33 class Sound;
34 
35 
36 namespace sd {
37 
38 class FuSelection
39     : public FuDraw
40 {
41 public:
42 	TYPEINFO();
43 
44 	static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
45 	virtual void DoExecute( SfxRequest& rReq );
46 
47 									   // Mouse- & Key-Events
48 	virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
49 	virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
50 	virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
51 	virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
52 
53 	virtual void Activate();		   // Function aktivieren
54 	virtual void Deactivate();		   // Function deaktivieren
55 
56 	virtual void SelectionHasChanged();
57 
58 	void    SetEditMode(sal_uInt16 nMode);
59 	sal_uInt16  GetEditMode() { return nEditMode; }
60 
61 	sal_Bool	AnimateObj(SdrObject* pObj, const Point& rPos);
62 
63 	/** is called when the currenct function should be aborted. <p>
64 		This is used when a function gets a KEY_ESCAPE but can also
65 		be called directly.
66 
67 		@returns true if a active function was aborted
68 	*/
69 	virtual bool cancel();
70 
71 protected:
72 	FuSelection (ViewShell* pViewSh,
73         ::sd::Window* pWin,
74         ::sd::View* pView,
75         SdDrawDocument* pDoc,
76         SfxRequest& rReq);
77 
78 	virtual ~FuSelection();
79 
80 	sal_Bool			bTempRotation;
81 	sal_Bool            bSelectionChanged;
82 	sal_Bool            bHideAndAnimate;
83 	SdrHdl*         pHdl;
84 	sal_Bool            bSuppressChangesOfSelection;
85 	sal_Bool            bMirrorSide0;
86 	sal_uInt16          nEditMode;
87         ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
88 
89 private:
90     /** This pointer stores a canidate for assigning a style in the water
91         can mode between mouse button down and mouse button up.
92     */
93     SdrObject* pWaterCanCandidate;
94 
95     /** Find the object under the given test point without selecting it.
96         @param rTestPoint
97             The coordinates at which to search for a shape.
98         @return
99             The shape at the test point.  When there is no shape at this
100             position then NULL is returned.
101     */
102     SdrObject* pickObject (const Point& rTestPoint);
103 };
104 
105 } // end of namespace sd
106 
107 #endif		// _SD_FUSEL_HXX
108 
109