1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DragMethod_Base.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
34 #include "DragMethod_Base.hxx"
36 #include "Strings.hrc"
39 #include "ObjectNameProvider.hxx"
40 #include "ObjectIdentifier.hxx"
41 #include <rtl/math.hxx>
42 //header for class SdrPageView
43 #include <svx/svdpagv.hxx>
44 #include <svx/ActionDescriptionProvider.hxx>
45 #include <com/sun/star/beans/XPropertySet.hpp>
47 //.............................................................................
50 //.............................................................................
52 using namespace ::com::sun::star
;
53 using ::com::sun::star::uno::Reference
;
54 using ::com::sun::star::uno::WeakReference
;
56 DragMethod_Base::DragMethod_Base( DrawViewWrapper
& rDrawViewWrapper
57 , const rtl::OUString
& rObjectCID
58 , const Reference
< frame::XModel
>& xChartModel
59 , ActionDescriptionProvider::ActionType eActionType
)
60 : SdrDragMethod( rDrawViewWrapper
)
61 , m_rDrawViewWrapper(rDrawViewWrapper
)
62 , m_aObjectCID(rObjectCID
)
63 , m_eActionType( eActionType
)
64 , m_xChartModel( WeakReference
< frame::XModel
>(xChartModel
) )
68 DragMethod_Base::~DragMethod_Base()
72 Reference
< frame::XModel
> DragMethod_Base::getChartModel() const
74 return Reference
< frame::XModel
>( m_xChartModel
);;
77 rtl::OUString
DragMethod_Base::getUndoDescription() const
79 return ActionDescriptionProvider::createDescription(
81 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aObjectCID
)));
83 void DragMethod_Base::TakeSdrDragComment(String
& rStr
) const
85 rStr
= String( getUndoDescription() );
87 Pointer
DragMethod_Base::GetSdrDragPointer() const
89 if( IsDraggingPoints() || IsDraggingGluePoints() )
90 return Pointer(POINTER_MOVEPOINT
);
92 return Pointer(POINTER_MOVE
);
94 //.............................................................................
96 //.............................................................................