xref: /aoo42x/main/sd/source/ui/inc/fusel.hxx (revision 2bf67293)
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);
GetEditMode()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 	//Solution: let mouse cursor move
72 	virtual void ForcePointer(const MouseEvent* pMEvt = NULL);
73 protected:
74 	FuSelection (ViewShell* pViewSh,
75         ::sd::Window* pWin,
76         ::sd::View* pView,
77         SdDrawDocument* pDoc,
78         SfxRequest& rReq);
79 
80 	virtual ~FuSelection();
81 
82 	sal_Bool			bTempRotation;
83 	sal_Bool            bSelectionChanged;
84 	sal_Bool            bHideAndAnimate;
85 	SdrHdl*         pHdl;
86 	sal_Bool            bSuppressChangesOfSelection;
87 	sal_Bool            bMirrorSide0;
88 	sal_uInt16          nEditMode;
89         ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
90 
91 private:
92     /** This pointer stores a candidate for assigning a style in the water
93         can mode between mouse button down and mouse button up.
94     */
95     SdrObject* pWaterCanCandidate;
96 
97     /** Find the object under the given test point without selecting it.
98         @param rTestPoint
99             The coordinates at which to search for a shape.
100         @return
101             The shape at the test point.  When there is no shape at this
102             position then NULL is returned.
103     */
104     SdrObject* pickObject (const Point& rTestPoint);
105   //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point,
106   //and SHIFT+ENTER key to decide the position and draw the new insert point
107     sal_Bool   bBeginInsertPoint;
108     Point    oldPoint;
109   //Solution: let mouse cursor move
110   sal_Bool   bMovedToCenterPoint;
111 };
112 
113 } // end of namespace sd
114 
115 #endif		// _SD_FUSEL_HXX
116 
117