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_SHAPECONTROLLER_HXX
28 #define CHART2_SHAPECONTROLLER_HXX
29 
30 #include "FeatureCommandDispatchBase.hxx"
31 #include <tools/link.hxx>
32 
33 class AbstractSvxNameDialog;
34 class SdrObject;
35 
36 //.............................................................................
37 namespace chart
38 {
39 //.............................................................................
40 
41 class ChartController;
42 
43 /** This is a CommandDispatch implementation for shapes.
44  */
45 class ShapeController: public FeatureCommandDispatchBase
46 {
47     friend class ControllerCommandDispatch;
48 
49 public:
50     ShapeController( const ::com::sun::star::uno::Reference<
51         ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
52 	virtual ~ShapeController();
53 
54     // late initialisation, especially for adding as listener
55     virtual void initialize();
56 
57 protected:
58     // WeakComponentImplHelperBase
59     virtual void SAL_CALL disposing();
60 
61     // XEventListener
62     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
63         throw (::com::sun::star::uno::RuntimeException);
64 
65 	// state of a feature
66     virtual FeatureState getState( const ::rtl::OUString& rCommand );
67 
68     // execute a feature
69     virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs );
70 
71     // all the features which should be handled by this class
72     virtual void describeSupportedFeatures();
73 
74 private:
75     DECL_LINK( CheckNameHdl, AbstractSvxNameDialog* );
76 
77     void executeDispatch_FormatLine();
78     void executeDispatch_FormatArea();
79     void executeDispatch_TextAttributes();
80     void executeDispatch_TransformDialog();
81     void executeDispatch_ObjectTitleDescription();
82     void executeDispatch_RenameObject();
83     void executeDispatch_ChangeZOrder( sal_uInt16 nId );
84     void executeDispatch_FontDialog();
85     void executeDispatch_ParagraphDialog();
86 
87     SdrObject* getFirstAdditionalShape();
88     SdrObject* getLastAdditionalShape();
89     bool       isBackwardPossible();
90     bool       isForwardPossible();
91 
92     ChartController* m_pChartController;
93 };
94 
95 //.............................................................................
96 } //  namespace chart
97 //.............................................................................
98 
99 // CHART2_SHAPECONTROLLER_HXX
100 #endif
101