tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / controller / main / DragMethod_Base.cxx
blob5e46dc327b19ee3465d6b2021d0c23feb9aa70dd
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"
21 #include <DrawViewWrapper.hxx>
22 #include <ChartModel.hxx>
23 #include <ObjectNameProvider.hxx>
24 #include <ObjectIdentifier.hxx>
26 #include <svx/ActionDescriptionProvider.hxx>
27 #include <utility>
28 #include <vcl/ptrstyle.hxx>
30 namespace chart
33 using namespace ::com::sun::star;
35 DragMethod_Base::DragMethod_Base( DrawViewWrapper& rDrawViewWrapper
36 , OUString aObjectCID
37 , const rtl::Reference<::chart::ChartModel>& xChartModel
38 , ActionDescriptionProvider::ActionType eActionType )
39 : SdrDragMethod( rDrawViewWrapper )
40 , m_rDrawViewWrapper(rDrawViewWrapper)
41 , m_aObjectCID(std::move(aObjectCID))
42 , m_eActionType( eActionType )
43 , m_xChartModel( xChartModel.get() )
45 setMoveOnly(true);
47 DragMethod_Base::~DragMethod_Base()
51 rtl::Reference<::chart::ChartModel> DragMethod_Base::getChartModel() const
53 return m_xChartModel.get();
56 OUString DragMethod_Base::getUndoDescription() const
58 return ActionDescriptionProvider::createDescription(
59 m_eActionType,
60 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID )));
62 OUString DragMethod_Base::GetSdrDragComment() const
64 return getUndoDescription();
66 PointerStyle DragMethod_Base::GetSdrDragPointer() const
68 if( IsDraggingPoints() || IsDraggingGluePoints() )
69 return PointerStyle::MovePoint;
70 else
71 return PointerStyle::Move;
73 } //namespace chart
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */