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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_CHARTCONTROLLER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_CHARTCONTROLLER_HXX
22 #include "LifeTime.hxx"
23 #include "CommandDispatchContainer.hxx"
24 #include "SelectionHelper.hxx"
26 #include <svx/svdtypes.hxx>
27 #include <vcl/timer.hxx>
28 #include <vcl/event.hxx>
30 #include <cppuhelper/implbase12.hxx>
32 #include <com/sun/star/accessibility/XAccessible.hpp>
33 #include <com/sun/star/document/XUndoManager.hpp>
34 #include <com/sun/star/frame/XController.hpp>
35 #include <com/sun/star/frame/XDispatchProvider.hpp>
36 #include <com/sun/star/frame/XDispatch.hpp>
37 #include <com/sun/star/view/XSelectionSupplier.hpp>
38 #include <com/sun/star/ui/XContextMenuInterception.hpp>
39 #include <com/sun/star/uno/XWeak.hpp>
40 #include <com/sun/star/util/XCloseListener.hpp>
41 #include <com/sun/star/util/XCloseable.hpp>
42 #include <com/sun/star/lang/XInitialization.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/uno/XComponentContext.hpp>
45 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
46 #include <com/sun/star/util/XModifyListener.hpp>
47 #include <com/sun/star/util/XModeChangeListener.hpp>
48 #include <com/sun/star/awt/Point.hpp>
49 #include <com/sun/star/awt/Size.hpp>
50 #include <com/sun/star/util/XURLTransformer.hpp>
51 #include <com/sun/star/frame/XLayoutManagerListener.hpp>
52 #include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
55 #include <boost/shared_ptr.hpp>
62 class AcceleratorExecute
;
65 class DropTargetHelper
;
67 namespace com
{ namespace sun
{ namespace star
{
78 enum ChartDrawMode
{ CHARTDRAW_INSERT
, CHARTDRAW_SELECT
};
80 class WindowController
83 virtual ~WindowController() {};
85 virtual void PrePaint(vcl::RenderContext
& rRenderContext
) = 0;
86 virtual void execute_Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) = 0;
87 virtual void execute_MouseButtonDown( const MouseEvent
& rMEvt
) = 0;
88 virtual void execute_MouseMove( const MouseEvent
& rMEvt
) = 0;
89 virtual void execute_Tracking( const TrackingEvent
& rTEvt
) = 0;
90 virtual void execute_MouseButtonUp( const MouseEvent
& rMEvt
) = 0;
91 virtual void execute_Resize() = 0;
92 virtual void execute_Activate() = 0;
93 virtual void execute_Deactivate() = 0;
94 virtual void execute_GetFocus() = 0;
95 virtual void execute_LoseFocus() = 0;
96 virtual void execute_Command( const CommandEvent
& rCEvt
) = 0;
97 virtual bool execute_KeyInput( const KeyEvent
& rKEvt
) = 0;
99 /** get help text to be shown in a quick help
101 @param aAtLogicPosition the position in logic coordinates (of the
102 window) of the mouse cursor to determine for
103 which object help is requested.
105 @param bIsBalloonHelp determines whether to return the long text version
106 (balloon help) or the shorter one (quick help).
108 @param rOutQuickHelpText is filled with the quick help text
110 @param rOutEqualRect is filled with a rectangle that denotes the region
111 in which the quick help does not change.
113 @return </sal_True>, if a quick help should be shown.
115 virtual bool requestQuickHelp(
116 ::Point aAtLogicPosition
, bool bIsBalloonHelp
,
117 OUString
& rOutQuickHelpText
, ::com::sun::star::awt::Rectangle
& rOutEqualRect
) = 0;
119 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible() = 0;
123 class DrawModelWrapper
;
124 class DrawViewWrapper
;
125 class ReferenceSizeProvider
;
127 class ChartController
: public ::cppu::WeakImplHelper12
<
128 ::com::sun::star::frame::XController
//comprehends XComponent (required interface)
129 ,::com::sun::star::frame::XDispatchProvider
//(required interface)
130 ,::com::sun::star::view::XSelectionSupplier
//(optional interface)
131 ,::com::sun::star::ui::XContextMenuInterception
//(optional interface)
132 ,::com::sun::star::util::XCloseListener
//(needed for communication with XModel)
133 ,::com::sun::star::lang::XServiceInfo
134 ,::com::sun::star::frame::XDispatch
135 ,::com::sun::star::awt::XWindow
//this is the Window Controller part of this Controller, that will be given to a Frame via setComponent
136 ,::com::sun::star::lang::XMultiServiceFactory
137 ,::com::sun::star::util::XModifyListener
138 ,::com::sun::star::util::XModeChangeListener
139 ,::com::sun::star::frame::XLayoutManagerListener
141 , public WindowController
143 friend class DrawCommandDispatch
;
144 friend class ShapeController
;
147 //no default constructor
148 ChartController(::com::sun::star::uno::Reference
<
149 ::com::sun::star::uno::XComponentContext
> const & xContext
);
150 virtual ~ChartController();
152 // ::com::sun::star::lang::XServiceInfo
153 virtual OUString SAL_CALL
getImplementationName()
154 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
155 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
156 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
157 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
158 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
160 static OUString
getImplementationName_Static();
161 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
162 static css::uno::Reference
< css::uno::XInterface
> SAL_CALL
create( css::uno::Reference
< css::uno::XComponentContext
> const & xContext
)
163 throw(css::uno::Exception
)
165 return (::cppu::OWeakObject
*)new ChartController( xContext
);
168 // ::com::sun::star::frame::XController (required interface)
169 virtual void SAL_CALL
170 attachFrame( const ::com::sun::star::uno::Reference
<
171 ::com::sun::star::frame::XFrame
> & xFrame
)
172 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
174 virtual sal_Bool SAL_CALL
175 attachModel( const ::com::sun::star::uno::Reference
<
176 ::com::sun::star::frame::XModel
> & xModel
)
177 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SAL_CALL
180 getFrame() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
182 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> SAL_CALL
183 getModel() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
185 virtual ::com::sun::star::uno::Any SAL_CALL
186 getViewData() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
188 virtual void SAL_CALL
189 restoreViewData( const ::com::sun::star::uno::Any
& rValue
)
190 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
192 virtual sal_Bool SAL_CALL
193 suspend( sal_Bool bSuspend
)
194 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
196 // ::com::sun::star::lang::XComponent (base of XController)
197 virtual void SAL_CALL
198 dispose() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
200 virtual void SAL_CALL
201 addEventListener( const ::com::sun::star::uno::Reference
<
202 ::com::sun::star::lang::XEventListener
> & xListener
)
203 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
205 virtual void SAL_CALL
206 removeEventListener( const ::com::sun::star::uno::Reference
<
207 ::com::sun::star::lang::XEventListener
> & xListener
)
208 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
210 // ::com::sun::star::frame::XDispatchProvider (required interface)
211 virtual ::com::sun::star::uno::Reference
<
212 ::com::sun::star::frame::XDispatch
> SAL_CALL
213 queryDispatch( const ::com::sun::star::util::URL
& rURL
214 , const OUString
& rTargetFrameName
215 , sal_Int32 nSearchFlags
)
216 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
218 virtual ::com::sun::star::uno::Sequence
<
219 ::com::sun::star::uno::Reference
<
220 ::com::sun::star::frame::XDispatch
> > SAL_CALL
221 queryDispatches( const ::com::sun::star::uno::Sequence
<
222 ::com::sun::star::frame::DispatchDescriptor
> & xDescripts
)
223 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
225 // ::com::sun::star::view::XSelectionSupplier (optional interface)
226 virtual sal_Bool SAL_CALL
227 select( const ::com::sun::star::uno::Any
& rSelection
)
228 throw (css::lang::IllegalArgumentException
,
229 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
231 virtual ::com::sun::star::uno::Any SAL_CALL
232 getSelection() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
234 virtual void SAL_CALL
235 addSelectionChangeListener( const ::com::sun::star::uno::Reference
<
236 com::sun::star::view::XSelectionChangeListener
> & xListener
)
237 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
239 virtual void SAL_CALL
240 removeSelectionChangeListener( const ::com::sun::star::uno::Reference
<
241 com::sun::star::view::XSelectionChangeListener
> & xListener
)
242 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
244 // ::com::sun::star::ui::XContextMenuInterception (optional interface)
245 virtual void SAL_CALL
246 registerContextMenuInterceptor( const ::com::sun::star::uno::Reference
<
247 ::com::sun::star::ui::XContextMenuInterceptor
> & xInterceptor
)
248 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
250 virtual void SAL_CALL
251 releaseContextMenuInterceptor( const ::com::sun::star::uno::Reference
<
252 ::com::sun::star::ui::XContextMenuInterceptor
> & xInterceptor
)
253 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
255 //additional interfaces
257 // ::com::sun::star::util::XCloseListener
258 virtual void SAL_CALL
259 queryClosing( const ::com::sun::star::lang::EventObject
& Source
260 , sal_Bool GetsOwnership
)
261 throw (::com::sun::star::util::CloseVetoException
262 , ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
264 virtual void SAL_CALL
265 notifyClosing( const ::com::sun::star::lang::EventObject
& Source
)
266 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
268 // ::com::sun::star::util::XEventListener (base of XCloseListener and XModifyListener)
269 virtual void SAL_CALL
270 disposing( const ::com::sun::star::lang::EventObject
& Source
)
271 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
273 // ::com::sun::star::frame::XDispatch
275 virtual void SAL_CALL
276 dispatch( const ::com::sun::star::util::URL
& aURL
277 , const ::com::sun::star::uno::Sequence
<
278 ::com::sun::star::beans::PropertyValue
>& aArgs
)
279 throw (::com::sun::star::uno::RuntimeException
,
280 std::exception
) SAL_OVERRIDE
;
282 virtual void SAL_CALL
283 addStatusListener( const ::com::sun::star::uno::Reference
<
284 ::com::sun::star::frame::XStatusListener
>& xControl
285 , const ::com::sun::star::util::URL
& aURL
)
286 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
288 virtual void SAL_CALL
289 removeStatusListener( const ::com::sun::star::uno::Reference
<
290 ::com::sun::star::frame::XStatusListener
>& xControl
291 , const ::com::sun::star::util::URL
& aURL
)
292 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
294 // ::com::sun::star::awt::XWindow
295 virtual void SAL_CALL
296 setPosSize( sal_Int32 X
, sal_Int32 Y
297 , sal_Int32 Width
, sal_Int32 Height
, sal_Int16 Flags
)
298 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
300 virtual ::com::sun::star::awt::Rectangle SAL_CALL
302 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
304 virtual void SAL_CALL
305 setVisible( sal_Bool Visible
)
306 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
308 virtual void SAL_CALL
309 setEnable( sal_Bool Enable
)
310 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
312 virtual void SAL_CALL
313 setFocus() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
315 virtual void SAL_CALL
316 addWindowListener( const ::com::sun::star::uno::Reference
<
317 ::com::sun::star::awt::XWindowListener
>& xListener
)
318 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
320 virtual void SAL_CALL
321 removeWindowListener( const ::com::sun::star::uno::Reference
<
322 ::com::sun::star::awt::XWindowListener
>& xListener
)
323 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
325 virtual void SAL_CALL
326 addFocusListener( const ::com::sun::star::uno::Reference
<
327 ::com::sun::star::awt::XFocusListener
>& xListener
)
328 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
330 virtual void SAL_CALL
331 removeFocusListener( const ::com::sun::star::uno::Reference
<
332 ::com::sun::star::awt::XFocusListener
>& xListener
)
333 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
335 virtual void SAL_CALL
336 addKeyListener( const ::com::sun::star::uno::Reference
<
337 ::com::sun::star::awt::XKeyListener
>& xListener
)
338 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
340 virtual void SAL_CALL
341 removeKeyListener( const ::com::sun::star::uno::Reference
<
342 ::com::sun::star::awt::XKeyListener
>& xListener
)
343 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
345 virtual void SAL_CALL
346 addMouseListener( const ::com::sun::star::uno::Reference
<
347 ::com::sun::star::awt::XMouseListener
>& xListener
)
348 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
350 virtual void SAL_CALL
351 removeMouseListener( const ::com::sun::star::uno::Reference
<
352 ::com::sun::star::awt::XMouseListener
>& xListener
)
353 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
355 virtual void SAL_CALL
356 addMouseMotionListener( const ::com::sun::star::uno::Reference
<
357 ::com::sun::star::awt::XMouseMotionListener
>& xListener
)
358 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
360 virtual void SAL_CALL
361 removeMouseMotionListener( const ::com::sun::star::uno::Reference
<
362 ::com::sun::star::awt::XMouseMotionListener
>& xListener
)
363 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
365 virtual void SAL_CALL
366 addPaintListener( const ::com::sun::star::uno::Reference
<
367 ::com::sun::star::awt::XPaintListener
>& xListener
)
368 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
370 virtual void SAL_CALL
371 removePaintListener( const ::com::sun::star::uno::Reference
<
372 ::com::sun::star::awt::XPaintListener
>& xListener
)
373 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
375 // ::com::sun::star::lang XMultiServiceFactory
376 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
377 createInstance( const OUString
& aServiceSpecifier
)
378 throw (::com::sun::star::uno::Exception
,
379 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
380 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
381 createInstanceWithArguments( const OUString
& ServiceSpecifier
,
382 const ::com::sun::star::uno::Sequence
<
383 ::com::sun::star::uno::Any
>& Arguments
)
384 throw (::com::sun::star::uno::Exception
,
385 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
386 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
387 getAvailableServiceNames()
388 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
390 // ::com::sun::star::util::XModifyListener
391 virtual void SAL_CALL
modified(
392 const ::com::sun::star::lang::EventObject
& aEvent
)
393 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
395 // ::com::sun::star::util::XModeChangeListener
396 virtual void SAL_CALL
modeChanged(
397 const ::com::sun::star::util::ModeChangeEvent
& _rSource
)
398 throw (::com::sun::star::uno::RuntimeException
,
399 std::exception
) SAL_OVERRIDE
;
401 // ::com::sun::star::frame::XLayoutManagerListener
402 virtual void SAL_CALL
layoutEvent(
403 const ::com::sun::star::lang::EventObject
& aSource
,
404 ::sal_Int16 eLayoutEvent
,
405 const ::com::sun::star::uno::Any
& aInfo
)
406 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
408 // chart2::WindowController
409 virtual void PrePaint(vcl::RenderContext
& rRenderContext
) SAL_OVERRIDE
;
410 virtual void execute_Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) SAL_OVERRIDE
;
411 virtual void execute_MouseButtonDown( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
412 virtual void execute_MouseMove( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
413 virtual void execute_Tracking( const TrackingEvent
& rTEvt
) SAL_OVERRIDE
;
414 virtual void execute_MouseButtonUp( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
415 virtual void execute_Resize() SAL_OVERRIDE
;
416 virtual void execute_Activate() SAL_OVERRIDE
;
417 virtual void execute_Deactivate() SAL_OVERRIDE
;
418 virtual void execute_GetFocus() SAL_OVERRIDE
;
419 virtual void execute_LoseFocus() SAL_OVERRIDE
;
420 virtual void execute_Command( const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
421 virtual bool execute_KeyInput( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
423 virtual bool requestQuickHelp(
424 ::Point aAtLogicPosition
, bool bIsBalloonHelp
,
425 OUString
& rOutQuickHelpText
, ::com::sun::star::awt::Rectangle
& rOutEqualRect
) SAL_OVERRIDE
;
427 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible() SAL_OVERRIDE
;
429 static bool isObjectDeleteable( const ::com::sun::star::uno::Any
& rSelection
);
431 void setDrawMode( ChartDrawMode eMode
) { m_eDrawMode
= eMode
; }
432 ChartDrawMode
getDrawMode() const { return m_eDrawMode
; }
434 bool isShapeContext() const;
436 DECL_LINK( NotifyUndoActionHdl
, SdrUndoAction
* );
442 DrawModelWrapper
* GetDrawModelWrapper();
443 DrawViewWrapper
* GetDrawViewWrapper();
447 friend class ChartController::TheModelRef
;
452 virtual ~RefCountable();
456 sal_Int32 m_nRefCount
;
458 class TheModel
: public RefCountable
461 TheModel( const ::com::sun::star::uno::Reference
<
462 ::com::sun::star::frame::XModel
> & xModel
);
466 void SetOwnership( bool bGetsOwnership
);
467 void addListener( ChartController
* pController
);
468 void removeListener( ChartController
* pController
);
469 void tryTermination();
470 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>
471 getModel() const { return m_xModel
;}
474 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> m_xModel
;
475 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseable
> m_xCloseable
;
477 //the ownership between model and controller is not clear at first
478 //each controller might consider himself as owner of the model first
484 TheModelRef( TheModel
* pTheModel
, ::osl::Mutex
& rMutex
);
485 TheModelRef( const TheModelRef
& rTheModel
, ::osl::Mutex
& rMutex
);
486 TheModelRef
& operator=(ChartController::TheModel
* pTheModel
);
487 TheModelRef
& operator=(const TheModelRef
& rTheModel
);
488 virtual ~TheModelRef();
490 TheModel
* operator->() const { return m_pTheModel
; }
492 TheModel
* m_pTheModel
;
493 ::osl::Mutex
& m_rModelMutex
;
497 mutable ::apphelper::LifeTimeManager m_aLifeTimeManager
;
499 mutable ::osl::Mutex m_aControllerMutex
;
503 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xCC
;
506 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
507 mutable ::osl::Mutex m_aModelMutex
;
508 TheModelRef m_aModel
;
511 VclPtr
<ChartWindow
> m_pChartWindow
;
512 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> m_xViewWindow
;
513 ::com::sun::star::uno::Reference
<
514 ::com::sun::star::uno::XInterface
> m_xChartView
;
515 ::boost::shared_ptr
< DrawModelWrapper
> m_pDrawModelWrapper
;
516 DrawViewWrapper
* m_pDrawViewWrapper
;
518 Selection m_aSelection
;
519 SdrDragMode m_eDragMode
;
521 Timer m_aDoubleClickTimer
;
522 bool m_bWaitingForDoubleClick
;
523 bool m_bWaitingForMouseUp
;
525 bool m_bConnectingToView
;
527 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XUndoManager
> m_xUndoManager
;
528 ::std::unique_ptr
< UndoGuard
> m_pTextActionUndoGuard
;
529 /// needed for dispatching URLs in FeatureStateEvents
530 mutable ::com::sun::star::uno::Reference
< ::com::sun::star::util::XURLTransformer
> m_xURLTransformer
;
532 ::std::unique_ptr
< ::svt::AcceleratorExecute
> m_apAccelExecute
;
534 CommandDispatchContainer m_aDispatchContainer
;
536 ::std::unique_ptr
< DropTargetHelper
> m_apDropTargetHelper
;
537 ::com::sun::star::uno::Reference
<
538 ::com::sun::star::frame::XLayoutManagerEventBroadcaster
>
539 m_xLayoutManagerEventBroadcaster
;
541 ChartDrawMode m_eDrawMode
;
546 bool impl_isDisposedOrSuspended() const;
547 ReferenceSizeProvider
* impl_createReferenceSizeProvider();
548 void impl_adaptDataSeriesAutoResize();
550 void impl_createDrawViewController();
551 void impl_deleteDrawViewController();
553 //executeDispatch methods
554 void executeDispatch_ObjectProperties();
555 void executeDispatch_FormatObject( const OUString
& rDispatchCommand
);
556 void executeDlg_ObjectProperties( const OUString
& rObjectCID
);
557 bool executeDlg_ObjectProperties_withoutUndoGuard( const OUString
& rObjectCID
, bool bSuccessOnUnchanged
);
559 void executeDispatch_ChartType();
561 void executeDispatch_InsertTitles();
562 void executeDispatch_InsertLegend();
563 void executeDispatch_DeleteLegend();
564 void executeDispatch_OpenLegendDialog();
565 void executeDispatch_InsertAxes();
566 void executeDispatch_InsertGrid();
568 void executeDispatch_InsertMenu_DataLabels();
569 void executeDispatch_InsertMenu_Trendlines();
570 void executeDispatch_InsertMenu_MeanValues();
572 void executeDispatch_InsertMeanValue();
573 void executeDispatch_InsertTrendline();
574 void executeDispatch_InsertTrendlineEquation( bool bInsertR2
=false );
575 void executeDispatch_InsertErrorBars( bool bYError
);
577 void executeDispatch_InsertR2Value();
578 void executeDispatch_DeleteR2Value();
580 void executeDispatch_DeleteMeanValue();
581 void executeDispatch_DeleteTrendline();
582 void executeDispatch_DeleteTrendlineEquation();
583 void executeDispatch_DeleteErrorBars( bool bYError
);
585 void executeDispatch_InsertDataLabels();
586 void executeDispatch_InsertDataLabel();
587 void executeDispatch_DeleteDataLabels();
588 void executeDispatch_DeleteDataLabel();
590 void executeDispatch_ResetAllDataPoints();
591 void executeDispatch_ResetDataPoint();
593 void executeDispatch_InsertAxis();
594 void executeDispatch_InsertAxisTitle();
595 void executeDispatch_InsertMajorGrid();
596 void executeDispatch_InsertMinorGrid();
597 void executeDispatch_DeleteAxis();
598 void executeDispatch_DeleteMajorGrid();
599 void executeDispatch_DeleteMinorGrid();
601 void executeDispatch_InsertSpecialCharacter();
602 void executeDispatch_EditText( const Point
* pMousePixel
= NULL
);
603 void executeDispatch_SourceData();
604 void executeDispatch_MoveSeries( bool bForward
);
606 void StartTextEdit( const Point
* pMousePixel
= NULL
);
609 void executeDispatch_View3D();
610 void executeDispatch_PositionAndSize();
612 void executeDispatch_EditData();
614 void executeDispatch_NewArrangement();
615 void executeDispatch_ScaleText();
617 void executeDispatch_Paste();
618 void executeDispatch_Copy();
619 void executeDispatch_Cut();
620 bool executeDispatch_Delete();
621 void executeDispatch_ToggleLegend();
622 void executeDispatch_ToggleGridHorizontal();
623 void executeDispatch_ToggleGridVertical();
625 void impl_ShapeControllerDispatch( const ::com::sun::star::util::URL
& rURL
,
626 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rArgs
);
628 DECL_LINK_TYPED( DoubleClickWaitingHdl
, Timer
*, void );
629 void execute_DoubleClick( const Point
* pMousePixel
= NULL
);
630 void startDoubleClickWaiting();
631 void stopDoubleClickWaiting();
633 void impl_selectObjectAndNotiy();
634 void impl_notifySelectionChangeListeners();
635 void impl_invalidateAccessible();
636 void impl_initializeAccessible();
637 void impl_initializeAccessible( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XInitialization
>& xInit
);
639 //sets the model member to null if it equals the parameter
640 //returns true if successful
641 bool impl_releaseThisModel( const ::com::sun::star::uno::Reference
<
642 ::com::sun::star::uno::XInterface
> & xModel
);
644 enum eMoveOrResizeType
647 CENTERED_RESIZE_OBJECT
649 /// @return </sal_True>, if resize/move was successful
650 bool impl_moveOrResizeObject(
651 const OUString
& rCID
, eMoveOrResizeType eType
, double fAmountLogicX
, double fAmountLogicY
);
652 bool impl_DragDataPoint( const OUString
& rCID
, double fOffset
);
654 static ::std::set
< OUString
> impl_getAvailableCommands();
656 /** Creates a helper accesibility class that must be initialized via XInitialization. For
659 The returned object should not be used directly. Instead a proxy object
660 should use this helper to retrieve its children and add them to its own
663 ::com::sun::star::uno::Reference
<
664 ::com::sun::star::accessibility::XAccessibleContext
>
665 impl_createAccessibleTextContext();
667 void impl_PasteGraphic( ::com::sun::star::uno::Reference
< ::com::sun::star::graphic::XGraphic
> & xGraphic
,
668 const ::Point
& aPosition
);
669 void impl_PasteShapes( SdrModel
* pModel
);
670 void impl_PasteStringAsTextShape( const OUString
& rString
, const ::com::sun::star::awt::Point
& rPosition
);
671 void impl_SetMousePointer( const MouseEvent
& rEvent
);
673 void impl_ClearSelection();
675 void impl_switchDiagramPositioningToExcludingPositioning();
682 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */