xref: /trunk/main/sd/source/ui/inc/fuslsel.hxx (revision 67e470da)
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_SLIDE_SELECTION_HXX
25 #define SD_FU_SLIDE_SELECTION_HXX
26 
27 #include "fuslid.hxx"
28 #include <tools/list.hxx>
29 
30 class SdDrawDocument;
31 class Sound;
32 
33 namespace sd {
34 
35 class SlideView;
36 class SlideViewShell;
37 class Window;
38 
39 struct FSS_IsShowingEffectInfo
40 {
41 	sal_Bool bIsShowingEffect;			// sal_True while we show a fade effect one the slide view
42 	sal_Bool bDisposed;					// sal_True if the FuSlideSelection was deleted during fade effect
43 };
44 
45 
46 class FuSlideSelection
47     : public FuSlide
48 {
49 public:
50     TYPEINFO();
51 
52 	static FunctionReference Create( SlideViewShell* pViewSh, ::sd::Window* pWin, SlideView* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
53 	virtual void DoExecute( SfxRequest& rReq );
54 
55 	// Mouse- & Key-Events
56 	virtual sal_Bool                KeyInput(const KeyEvent& rKEvt);
57 	virtual sal_Bool                MouseMove(const MouseEvent& rMEvt);
58 	virtual sal_Bool                MouseButtonUp(const MouseEvent& rMEvt);
59 	virtual sal_Bool                MouseButtonDown(const MouseEvent& rMEvt);
60 	virtual void                Paint(const Rectangle& rRect, ::sd::Window* pWin);
61 
62 	virtual void                Activate();		   // Function aktivieren
63 	virtual void                Deactivate();		   // Function deaktivieren
64 
65 	virtual void                ScrollStart();
66 	virtual void                ScrollEnd();
67 
IsShowingEffect() const68 	sal_Bool                        IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
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     FuSlideSelection (
80         SlideViewShell* pViewSh,
81         ::sd::Window* pWin,
82         SlideView* pView,
83         SdDrawDocument* pDoc,
84         SfxRequest& rReq);
85     virtual ~FuSlideSelection (void);
86 
87 private:
88 	sal_Bool		                bSubstShown;
89 	sal_Bool		                bPageHit;
90 	List		                aSubstList;		  // Liste mit Ertsatzdarstellungen
91 	Point		                aDragPos;			  // hier wird die Seite angefasst
92 	sal_Bool		                bDragSelection;
93 	Point		                aDragSelRectAnchor;  // fester Punkt des Selektionsrechtecks
94 	Rectangle	                aDragSelRect;
95 	Point		                aPosOfInsertMarker;
96 	FSS_IsShowingEffectInfo*	pIsShowingEffectInfo;
97 
98 	void                        DrawInsertMarker(sal_Bool bShow);
99 	Point                       CalcPosOfInsertMarker(const Point& rPoint);
100 
101 	sal_uInt16                      GetTargetPage(const Point& rPoint) const;
102 
103 	void                        CreateSubst();
104 	void                        DeleteSubst();
105 	void                        DrawSubst() const;
106 	void                        ChangeSubstPos(const Point& rVector);
107 	void                        DrawDragSelectionRect() const;
108 	void                        ShowEffect(sal_uInt16 nPageNo);
109 
110 	                            DECL_LINK( DragSlideHdl, Timer* );
111 };
112 
113 } // end of namespace sd
114 
115 #endif
116 
117