xref: /AOO41X/main/chart2/workbench/addin/sampleaddin.hxx (revision de7b3f825c374d9f7270d1282e9d92876f197200)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SAMPLEADDIN_HXX_
25 #define _SAMPLEADDIN_HXX_
26 
27 #include <cppuhelper/implbase9.hxx>
28 
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/chart/XDiagram.hpp>
31 #include <com/sun/star/chart/XAxisXSupplier.hpp>
32 #include <com/sun/star/chart/XAxisYSupplier.hpp>
33 #include <com/sun/star/chart/XStatisticDisplay.hpp>
34 
35 #include <com/sun/star/lang/XServiceName.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/util/XRefreshable.hpp>
38 #include <com/sun/star/lang/XLocalizable.hpp>
39 
40 #include <com/sun/star/chart/XChartDocument.hpp>
41 
42 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
43     SampleAddIn_CreateInstance(
44         const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& );
45 
46 class SampleAddIn : public cppu::WeakImplHelper9<
47     com::sun::star::lang::XInitialization,
48     com::sun::star::chart::XDiagram,
49     com::sun::star::chart::XAxisXSupplier,
50     com::sun::star::chart::XAxisYSupplier,
51     com::sun::star::chart::XStatisticDisplay,
52     com::sun::star::lang::XServiceName,
53     com::sun::star::lang::XServiceInfo,
54     com::sun::star::util::XRefreshable,
55     com::sun::star::lang::XLocalizable  >
56 {
57 private:
58     ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDocument > mxChartDoc;
59     ::com::sun::star::lang::Locale maLocale;
60 
61     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxMyRedLine;
62     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxMyText;
63 
64 public:
65     SampleAddIn();
66     virtual ~SampleAddIn();
67 
68     // class specific code
69     static ::rtl::OUString  getImplementationName_Static();
70     static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
71 
72     sal_Bool getLogicalPosition( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xAxis,
73                                  double fValue,
74                                  sal_Bool bVertical,
75                                  ::com::sun::star::awt::Point& aOutPosition );
76 
77     // XInitialization
78     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
79         throw( ::com::sun::star::uno::Exception,
80                ::com::sun::star::uno::RuntimeException );
81 
82     // XDiagram
83     virtual ::rtl::OUString SAL_CALL getDiagramType() throw( ::com::sun::star::uno::RuntimeException );
84     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 nRow )
85         throw( ::com::sun::star::lang::IndexOutOfBoundsException,
86                ::com::sun::star::uno::RuntimeException );
87     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
88         throw( ::com::sun::star::lang::IndexOutOfBoundsException,
89                ::com::sun::star::uno::RuntimeException );
90 
91     // XShape ( ::XDiagram )
92     virtual ::com::sun::star::awt::Size SAL_CALL getSize()
93         throw( ::com::sun::star::uno::RuntimeException );
94     virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& )
95         throw( ::com::sun::star::beans::PropertyVetoException,
96                ::com::sun::star::uno::RuntimeException );
97     virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
98         throw( ::com::sun::star::uno::RuntimeException );
99     virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& )
100         throw( ::com::sun::star::uno::RuntimeException );
101 
102     // XShapeDescriptor ( ::XShape ::XDiagram )
103     virtual rtl::OUString SAL_CALL getShapeType() throw( com::sun::star::uno::RuntimeException );
104 
105     // XAxisXSupplier
106     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getXAxisTitle()
107         throw( ::com::sun::star::uno::RuntimeException );
108     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXAxis()
109         throw( ::com::sun::star::uno::RuntimeException );
110     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXMainGrid()
111         throw( ::com::sun::star::uno::RuntimeException );
112     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXHelpGrid()
113         throw( ::com::sun::star::uno::RuntimeException );
114 
115     // XAxisYSupplier
116     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getYAxisTitle()
117         throw( ::com::sun::star::uno::RuntimeException );
118     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYAxis()
119         throw( ::com::sun::star::uno::RuntimeException );
120     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYHelpGrid()
121         throw( ::com::sun::star::uno::RuntimeException );
122     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYMainGrid()
123         throw( ::com::sun::star::uno::RuntimeException );
124 
125     // XStatisticDisplay
126     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getUpBar()
127         throw( ::com::sun::star::uno::RuntimeException );
128     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDownBar()
129         throw( ::com::sun::star::uno::RuntimeException );
130     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMinMaxLine()
131         throw( ::com::sun::star::uno::RuntimeException );
132 
133     // XServiceName
134     virtual ::rtl::OUString SAL_CALL getServiceName() throw( ::com::sun::star::uno::RuntimeException );
135 
136     // XServiceInfo
137     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
138     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
139         throw( ::com::sun::star::uno::RuntimeException );
140     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
141         throw( ::com::sun::star::uno::RuntimeException );
142 
143     // XRefreshable
144     virtual void SAL_CALL refresh() throw( ::com::sun::star::uno::RuntimeException );
145     virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l )
146         throw( ::com::sun::star::uno::RuntimeException );
147     virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l )
148         throw( ::com::sun::star::uno::RuntimeException );
149 
150     // XLocalizable
151     virtual void SAL_CALL setLocale( const ::com::sun::star::lang::Locale& eLocale )
152         throw( ::com::sun::star::uno::RuntimeException );
153     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale()
154         throw( ::com::sun::star::uno::RuntimeException );
155 };
156 
157 #endif  // _SAMPLEADDIN_HXX_
158