Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / chart2 / source / controller / main / DragMethod_Base.cxx
blob1739833ed94b86ba9171a24b93f6910be1178935
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "DragMethod_Base.hxx"
22 #include <ObjectNameProvider.hxx>
23 #include <ObjectIdentifier.hxx>
25 #include <rtl/math.hxx>
26 #include <svx/svdpagv.hxx>
27 #include <svx/ActionDescriptionProvider.hxx>
28 #include <com/sun/star/beans/XPropertySet.hpp>
30 namespace chart
33 using namespace ::com::sun::star;
34 using ::com::sun::star::uno::Reference;
35 using ::com::sun::star::uno::WeakReference;
37 DragMethod_Base::DragMethod_Base( DrawViewWrapper& rDrawViewWrapper
38 , const OUString& rObjectCID
39 , const Reference< frame::XModel >& xChartModel
40 , ActionDescriptionProvider::ActionType eActionType )
41 : SdrDragMethod( rDrawViewWrapper )
42 , m_rDrawViewWrapper(rDrawViewWrapper)
43 , m_aObjectCID(rObjectCID)
44 , m_eActionType( eActionType )
45 , m_xChartModel( WeakReference< frame::XModel >(xChartModel) )
47 setMoveOnly(true);
49 DragMethod_Base::~DragMethod_Base()
53 Reference< frame::XModel > DragMethod_Base::getChartModel() const
55 return Reference< frame::XModel >( m_xChartModel );
58 OUString DragMethod_Base::getUndoDescription() const
60 return ActionDescriptionProvider::createDescription(
61 m_eActionType,
62 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID )));
64 void DragMethod_Base::TakeSdrDragComment(OUString& rStr) const
66 rStr = getUndoDescription();
68 Pointer DragMethod_Base::GetSdrDragPointer() const
70 if( IsDraggingPoints() || IsDraggingGluePoints() )
71 return Pointer(PointerStyle::MovePoint);
72 else
73 return Pointer(PointerStyle::Move);
75 } //namespace chart
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */