1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sampleaddin.hxx,v $
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 ************************************************************************/
31 #ifndef _SAMPLEADDIN_HXX_
32 #define _SAMPLEADDIN_HXX_
34 #include <cppuhelper/implbase9.hxx>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/chart/XDiagram.hpp>
38 #include <com/sun/star/chart/XAxisXSupplier.hpp>
39 #include <com/sun/star/chart/XAxisYSupplier.hpp>
40 #include <com/sun/star/chart/XStatisticDisplay.hpp>
42 #include <com/sun/star/lang/XServiceName.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/util/XRefreshable.hpp>
45 #include <com/sun/star/lang/XLocalizable.hpp>
47 #include <com/sun/star/chart/XChartDocument.hpp>
49 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> SAL_CALL
50 SampleAddIn_CreateInstance(
51 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& );
53 class SampleAddIn
: public cppu::WeakImplHelper9
<
54 com::sun::star::lang::XInitialization
,
55 com::sun::star::chart::XDiagram
,
56 com::sun::star::chart::XAxisXSupplier
,
57 com::sun::star::chart::XAxisYSupplier
,
58 com::sun::star::chart::XStatisticDisplay
,
59 com::sun::star::lang::XServiceName
,
60 com::sun::star::lang::XServiceInfo
,
61 com::sun::star::util::XRefreshable
,
62 com::sun::star::lang::XLocalizable
>
65 ::com::sun::star::uno::Reference
< ::com::sun::star::chart::XChartDocument
> mxChartDoc
;
66 ::com::sun::star::lang::Locale maLocale
;
68 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> mxMyRedLine
;
69 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> mxMyText
;
73 virtual ~SampleAddIn();
75 // class specific code
76 static ::rtl::OUString
getImplementationName_Static();
77 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static();
79 sal_Bool
getLogicalPosition( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xAxis
,
82 ::com::sun::star::awt::Point
& aOutPosition
);
85 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
86 throw( ::com::sun::star::uno::Exception
,
87 ::com::sun::star::uno::RuntimeException
);
90 virtual ::rtl::OUString SAL_CALL
getDiagramType() throw( ::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDataRowProperties( sal_Int32 nRow
)
92 throw( ::com::sun::star::lang::IndexOutOfBoundsException
,
93 ::com::sun::star::uno::RuntimeException
);
94 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDataPointProperties( sal_Int32 nCol
, sal_Int32 nRow
)
95 throw( ::com::sun::star::lang::IndexOutOfBoundsException
,
96 ::com::sun::star::uno::RuntimeException
);
98 // XShape ( ::XDiagram )
99 virtual ::com::sun::star::awt::Size SAL_CALL
getSize()
100 throw( ::com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
setSize( const ::com::sun::star::awt::Size
& )
102 throw( ::com::sun::star::beans::PropertyVetoException
,
103 ::com::sun::star::uno::RuntimeException
);
104 virtual ::com::sun::star::awt::Point SAL_CALL
getPosition()
105 throw( ::com::sun::star::uno::RuntimeException
);
106 virtual void SAL_CALL
setPosition( const ::com::sun::star::awt::Point
& )
107 throw( ::com::sun::star::uno::RuntimeException
);
109 // XShapeDescriptor ( ::XShape ::XDiagram )
110 virtual rtl::OUString SAL_CALL
getShapeType() throw( com::sun::star::uno::RuntimeException
);
113 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> SAL_CALL
getXAxisTitle()
114 throw( ::com::sun::star::uno::RuntimeException
);
115 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXAxis()
116 throw( ::com::sun::star::uno::RuntimeException
);
117 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXMainGrid()
118 throw( ::com::sun::star::uno::RuntimeException
);
119 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getXHelpGrid()
120 throw( ::com::sun::star::uno::RuntimeException
);
123 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> SAL_CALL
getYAxisTitle()
124 throw( ::com::sun::star::uno::RuntimeException
);
125 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYAxis()
126 throw( ::com::sun::star::uno::RuntimeException
);
127 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYHelpGrid()
128 throw( ::com::sun::star::uno::RuntimeException
);
129 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getYMainGrid()
130 throw( ::com::sun::star::uno::RuntimeException
);
133 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getUpBar()
134 throw( ::com::sun::star::uno::RuntimeException
);
135 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getDownBar()
136 throw( ::com::sun::star::uno::RuntimeException
);
137 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getMinMaxLine()
138 throw( ::com::sun::star::uno::RuntimeException
);
141 virtual ::rtl::OUString SAL_CALL
getServiceName() throw( ::com::sun::star::uno::RuntimeException
);
144 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
145 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
146 throw( ::com::sun::star::uno::RuntimeException
);
147 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames()
148 throw( ::com::sun::star::uno::RuntimeException
);
151 virtual void SAL_CALL
refresh() throw( ::com::sun::star::uno::RuntimeException
);
152 virtual void SAL_CALL
addRefreshListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XRefreshListener
>& l
)
153 throw( ::com::sun::star::uno::RuntimeException
);
154 virtual void SAL_CALL
removeRefreshListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XRefreshListener
>& l
)
155 throw( ::com::sun::star::uno::RuntimeException
);
158 virtual void SAL_CALL
setLocale( const ::com::sun::star::lang::Locale
& eLocale
)
159 throw( ::com::sun::star::uno::RuntimeException
);
160 virtual ::com::sun::star::lang::Locale SAL_CALL
getLocale()
161 throw( ::com::sun::star::uno::RuntimeException
);
164 #endif // _SAMPLEADDIN_HXX_