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 : namespace sd {
31 :
32 : class FuSelection
33 : : public FuDraw
34 : {
35 : public:
36 : TYPEINFO_OVERRIDE();
37 :
38 : static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
39 : virtual void DoExecute( SfxRequest& rReq ) SAL_OVERRIDE;
40 :
41 : // Mouse- & Key-Events
42 : virtual bool KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
43 : virtual bool MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
44 : virtual bool MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
45 : virtual bool MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
46 :
47 : virtual void Activate() SAL_OVERRIDE;
48 : virtual void Deactivate() SAL_OVERRIDE;
49 :
50 : virtual void SelectionHasChanged() SAL_OVERRIDE;
51 :
52 : void SetEditMode(sal_uInt16 nMode);
53 0 : sal_uInt16 GetEditMode() { return nEditMode; }
54 :
55 : bool AnimateObj(SdrObject* pObj, const Point& rPos);
56 :
57 : /** is called when the current function should be aborted. <p>
58 : This is used when a function gets a KEY_ESCAPE but can also
59 : be called directly.
60 :
61 : @returns true if a active function was aborted
62 : */
63 : virtual bool cancel() SAL_OVERRIDE;
64 :
65 : //let mouse cursor move
66 : virtual void ForcePointer(const MouseEvent* pMEvt = NULL) SAL_OVERRIDE;
67 : protected:
68 : FuSelection (ViewShell* pViewSh,
69 : ::sd::Window* pWin,
70 : ::sd::View* pView,
71 : SdDrawDocument* pDoc,
72 : SfxRequest& rReq);
73 :
74 : virtual ~FuSelection();
75 :
76 : bool bTempRotation;
77 : bool bSelectionChanged;
78 : bool bHideAndAnimate;
79 : SdrHdl* pHdl;
80 : bool bSuppressChangesOfSelection;
81 : bool bMirrorSide0;
82 : sal_uInt16 nEditMode;
83 : ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
84 :
85 : private:
86 : /** This pointer stores a canidate for assigning a style in the water
87 : can mode between mouse button down and mouse button up.
88 : */
89 : SdrObject* pWaterCanCandidate;
90 :
91 : /** Find the object under the given test point without selecting it.
92 : @param rTestPoint
93 : The coordinates at which to search for a shape.
94 : @return
95 : The shape at the test point. When there is no shape at this
96 : position then NULL is returned.
97 : */
98 : SdrObject* pickObject (const Point& rTestPoint);
99 : //Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point,
100 : //and SHIFT+ENTER key to decide the position and draw the new insert point
101 : bool bBeginInsertPoint;
102 : Point oldPoint;
103 : //let mouse cursor move
104 : bool bMovedToCenterPoint;
105 : };
106 :
107 : } // end of namespace sd
108 :
109 : #endif // _SD_FUSEL_HXX
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|