LibreOffice Module sd (master) 1
motionpathtag.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <com/sun/star/util/XChangesListener.hpp>
24#include <smarttag.hxx>
26
27namespace com::sun::star::drawing { class XShape; }
28class SdrPathObj;
29
30namespace sd {
31
32class View;
33class CustomAnimationPane;
34
36class MotionPathTag final : public SmartTag, public IPolyPolygonEditorController, public SfxListener, public css::util::XChangesListener
37{
38public:
40 virtual ~MotionPathTag() override;
41
42 SdrPathObj* getPathObj() const { return mpPathObj.get(); }
43
45 virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& ) override;
46
48 virtual bool KeyInput( const KeyEvent& rKEvt ) override;
49
50 // callbacks from sdr view
51 virtual sal_Int32 GetMarkablePointCount() const override;
52 virtual sal_Int32 GetMarkedPointCount() const override;
53 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
54 virtual void CheckPossibilities() override;
55 virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
56
57 const CustomAnimationEffectPtr& getEffect() const { return mpEffect; }
58
59 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
60
61 // IPolyPolygonEditorController
62 virtual void DeleteMarkedPoints() override;
63 virtual bool IsDeleteMarkedPointsPossible() const override;
64
65 virtual void RipUpAtMarkedPoints() override;
66 virtual bool IsRipUpAtMarkedPointsPossible() const override;
67
68 virtual bool IsSetMarkedSegmentsKindPossible() const override;
69 virtual SdrPathSegmentKind GetMarkedSegmentsKind() const override;
70 virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override;
71
72 virtual bool IsSetMarkedPointsSmoothPossible() const override;
73 virtual SdrPathSmoothKind GetMarkedPointsSmooth() const override;
74 virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override;
75
76 virtual bool IsOpenCloseMarkedObjectsPossible() const override;
77 virtual SdrObjClosedKind GetMarkedObjectsClosedState() const override;
78
79 void MovePath( int nDX, int nDY );
80 bool OnDelete();
81 bool OnTabHandles( const KeyEvent& rKEvt );
82 bool OnMarkHandle( const KeyEvent& rKEvt );
83 bool OnMove( const KeyEvent& rKEvt );
84
85 // XChangesListener
86 virtual void SAL_CALL changesOccurred( const css::util::ChangesEvent& Event ) override;
87 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
88 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
89 virtual void SAL_CALL acquire( ) noexcept override;
90 virtual void SAL_CALL release( ) noexcept override;
91
92private:
93 virtual void addCustomHandles( SdrHdlList& rHandlerList ) override;
94 virtual bool getContext( SdrViewContext& rContext ) override;
95 virtual void disposing() override;
96 virtual void deselect() override;
97
99 void selectionChanged();
100
103 ::basegfx::B2DPolyPolygon mxPolyPoly;
104 css::uno::Reference< css::drawing::XShape > mxOrigin;
107 std::unique_ptr<SdrMark> mpMark;
108 OUString msLastPath;
110};
111
112} // end of namespace sd
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for all functions.
virtual bool MarkPoints(const ::tools::Rectangle *pRect, bool bUnmark) override
virtual void DeleteMarkedPoints() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
SdrPathObj * getPathObj() const
CustomAnimationPane & mrPane
virtual bool IsSetMarkedPointsSmoothPossible() const override
virtual bool KeyInput(const KeyEvent &rKEvt) override
returns true if the SmartTag consumes this event.
virtual void RipUpAtMarkedPoints() override
virtual ~MotionPathTag() override
CustomAnimationEffectPtr mpEffect
virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent &Event) override
bool OnTabHandles(const KeyEvent &rKEvt)
::basegfx::B2DPolyPolygon mxPolyPoly
virtual SdrObjClosedKind GetMarkedObjectsClosedState() const override
virtual SdrPathSegmentKind GetMarkedSegmentsKind() const override
virtual void addCustomHandles(SdrHdlList &rHandlerList) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
rtl::Reference< SdrPathObj > mpPathObj
virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override
virtual bool IsOpenCloseMarkedObjectsPossible() const override
css::uno::Reference< css::drawing::XShape > mxOrigin
bool OnMove(const KeyEvent &rKEvt)
virtual void SAL_CALL release() noexcept override
virtual sal_Int32 GetMarkedPointCount() const override
virtual SdrPathSmoothKind GetMarkedPointsSmooth() const override
css::awt::Point maOriginPos
bool OnMarkHandle(const KeyEvent &rKEvt)
virtual bool IsDeleteMarkedPointsPossible() const override
virtual sal_Int32 GetMarkablePointCount() const override
virtual bool MouseButtonDown(const MouseEvent &, SmartHdl &) override
returns true if the MotionPathTag handled the event.
virtual bool IsRipUpAtMarkedPointsPossible() const override
virtual bool IsSetMarkedSegmentsKindPossible() const override
MotionPathTag(CustomAnimationPane &rPane, ::sd::View &rView, const CustomAnimationEffectPtr &pEffect)
virtual void SAL_CALL acquire() noexcept override
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark) override
virtual void disposing() override
virtual void deselect() override
virtual void CheckPossibilities() override
virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override
const CustomAnimationEffectPtr & getEffect() const
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual bool getContext(SdrViewContext &rContext) override
std::unique_ptr< SdrMark > mpMark
void MovePath(int nDX, int nDY)
a derivation from this handle is the visual representation for a smart tag.
Definition: smarttag.hxx:157
a smart tag represents a visual user interface element on the documents edit view that is not part of...
Definition: smarttag.hxx:44
SdrPathSmoothKind
SdrObjClosedKind
SdrPathSegmentKind
std::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr
SdrViewContext