xref: /trunk/main/sd/source/ui/inc/fuslsel.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_FU_SLIDE_SELECTION_HXX
29 #define SD_FU_SLIDE_SELECTION_HXX
30 
31 #include "fuslid.hxx"
32 #include <tools/list.hxx>
33 
34 class SdDrawDocument;
35 class Sound;
36 
37 namespace sd {
38 
39 class SlideView;
40 class SlideViewShell;
41 class Window;
42 
43 struct FSS_IsShowingEffectInfo
44 {
45     sal_Bool bIsShowingEffect;          // sal_True while we show a fade effect one the slide view
46     sal_Bool bDisposed;                 // sal_True if the FuSlideSelection was deleted during fade effect
47 };
48 
49 
50 class FuSlideSelection
51     : public FuSlide
52 {
53 public:
54     TYPEINFO();
55 
56     static FunctionReference Create( SlideViewShell* pViewSh, ::sd::Window* pWin, SlideView* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
57     virtual void DoExecute( SfxRequest& rReq );
58 
59     // Mouse- & Key-Events
60     virtual sal_Bool                KeyInput(const KeyEvent& rKEvt);
61     virtual sal_Bool                MouseMove(const MouseEvent& rMEvt);
62     virtual sal_Bool                MouseButtonUp(const MouseEvent& rMEvt);
63     virtual sal_Bool                MouseButtonDown(const MouseEvent& rMEvt);
64     virtual void                Paint(const Rectangle& rRect, ::sd::Window* pWin);
65 
66     virtual void                Activate();        // Function aktivieren
67     virtual void                Deactivate();          // Function deaktivieren
68 
69     virtual void                ScrollStart();
70     virtual void                ScrollEnd();
71 
72     sal_Bool                        IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
73 
74     /** is called when the currenct function should be aborted. <p>
75         This is used when a function gets a KEY_ESCAPE but can also
76         be called directly.
77 
78         @returns true if a active function was aborted
79     */
80     virtual bool cancel();
81 
82 protected:
83     FuSlideSelection (
84         SlideViewShell* pViewSh,
85         ::sd::Window* pWin,
86         SlideView* pView,
87         SdDrawDocument* pDoc,
88         SfxRequest& rReq);
89     virtual ~FuSlideSelection (void);
90 
91 private:
92     sal_Bool                        bSubstShown;
93     sal_Bool                        bPageHit;
94     List                        aSubstList;       // Liste mit Ertsatzdarstellungen
95     Point                       aDragPos;             // hier wird die Seite angefasst
96     sal_Bool                        bDragSelection;
97     Point                       aDragSelRectAnchor;  // fester Punkt des Selektionsrechtecks
98     Rectangle                   aDragSelRect;
99     Point                       aPosOfInsertMarker;
100     FSS_IsShowingEffectInfo*    pIsShowingEffectInfo;
101 
102     void                        DrawInsertMarker(sal_Bool bShow);
103     Point                       CalcPosOfInsertMarker(const Point& rPoint);
104 
105     sal_uInt16                      GetTargetPage(const Point& rPoint) const;
106 
107     void                        CreateSubst();
108     void                        DeleteSubst();
109     void                        DrawSubst() const;
110     void                        ChangeSubstPos(const Point& rVector);
111     void                        DrawDragSelectionRect() const;
112     void                        ShowEffect(sal_uInt16 nPageNo);
113 
114                                 DECL_LINK( DragSlideHdl, Timer* );
115 };
116 
117 } // end of namespace sd
118 
119 #endif
120 
121