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 : #include "DragMethod_Base.hxx"
21 :
22 : #include "Strings.hrc"
23 : #include "ResId.hxx"
24 : #include "macros.hxx"
25 : #include "ObjectNameProvider.hxx"
26 : #include "ObjectIdentifier.hxx"
27 :
28 : #include <rtl/math.hxx>
29 : #include <svx/svdpagv.hxx>
30 : #include <svx/ActionDescriptionProvider.hxx>
31 : #include <com/sun/star/beans/XPropertySet.hpp>
32 :
33 : namespace chart
34 : {
35 :
36 : using namespace ::com::sun::star;
37 : using ::com::sun::star::uno::Reference;
38 : using ::com::sun::star::uno::WeakReference;
39 :
40 0 : 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 0 : , m_xChartModel( WeakReference< frame::XModel >(xChartModel) )
49 : {
50 0 : setMoveOnly(true);
51 0 : }
52 0 : DragMethod_Base::~DragMethod_Base()
53 : {
54 0 : }
55 :
56 0 : Reference< frame::XModel > DragMethod_Base::getChartModel() const
57 : {
58 0 : return Reference< frame::XModel >( m_xChartModel );
59 : }
60 :
61 0 : OUString DragMethod_Base::getUndoDescription() const
62 : {
63 : return ActionDescriptionProvider::createDescription(
64 : m_eActionType,
65 0 : ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID )));
66 : }
67 0 : void DragMethod_Base::TakeSdrDragComment(OUString& rStr) const
68 : {
69 0 : rStr = getUndoDescription();
70 0 : }
71 0 : Pointer DragMethod_Base::GetSdrDragPointer() const
72 : {
73 0 : if( IsDraggingPoints() || IsDraggingGluePoints() )
74 0 : return Pointer(PointerStyle::MovePoint);
75 : else
76 0 : return Pointer(PointerStyle::Move);
77 : }
78 57 : } //namespace chart
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|