merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / controller / main / ChartController.hxx
blobf2b64eb7a9c57325326bec94879685c062a029fa
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _CHART_CONTROLLER_HXX
28 #define _CHART_CONTROLLER_HXX
30 #include "LifeTime.hxx"
31 #include "ServiceMacros.hxx"
32 #include "CommandDispatchContainer.hxx"
33 #include "SelectionHelper.hxx"
35 // header for enum SdrDragMode
36 #include <svx/svdtypes.hxx>
37 // header for class Timer
38 #include <vcl/timer.hxx>
39 // header for class MouseEvent
40 #include <vcl/event.hxx>
42 #include <cppuhelper/implbase12.hxx>
44 #include <com/sun/star/accessibility/XAccessible.hpp>
45 #include <com/sun/star/chart2/XUndoManager.hpp>
46 #include <com/sun/star/frame/XController.hpp>
47 #include <com/sun/star/frame/XDispatchProvider.hpp>
48 #include <com/sun/star/frame/XDispatch.hpp>
49 #include <com/sun/star/view/XSelectionSupplier.hpp>
50 #include <com/sun/star/ui/XContextMenuInterception.hpp>
51 #include <com/sun/star/uno/XWeak.hpp>
52 #include <com/sun/star/util/XCloseListener.hpp>
53 #include <com/sun/star/util/XCloseable.hpp>
54 #include <com/sun/star/lang/XInitialization.hpp>
55 #include <com/sun/star/lang/XServiceInfo.hpp>
56 #include <com/sun/star/uno/XComponentContext.hpp>
57 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
58 #include <com/sun/star/util/XModifyListener.hpp>
59 #include <com/sun/star/util/XModeChangeListener.hpp>
60 #include <com/sun/star/awt/Point.hpp>
61 #include <com/sun/star/awt/Size.hpp>
62 #include <com/sun/star/util/XURLTransformer.hpp>
63 #include <com/sun/star/frame/XLayoutManagerListener.hpp>
64 #include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
66 #include <memory>
67 #include <boost/shared_ptr.hpp>
68 #include <set>
71 class SdrModel;
73 namespace svt
75 class AcceleratorExecute;
78 class DropTargetHelper;
80 namespace com { namespace sun { namespace star {
81 namespace graphic {
82 class XGraphic;
84 }}}
87 //.............................................................................
88 namespace chart
90 //.............................................................................
92 enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT };
94 class WindowController
96 public:
97 virtual ~WindowController() {};
99 virtual void PrePaint()=0;
100 virtual void execute_Paint( const Rectangle& rRect )=0;
101 virtual void execute_MouseButtonDown( const MouseEvent& rMEvt )=0;
102 virtual void execute_MouseMove( const MouseEvent& rMEvt )=0;
103 virtual void execute_Tracking( const TrackingEvent& rTEvt )=0;
104 virtual void execute_MouseButtonUp( const MouseEvent& rMEvt )=0;
105 virtual void execute_Resize()=0;
106 virtual void execute_Activate()=0;
107 virtual void execute_Deactivate()=0;
108 virtual void execute_GetFocus()=0;
109 virtual void execute_LoseFocus()=0;
110 virtual void execute_Command( const CommandEvent& rCEvt )=0;
111 virtual bool execute_KeyInput( const KeyEvent& rKEvt )=0;
113 /** get help text to be shown in a quick help
115 @param aAtLogicPosition the position in logic coordinates (of the
116 window) of the mouse cursor to determine for
117 which object help is requested.
119 @param bIsBalloonHelp determines whether to return the long text version
120 (balloon help) or the shorter one (quick help).
122 @param rOutQuickHelpText is filled with the quick help text
124 @param rOutEqualRect is filled with a rectangle that denotes the region
125 in which the quick help does not change.
127 @return </TRUE>, if a quick help should be shown.
129 virtual bool requestQuickHelp(
130 ::Point aAtLogicPosition, bool bIsBalloonHelp,
131 ::rtl::OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect ) = 0;
133 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() = 0;
136 class ChartWindow;
137 class DrawModelWrapper;
138 class DrawViewWrapper;
139 class ViewElementListProvider;
140 class ReferenceSizeProvider;
142 class ChartController : public ::cppu::WeakImplHelper12 <
143 ::com::sun::star::frame::XController //comprehends XComponent (required interface)
144 ,::com::sun::star::frame::XDispatchProvider //(required interface)
145 ,::com::sun::star::view::XSelectionSupplier //(optional interface)
146 ,::com::sun::star::ui::XContextMenuInterception //(optional interface)
147 ,::com::sun::star::util::XCloseListener //(needed for communication with XModel)
148 ,::com::sun::star::lang::XServiceInfo
149 // ,public ::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
150 // ,public ::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface)
151 // ,public ::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
152 ,::com::sun::star::frame::XDispatch
153 ,::com::sun::star::awt::XWindow //this is the Window Controller part of this Controller, that will be given to a Frame via setComponent
154 ,::com::sun::star::lang::XMultiServiceFactory
155 ,::com::sun::star::util::XModifyListener
156 ,::com::sun::star::util::XModeChangeListener
157 ,::com::sun::star::frame::XLayoutManagerListener
159 , public WindowController
161 friend class DrawCommandDispatch;
162 friend class ShapeController;
164 public:
165 //no default constructor
166 ChartController(::com::sun::star::uno::Reference<
167 ::com::sun::star::uno::XComponentContext > const & xContext);
168 virtual ~ChartController();
170 //-----------------------------------------------------------------
171 // ::com::sun::star::lang::XServiceInfo
172 //-----------------------------------------------------------------
174 APPHELPER_XSERVICEINFO_DECL()
175 APPHELPER_SERVICE_FACTORY_HELPER(ChartController)
177 //-----------------------------------------------------------------
178 // ::com::sun::star::frame::XController (required interface)
179 //-----------------------------------------------------------------
180 virtual void SAL_CALL
181 attachFrame( const ::com::sun::star::uno::Reference<
182 ::com::sun::star::frame::XFrame > & xFrame )
183 throw (::com::sun::star::uno::RuntimeException);
185 virtual sal_Bool SAL_CALL
186 attachModel( const ::com::sun::star::uno::Reference<
187 ::com::sun::star::frame::XModel > & xModel )
188 throw (::com::sun::star::uno::RuntimeException);
190 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL
191 getFrame() throw (::com::sun::star::uno::RuntimeException);
193 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL
194 getModel() throw (::com::sun::star::uno::RuntimeException);
196 virtual ::com::sun::star::uno::Any SAL_CALL
197 getViewData() throw (::com::sun::star::uno::RuntimeException);
199 virtual void SAL_CALL
200 restoreViewData( const ::com::sun::star::uno::Any& rValue )
201 throw (::com::sun::star::uno::RuntimeException);
203 virtual sal_Bool SAL_CALL
204 suspend( sal_Bool bSuspend )
205 throw (::com::sun::star::uno::RuntimeException);
207 //-----------------------------------------------------------------
208 // ::com::sun::star::lang::XComponent (base of XController)
209 //-----------------------------------------------------------------
210 virtual void SAL_CALL
211 dispose() throw (::com::sun::star::uno::RuntimeException);
213 virtual void SAL_CALL
214 addEventListener( const ::com::sun::star::uno::Reference<
215 ::com::sun::star::lang::XEventListener > & xListener )
216 throw (::com::sun::star::uno::RuntimeException);
218 virtual void SAL_CALL
219 removeEventListener( const ::com::sun::star::uno::Reference<
220 ::com::sun::star::lang::XEventListener > & xListener )
221 throw (::com::sun::star::uno::RuntimeException);
223 //-----------------------------------------------------------------
224 // ::com::sun::star::frame::XDispatchProvider (required interface)
225 //-----------------------------------------------------------------
226 virtual ::com::sun::star::uno::Reference<
227 ::com::sun::star::frame::XDispatch> SAL_CALL
228 queryDispatch( const ::com::sun::star::util::URL& rURL
229 , const rtl::OUString& rTargetFrameName
230 , sal_Int32 nSearchFlags)
231 throw (::com::sun::star::uno::RuntimeException);
233 virtual ::com::sun::star::uno::Sequence<
234 ::com::sun::star::uno::Reference<
235 ::com::sun::star::frame::XDispatch > > SAL_CALL
236 queryDispatches( const ::com::sun::star::uno::Sequence<
237 ::com::sun::star::frame::DispatchDescriptor > & xDescripts)
238 throw (::com::sun::star::uno::RuntimeException);
240 //-----------------------------------------------------------------
241 // ::com::sun::star::view::XSelectionSupplier (optional interface)
242 //-----------------------------------------------------------------
243 virtual sal_Bool SAL_CALL
244 select( const ::com::sun::star::uno::Any& rSelection )
245 throw ( com::sun::star::lang::IllegalArgumentException );
247 virtual ::com::sun::star::uno::Any SAL_CALL
248 getSelection() throw (::com::sun::star::uno::RuntimeException);
250 virtual void SAL_CALL
251 addSelectionChangeListener( const ::com::sun::star::uno::Reference<
252 com::sun::star::view::XSelectionChangeListener > & xListener )
253 throw (::com::sun::star::uno::RuntimeException);
255 virtual void SAL_CALL
256 removeSelectionChangeListener( const ::com::sun::star::uno::Reference<
257 com::sun::star::view::XSelectionChangeListener > & xListener )
258 throw (::com::sun::star::uno::RuntimeException);
260 //-----------------------------------------------------------------
261 // ::com::sun::star::ui::XContextMenuInterception (optional interface)
262 //-----------------------------------------------------------------
263 virtual void SAL_CALL
264 registerContextMenuInterceptor( const ::com::sun::star::uno::Reference<
265 ::com::sun::star::ui::XContextMenuInterceptor > & xInterceptor)
266 throw (::com::sun::star::uno::RuntimeException);
268 virtual void SAL_CALL
269 releaseContextMenuInterceptor( const ::com::sun::star::uno::Reference<
270 ::com::sun::star::ui::XContextMenuInterceptor > & xInterceptor)
271 throw (::com::sun::star::uno::RuntimeException);
274 //-----------------------------------------------------------------
275 //-----------------------------------------------------------------
276 //additional interfaces
278 //-----------------------------------------------------------------
279 // ::com::sun::star::util::XCloseListener
280 //-----------------------------------------------------------------
281 virtual void SAL_CALL
282 queryClosing( const ::com::sun::star::lang::EventObject& Source
283 , sal_Bool GetsOwnership )
284 throw (::com::sun::star::util::CloseVetoException
285 , ::com::sun::star::uno::RuntimeException);
287 virtual void SAL_CALL
288 notifyClosing( const ::com::sun::star::lang::EventObject& Source )
289 throw (::com::sun::star::uno::RuntimeException);
291 //-------------------------------------------------------------------------------------
292 // ::com::sun::star::util::XEventListener (base of XCloseListener and XModifyListener)
293 //-------------------------------------------------------------------------------------
294 virtual void SAL_CALL
295 disposing( const ::com::sun::star::lang::EventObject& Source )
296 throw (::com::sun::star::uno::RuntimeException);
298 //-----------------------------------------------------------------
299 // ::com::sun::star::frame::XDispatch
300 //-----------------------------------------------------------------
302 virtual void SAL_CALL
303 dispatch( const ::com::sun::star::util::URL& aURL
304 , const ::com::sun::star::uno::Sequence<
305 ::com::sun::star::beans::PropertyValue >& aArgs )
306 throw (::com::sun::star::uno::RuntimeException);
308 virtual void SAL_CALL
309 addStatusListener( const ::com::sun::star::uno::Reference<
310 ::com::sun::star::frame::XStatusListener >& xControl
311 , const ::com::sun::star::util::URL& aURL )
312 throw (::com::sun::star::uno::RuntimeException);
314 virtual void SAL_CALL
315 removeStatusListener( const ::com::sun::star::uno::Reference<
316 ::com::sun::star::frame::XStatusListener >& xControl
317 , const ::com::sun::star::util::URL& aURL )
318 throw (::com::sun::star::uno::RuntimeException);
320 //-----------------------------------------------------------------
321 // ::com::sun::star::awt::XWindow
322 //-----------------------------------------------------------------
323 virtual void SAL_CALL
324 setPosSize( sal_Int32 X, sal_Int32 Y
325 , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
326 throw (::com::sun::star::uno::RuntimeException);
328 virtual ::com::sun::star::awt::Rectangle SAL_CALL
329 getPosSize()
330 throw (::com::sun::star::uno::RuntimeException);
332 virtual void SAL_CALL
333 setVisible( sal_Bool Visible )
334 throw (::com::sun::star::uno::RuntimeException);
336 virtual void SAL_CALL
337 setEnable( sal_Bool Enable )
338 throw (::com::sun::star::uno::RuntimeException);
340 virtual void SAL_CALL
341 setFocus() throw (::com::sun::star::uno::RuntimeException);
343 //----------------
344 virtual void SAL_CALL
345 addWindowListener( const ::com::sun::star::uno::Reference<
346 ::com::sun::star::awt::XWindowListener >& xListener )
347 throw (::com::sun::star::uno::RuntimeException);
349 virtual void SAL_CALL
350 removeWindowListener( const ::com::sun::star::uno::Reference<
351 ::com::sun::star::awt::XWindowListener >& xListener )
352 throw (::com::sun::star::uno::RuntimeException);
354 virtual void SAL_CALL
355 addFocusListener( const ::com::sun::star::uno::Reference<
356 ::com::sun::star::awt::XFocusListener >& xListener )
357 throw (::com::sun::star::uno::RuntimeException);
359 virtual void SAL_CALL
360 removeFocusListener( const ::com::sun::star::uno::Reference<
361 ::com::sun::star::awt::XFocusListener >& xListener )
362 throw (::com::sun::star::uno::RuntimeException);
364 virtual void SAL_CALL
365 addKeyListener( const ::com::sun::star::uno::Reference<
366 ::com::sun::star::awt::XKeyListener >& xListener )
367 throw (::com::sun::star::uno::RuntimeException);
369 virtual void SAL_CALL
370 removeKeyListener( const ::com::sun::star::uno::Reference<
371 ::com::sun::star::awt::XKeyListener >& xListener )
372 throw (::com::sun::star::uno::RuntimeException);
374 virtual void SAL_CALL
375 addMouseListener( const ::com::sun::star::uno::Reference<
376 ::com::sun::star::awt::XMouseListener >& xListener )
377 throw (::com::sun::star::uno::RuntimeException);
379 virtual void SAL_CALL
380 removeMouseListener( const ::com::sun::star::uno::Reference<
381 ::com::sun::star::awt::XMouseListener >& xListener )
382 throw (::com::sun::star::uno::RuntimeException);
384 virtual void SAL_CALL
385 addMouseMotionListener( const ::com::sun::star::uno::Reference<
386 ::com::sun::star::awt::XMouseMotionListener >& xListener )
387 throw (::com::sun::star::uno::RuntimeException);
389 virtual void SAL_CALL
390 removeMouseMotionListener( const ::com::sun::star::uno::Reference<
391 ::com::sun::star::awt::XMouseMotionListener >& xListener )
392 throw (::com::sun::star::uno::RuntimeException);
394 virtual void SAL_CALL
395 addPaintListener( const ::com::sun::star::uno::Reference<
396 ::com::sun::star::awt::XPaintListener >& xListener )
397 throw (::com::sun::star::uno::RuntimeException);
399 virtual void SAL_CALL
400 removePaintListener( const ::com::sun::star::uno::Reference<
401 ::com::sun::star::awt::XPaintListener >& xListener )
402 throw (::com::sun::star::uno::RuntimeException);
404 //-----------------------------------------------------------------
405 // ::com::sun::star::lang XMultiServiceFactory
406 //-----------------------------------------------------------------
407 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
408 createInstance( const ::rtl::OUString& aServiceSpecifier )
409 throw (::com::sun::star::uno::Exception,
410 ::com::sun::star::uno::RuntimeException);
411 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
412 createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier,
413 const ::com::sun::star::uno::Sequence<
414 ::com::sun::star::uno::Any >& Arguments )
415 throw (::com::sun::star::uno::Exception,
416 ::com::sun::star::uno::RuntimeException);
417 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
418 getAvailableServiceNames()
419 throw (::com::sun::star::uno::RuntimeException);
421 //-----------------------------------------------------------------
422 // ::com::sun::star::util::XModifyListener
423 //-----------------------------------------------------------------
424 virtual void SAL_CALL modified(
425 const ::com::sun::star::lang::EventObject& aEvent )
426 throw (::com::sun::star::uno::RuntimeException);
428 //-----------------------------------------------------------------
429 // ::com::sun::star::util::XModeChangeListener
430 //-----------------------------------------------------------------
431 virtual void SAL_CALL modeChanged(
432 const ::com::sun::star::util::ModeChangeEvent& _rSource )
433 throw (::com::sun::star::uno::RuntimeException);
435 //-----------------------------------------------------------------
436 // ::com::sun::star::frame::XLayoutManagerListener
437 //-----------------------------------------------------------------
438 virtual void SAL_CALL layoutEvent(
439 const ::com::sun::star::lang::EventObject& aSource,
440 ::sal_Int16 eLayoutEvent,
441 const ::com::sun::star::uno::Any& aInfo )
442 throw (::com::sun::star::uno::RuntimeException);
444 //-----------------------------------------------------------------
445 // chart2::WindowController
446 //-----------------------------------------------------------------
447 virtual void PrePaint();
448 virtual void execute_Paint( const Rectangle& rRect );
449 virtual void execute_MouseButtonDown( const MouseEvent& rMEvt );
450 virtual void execute_MouseMove( const MouseEvent& rMEvt );
451 virtual void execute_Tracking( const TrackingEvent& rTEvt );
452 virtual void execute_MouseButtonUp( const MouseEvent& rMEvt );
453 virtual void execute_Resize();
454 virtual void execute_Activate();
455 virtual void execute_Deactivate();
456 virtual void execute_GetFocus();
457 virtual void execute_LoseFocus();
458 virtual void execute_Command( const CommandEvent& rCEvt );
459 virtual bool execute_KeyInput( const KeyEvent& rKEvt );
461 virtual bool requestQuickHelp(
462 ::Point aAtLogicPosition, bool bIsBalloonHelp,
463 ::rtl::OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect );
465 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
467 //-----------------------------------------------------------------
468 //-----------------------------------------------------------------
470 static bool isObjectDeleteable( const ::com::sun::star::uno::Any& rSelection );
472 void setDrawMode( ChartDrawMode eMode ) { m_eDrawMode = eMode; }
473 ChartDrawMode getDrawMode() const { return m_eDrawMode; }
475 bool isShapeContext() const;
477 DECL_LINK( NotifyUndoActionHdl, SdrUndoAction* );
479 public:
480 //-----------------------------------------------------------------
481 //-----------------------------------------------------------------
482 //-----------------------------------------------------------------
483 //-----------------------------------------------------------------
484 //private
485 //-----------------------------------------------------------------
486 //-----------------------------------------------------------------
487 //-----------------------------------------------------------------
488 //-----------------------------------------------------------------
491 private:
492 DrawModelWrapper* GetDrawModelWrapper();
493 DrawViewWrapper* GetDrawViewWrapper();
495 private:
496 class TheModelRef;
497 friend class ChartController::TheModelRef;
498 class RefCountable
500 public:
501 RefCountable();
502 virtual ~RefCountable();
503 void acquire();
504 void release();
505 private:
506 sal_Int32 volatile m_nRefCount;
508 class TheModel : public RefCountable
510 public:
511 TheModel( const ::com::sun::star::uno::Reference<
512 ::com::sun::star::frame::XModel > & xModel );
514 virtual ~TheModel();
516 void SetOwnerShip( sal_Bool bGetsOwnership );
517 void addListener( ChartController* pController );
518 void removeListener( ChartController* pController );
519 void tryTermination();
520 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
521 getModel() { return m_xModel;}
523 private:
524 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
525 ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xCloseable;
527 //the ownership between model and controller is not clear at first
528 //each controller might consider himself as owner of the model first
529 sal_Bool volatile m_bOwnership;
530 //with a XCloseable::close call and during XCloseListener::queryClosing
531 //the ownership can be regulated more explicit,
532 //if so the ownership is considered to be well known
533 sal_Bool volatile m_bOwnershipIsWellKnown;
535 class TheModelRef
537 public:
538 TheModelRef( TheModel* pTheModel, ::osl::Mutex& rMutex );
539 TheModelRef( const TheModelRef& rTheModel, ::osl::Mutex& rMutex );
540 TheModelRef& operator=(ChartController::TheModel* pTheModel);
541 TheModelRef& operator=(const TheModelRef& rTheModel);
542 virtual ~TheModelRef();
543 sal_Bool is() const;
544 TheModel* operator->() const { return m_pTheModel; }
545 private:
546 TheModel* m_pTheModel;
547 mutable ::osl::Mutex& m_rModelMutex;
550 private:
551 mutable ::apphelper::LifeTimeManager m_aLifeTimeManager;
553 mutable ::osl::Mutex m_aControllerMutex;
554 sal_Bool volatile m_bSuspended;
555 sal_Bool volatile m_bCanClose;
557 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC;
559 //model
560 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
561 mutable ::osl::Mutex m_aModelMutex;
562 TheModelRef m_aModel;
564 //view
565 ChartWindow* m_pChartWindow;
566 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xViewWindow;
567 ::com::sun::star::uno::Reference<
568 ::com::sun::star::uno::XInterface > m_xChartView;
569 ::boost::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
570 DrawViewWrapper* m_pDrawViewWrapper;
572 Selection m_aSelection;
573 SdrDragMode m_eDragMode;
575 Timer m_aDoubleClickTimer;
576 bool volatile m_bWaitingForDoubleClick;
577 bool volatile m_bWaitingForMouseUp;
579 bool volatile m_bConnectingToView;
581 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
582 /// needed for dispatching URLs in FeatureStateEvents
583 mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
585 ::std::auto_ptr< ::svt::AcceleratorExecute > m_apAccelExecute;
587 CommandDispatchContainer m_aDispatchContainer;
589 ::std::auto_ptr< DropTargetHelper > m_apDropTargetHelper;
590 ::com::sun::star::uno::Reference<
591 ::com::sun::star::frame::XLayoutManagerEventBroadcaster >
592 m_xLayoutManagerEventBroadcaster;
594 ChartDrawMode m_eDrawMode;
596 private:
597 //private methods
599 sal_Bool impl_isDisposedOrSuspended() const;
600 ::std::auto_ptr< ReferenceSizeProvider > impl_createReferenceSizeProvider();
601 void impl_adaptDataSeriesAutoResize();
603 void impl_createDrawViewController();
604 void impl_deleteDrawViewController();
606 //executeDispatch methods
607 void SAL_CALL executeDispatch_ObjectProperties();
608 void SAL_CALL executeDispatch_FormatObject( const ::rtl::OUString& rDispatchCommand );
609 void SAL_CALL executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID );
610 bool executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso );
612 void SAL_CALL executeDispatch_ChartType();
614 void executeDispatch_InsertTitles();
615 void executeDispatch_InsertLegend();
616 void executeDispatch_DeleteLegend();
617 void executeDispatch_OpenLegendDialog();
618 void executeDispatch_InsertAxes();
619 void executeDispatch_InsertGrid();
621 void executeDispatch_InsertMenu_DataLabels();
622 void executeDispatch_InsertMenu_YErrorBars();
623 void executeDispatch_InsertMenu_Trendlines();
624 void executeDispatch_InsertMenu_MeanValues();
626 void executeDispatch_InsertMeanValue();
627 void executeDispatch_InsertTrendline();
628 void executeDispatch_InsertTrendlineEquation( bool bInsertR2=false );
629 void executeDispatch_InsertYErrorBars();
631 void executeDispatch_InsertR2Value();
632 void executeDispatch_DeleteR2Value();
634 void executeDispatch_DeleteMeanValue();
635 void executeDispatch_DeleteTrendline();
636 void executeDispatch_DeleteTrendlineEquation();
637 void executeDispatch_DeleteYErrorBars();
639 void executeDispatch_InsertDataLabels();
640 void executeDispatch_InsertDataLabel();
641 void executeDispatch_DeleteDataLabels();
642 void executeDispatch_DeleteDataLabel();
644 void executeDispatch_ResetAllDataPoints();
645 void executeDispatch_ResetDataPoint();
647 void executeDispatch_InsertAxis();
648 void executeDispatch_InsertAxisTitle();
649 void executeDispatch_InsertMajorGrid();
650 void executeDispatch_InsertMinorGrid();
651 void executeDispatch_DeleteAxis();
652 void executeDispatch_DeleteMajorGrid();
653 void executeDispatch_DeleteMinorGrid();
655 void SAL_CALL executeDispatch_InsertSpecialCharacter();
656 void SAL_CALL executeDispatch_EditText( const Point* pMousePixel = NULL );
657 void SAL_CALL executeDispatch_SourceData();
658 void SAL_CALL executeDispatch_MoveSeries( sal_Bool bForward );
660 void StartTextEdit( const Point* pMousePixel = NULL );
661 bool EndTextEdit();
663 void SAL_CALL executeDispatch_View3D();
664 void SAL_CALL executeDispatch_PositionAndSize();
666 void executeDispatch_EditData();
668 void executeDispatch_NewArrangement();
669 void executeDispatch_ScaleText();
671 void executeDispatch_Paste();
672 void executeDispatch_Copy();
673 void executeDispatch_Cut();
674 bool executeDispatch_Delete();
675 void executeDispatch_ToggleLegend();
676 void executeDispatch_ToggleGridHorizontal();
678 void impl_ShapeControllerDispatch( const ::com::sun::star::util::URL& rURL,
679 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
682 DECL_LINK( DoubleClickWaitingHdl, void* );
683 void execute_DoubleClick( const Point* pMousePixel = NULL );
684 void startDoubleClickWaiting();
685 void stopDoubleClickWaiting();
687 void impl_selectObjectAndNotiy();
688 void impl_notifySelectionChangeListeners();
689 void impl_invalidateAccessible();
690 void impl_initializeAccessible();
691 void impl_initializeAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XInitialization >& xInit );
693 //sets the model member to null if it equals the parameter
694 //returns true if successful
695 bool impl_releaseThisModel( const ::com::sun::star::uno::Reference<
696 ::com::sun::star::uno::XInterface > & xModel );
698 enum eMoveOrResizeType
700 MOVE_OBJECT,
701 CENTERED_RESIZE_OBJECT
703 /// @return </TRUE>, if resize/move was successful
704 bool impl_moveOrResizeObject(
705 const ::rtl::OUString & rCID, eMoveOrResizeType eType, double fAmountLogicX, double fAmountLogicY );
706 bool impl_DragDataPoint( const ::rtl::OUString & rCID, double fOffset );
708 ::std::set< ::rtl::OUString > impl_getAvailableCommands();
710 /** Creates a helper accesibility class that must be initialized via XInitialization. For
711 parameters see
713 The returned object should not be used directly. Instead a proxy object
714 should use this helper to retrieve its children and add them to its own
715 children.
717 ::com::sun::star::uno::Reference<
718 ::com::sun::star::accessibility::XAccessibleContext >
719 impl_createAccessibleTextContext();
721 void impl_PasteGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > & xGraphic,
722 const ::Point & aPosition );
723 void impl_PasteShapes( SdrModel* pModel );
724 void impl_PasteStringAsTextShape( const ::rtl::OUString& rString, const ::com::sun::star::awt::Point& rPosition );
725 void impl_SetMousePointer( const MouseEvent & rEvent );
727 void impl_ClearSelection();
729 void impl_switchDiagramPositioningToExcludingPositioning();
732 //.............................................................................
733 } // namespace chart
734 //.............................................................................
736 #endif