Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SD_SOURCE_UI_INC_FUSEL_HXX
21 : #define INCLUDED_SD_SOURCE_UI_INC_FUSEL_HXX
22 :
23 : #include "fudraw.hxx"
24 :
25 : #include <com/sun/star/media/XPlayer.hpp>
26 :
27 : class SdrHdl;
28 : class SdrObject;
29 :
30 :
31 : namespace sd {
32 :
33 : class FuSelection
34 : : public FuDraw
35 : {
36 : public:
37 : TYPEINFO_OVERRIDE();
38 :
39 : static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
40 : virtual void DoExecute( SfxRequest& rReq ) SAL_OVERRIDE;
41 :
42 : // Mouse- & Key-Events
43 : virtual sal_Bool KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
44 : virtual sal_Bool MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
45 : virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
46 : virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
47 :
48 : virtual void Activate() SAL_OVERRIDE;
49 : virtual void Deactivate() SAL_OVERRIDE;
50 :
51 : virtual void SelectionHasChanged() SAL_OVERRIDE;
52 :
53 : void SetEditMode(sal_uInt16 nMode);
54 0 : sal_uInt16 GetEditMode() { return nEditMode; }
55 :
56 : sal_Bool AnimateObj(SdrObject* pObj, const Point& rPos);
57 :
58 : /** is called when the current function should be aborted. <p>
59 : This is used when a function gets a KEY_ESCAPE but can also
60 : be called directly.
61 :
62 : @returns true if a active function was aborted
63 : */
64 : virtual bool cancel() SAL_OVERRIDE;
65 :
66 : //let mouse cursor move
67 : virtual void ForcePointer(const MouseEvent* pMEvt = NULL) SAL_OVERRIDE;
68 : protected:
69 : FuSelection (ViewShell* pViewSh,
70 : ::sd::Window* pWin,
71 : ::sd::View* pView,
72 : SdDrawDocument* pDoc,
73 : SfxRequest& rReq);
74 :
75 : virtual ~FuSelection();
76 :
77 : sal_Bool bTempRotation;
78 : sal_Bool bSelectionChanged;
79 : sal_Bool bHideAndAnimate;
80 : SdrHdl* pHdl;
81 : sal_Bool bSuppressChangesOfSelection;
82 : sal_Bool bMirrorSide0;
83 : sal_uInt16 nEditMode;
84 : ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
85 :
86 : private:
87 : /** This pointer stores a canidate for assigning a style in the water
88 : can mode between mouse button down and mouse button up.
89 : */
90 : SdrObject* pWaterCanCandidate;
91 :
92 : /** Find the object under the given test point without selecting it.
93 : @param rTestPoint
94 : The coordinates at which to search for a shape.
95 : @return
96 : The shape at the test point. When there is no shape at this
97 : position then NULL is returned.
98 : */
99 : SdrObject* pickObject (const Point& rTestPoint);
100 : //Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point,
101 : //and SHIFT+ENTER key to decide the postion and draw the new insert point
102 : sal_Bool bBeginInsertPoint;
103 : Point oldPoint;
104 : //let mouse cursor move
105 : sal_Bool bMovedToCenterPoint;
106 : };
107 :
108 : } // end of namespace sd
109 :
110 : #endif // _SD_FUSEL_HXX
111 :
112 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|