merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / controller / chartapiwrapper / TitleWrapper.hxx
blob78e44d8c85f1cd18ed49faddd098745feab1ccc7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TitleWrapper.hxx,v $
10 * $Revision: 1.6.44.1 $
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 ************************************************************************/
30 #ifndef CHART_TITLEWRAPPER_HXX
31 #define CHART_TITLEWRAPPER_HXX
33 #include "WrappedPropertySet.hxx"
34 #include "ReferenceSizePropertyProvider.hxx"
35 #include "Chart2ModelContact.hxx"
36 #include "ServiceMacros.hxx"
37 #include "TitleHelper.hxx"
38 #include <cppuhelper/implbase3.hxx>
39 #include <comphelper/uno3.hxx>
40 #include <cppuhelper/interfacecontainer.hxx>
41 #include <com/sun/star/drawing/XShape.hpp>
42 #include <com/sun/star/lang/XComponent.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/chart2/XTitle.hpp>
45 #include <com/sun/star/uno/XComponentContext.hpp>
47 #include <boost/shared_ptr.hpp>
49 namespace chart
51 namespace wrapper
54 class TitleWrapper : public ::cppu::ImplInheritanceHelper3<
55 WrappedPropertySet
56 , com::sun::star::drawing::XShape
57 , com::sun::star::lang::XComponent
58 , com::sun::star::lang::XServiceInfo
60 , public ReferenceSizePropertyProvider
62 public:
63 TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
64 ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
65 virtual ~TitleWrapper();
67 /// XServiceInfo declarations
68 APPHELPER_XSERVICEINFO_DECL()
70 //ReferenceSizePropertyProvider
71 virtual void updateReferenceSize();
72 virtual ::com::sun::star::uno::Any getReferenceSize();
73 virtual ::com::sun::star::awt::Size getCurrentSizeForReference();
75 protected:
76 // ____ XShape ____
77 virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
78 throw (::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition )
80 throw (::com::sun::star::uno::RuntimeException);
81 virtual ::com::sun::star::awt::Size SAL_CALL getSize()
82 throw (::com::sun::star::uno::RuntimeException);
83 virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize )
84 throw (::com::sun::star::beans::PropertyVetoException,
85 ::com::sun::star::uno::RuntimeException);
87 // ____ XShapeDescriptor (base of XShape) ____
88 virtual ::rtl::OUString SAL_CALL getShapeType()
89 throw (::com::sun::star::uno::RuntimeException);
91 // ____ XComponent ____
92 virtual void SAL_CALL dispose()
93 throw (::com::sun::star::uno::RuntimeException);
94 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
95 ::com::sun::star::lang::XEventListener >& xListener )
96 throw (::com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
98 ::com::sun::star::lang::XEventListener >& aListener )
99 throw (::com::sun::star::uno::RuntimeException);
101 // character properties have to be handled differently (via the XFormattedString elements)
102 void getFastCharacterPropertyValue( sal_Int32 nHandle, ::com::sun::star::uno::Any& rValue );
103 void setFastCharacterPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
104 throw (::com::sun::star::uno::Exception);
106 // ____ WrappedPropertySet ____
107 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
108 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
110 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
112 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
113 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
115 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
117 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
118 virtual const std::vector< WrappedProperty* > createWrappedProperties();
120 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getFirstCharacterPropertySet();
122 private:
123 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle > getTitleObject();
125 private:
126 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
127 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
129 ::chart::TitleHelper::eTitleType m_eTitleType;
132 } // namespace wrapper
133 } // namespace chart
135 // CHART_TITLEWRAPPER_HXX
136 #endif