1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27 #ifndef CHART2_DRAWCOMMANDDISPATCH_HXX 28 #define CHART2_DRAWCOMMANDDISPATCH_HXX 29 30 #include "FeatureCommandDispatchBase.hxx" 31 32 #include <tools/solar.h> 33 34 class SfxItemSet; 35 class SdrObject; 36 37 //............................................................................. 38 namespace chart 39 { 40 //............................................................................. 41 42 class ChartController; 43 44 /** This is a CommandDispatch implementation for drawing objects. 45 */ 46 class DrawCommandDispatch: public FeatureCommandDispatchBase 47 { 48 public: 49 DrawCommandDispatch( const ::com::sun::star::uno::Reference< 50 ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController ); 51 virtual ~DrawCommandDispatch(); 52 53 // late initialisation, especially for adding as listener 54 virtual void initialize(); 55 56 virtual bool isFeatureSupported( const ::rtl::OUString& rCommandURL ); 57 58 void setAttributes( SdrObject* pObj ); 59 void setLineEnds( SfxItemSet& rAttr ); 60 61 protected: 62 // WeakComponentImplHelperBase 63 virtual void SAL_CALL disposing(); 64 65 // XEventListener 66 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) 67 throw (::com::sun::star::uno::RuntimeException); 68 69 // state of a feature 70 virtual FeatureState getState( const ::rtl::OUString& rCommand ); 71 72 // execute a feature 73 virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs ); 74 75 // all the features which should be handled by this class 76 virtual void describeSupportedFeatures(); 77 78 private: 79 void setInsertObj( sal_uInt16 eObj ); 80 SdrObject* createDefaultObject( const sal_uInt16 nID ); 81 82 bool parseCommandURL( const ::rtl::OUString& rCommandURL, sal_uInt16* pnFeatureId, ::rtl::OUString* pBaseCommand, ::rtl::OUString* pCustomShapeType ); 83 84 ChartController* m_pChartController; 85 ::rtl::OUString m_aCustomShapeType; 86 }; 87 88 //............................................................................. 89 } // namespace chart 90 //............................................................................. 91 92 // CHART2_DRAWCOMMANDDISPATCH_HXX 93 #endif 94