1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26
27 #include "DragMethod_Base.hxx"
28
29 #include "Strings.hrc"
30 #include "ResId.hxx"
31 #include "macros.hxx"
32 #include "ObjectNameProvider.hxx"
33 #include "ObjectIdentifier.hxx"
34 #include <rtl/math.hxx>
35 //header for class SdrPageView
36 #include <svx/svdpagv.hxx>
37 #include <svx/ActionDescriptionProvider.hxx>
38 #include <com/sun/star/beans/XPropertySet.hpp>
39
40 //.............................................................................
41 namespace chart
42 {
43 //.............................................................................
44
45 using namespace ::com::sun::star;
46 using ::com::sun::star::uno::Reference;
47 using ::com::sun::star::uno::WeakReference;
48
DragMethod_Base(DrawViewWrapper & rDrawViewWrapper,const rtl::OUString & rObjectCID,const Reference<frame::XModel> & xChartModel,ActionDescriptionProvider::ActionType eActionType)49 DragMethod_Base::DragMethod_Base( DrawViewWrapper& rDrawViewWrapper
50 , const rtl::OUString& rObjectCID
51 , const Reference< frame::XModel >& xChartModel
52 , ActionDescriptionProvider::ActionType eActionType )
53 : SdrDragMethod( rDrawViewWrapper )
54 , m_rDrawViewWrapper(rDrawViewWrapper)
55 , m_aObjectCID(rObjectCID)
56 , m_eActionType( eActionType )
57 , m_xChartModel( WeakReference< frame::XModel >(xChartModel) )
58 {
59 setMoveOnly(true);
60 }
~DragMethod_Base()61 DragMethod_Base::~DragMethod_Base()
62 {
63 }
64
getChartModel() const65 Reference< frame::XModel > DragMethod_Base::getChartModel() const
66 {
67 return Reference< frame::XModel >( m_xChartModel );;
68 }
69
getUndoDescription() const70 rtl::OUString DragMethod_Base::getUndoDescription() const
71 {
72 return ActionDescriptionProvider::createDescription(
73 m_eActionType,
74 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID )));
75 }
TakeSdrDragComment(String & rStr) const76 void DragMethod_Base::TakeSdrDragComment(String& rStr) const
77 {
78 rStr = String( getUndoDescription() );
79 }
GetSdrDragPointer() const80 Pointer DragMethod_Base::GetSdrDragPointer() const
81 {
82 if( IsDraggingPoints() || IsDraggingGluePoints() )
83 return Pointer(POINTER_MOVEPOINT);
84 else
85 return Pointer(POINTER_MOVE);
86 }
87 //.............................................................................
88 } //namespace chart
89 //.............................................................................
90