1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "Strings.hrc"
25 #include "ObjectNameProvider.hxx"
26 #include "ObjectIdentifier.hxx"
28 #include <rtl/math.hxx>
29 #include <svx/svdpagv.hxx>
30 #include <svx/ActionDescriptionProvider.hxx>
31 #include <com/sun/star/beans/XPropertySet.hpp>
36 using namespace ::com::sun::star
;
37 using ::com::sun::star::uno::Reference
;
38 using ::com::sun::star::uno::WeakReference
;
40 DragMethod_Base::DragMethod_Base( DrawViewWrapper
& rDrawViewWrapper
41 , const OUString
& rObjectCID
42 , const Reference
< frame::XModel
>& xChartModel
43 , ActionDescriptionProvider::ActionType eActionType
)
44 : SdrDragMethod( rDrawViewWrapper
)
45 , m_rDrawViewWrapper(rDrawViewWrapper
)
46 , m_aObjectCID(rObjectCID
)
47 , m_eActionType( eActionType
)
48 , m_xChartModel( WeakReference
< frame::XModel
>(xChartModel
) )
52 DragMethod_Base::~DragMethod_Base()
56 Reference
< frame::XModel
> DragMethod_Base::getChartModel() const
58 return Reference
< frame::XModel
>( m_xChartModel
);
61 OUString
DragMethod_Base::getUndoDescription() const
63 return ActionDescriptionProvider::createDescription(
65 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID
)));
67 void DragMethod_Base::TakeSdrDragComment(OUString
& rStr
) const
69 rStr
= getUndoDescription();
71 Pointer
DragMethod_Base::GetSdrDragPointer() const
73 if( IsDraggingPoints() || IsDraggingGluePoints() )
74 return Pointer(PointerStyle::MovePoint
);
76 return Pointer(PointerStyle::Move
);
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */