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