tdf#154546 skip dispatch when presenter controller is not set
[LibreOffice.git] / chart2 / workbench / addin / sampleaddin.hxx
blobdf45d45894237f85442e854595eaea0797836040
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <com/sun/star/chart/XDiagram.hpp>
26 #include <com/sun/star/chart/XAxisXSupplier.hpp>
27 #include <com/sun/star/chart/XAxisYSupplier.hpp>
28 #include <com/sun/star/chart/XStatisticDisplay.hpp>
30 #include <com/sun/star/lang/XServiceName.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/util/XRefreshable.hpp>
33 #include <com/sun/star/lang/XLocalizable.hpp>
35 #include <com/sun/star/chart/XChartDocument.hpp>
37 css::uno::Reference< css::uno::XInterface > SAL_CALL
38 SampleAddIn_CreateInstance(
39 const css::uno::Reference< css::lang::XMultiServiceFactory >& );
41 class SampleAddIn : public cppu::WeakImplHelper<
42 css::lang::XInitialization,
43 css::chart::XDiagram,
44 css::chart::XAxisXSupplier,
45 css::chart::XAxisYSupplier,
46 css::chart::XStatisticDisplay,
47 css::lang::XServiceName,
48 css::lang::XServiceInfo,
49 css::util::XRefreshable,
50 css::lang::XLocalizable >
52 private:
53 css::uno::Reference< css::chart::XChartDocument > mxChartDoc;
54 css::lang::Locale maLocale;
56 css::uno::Reference< css::drawing::XShape > mxMyRedLine;
57 css::uno::Reference< css::drawing::XShape > mxMyText;
59 public:
60 SampleAddIn();
61 virtual ~SampleAddIn();
63 // class specific code
64 static OUString getImplementationName_Static();
65 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
67 sal_Bool getLogicalPosition( css::uno::Reference< css::drawing::XShape >& xAxis,
68 double fValue,
69 sal_Bool bVertical,
70 css::awt::Point& aOutPosition );
72 // XInitialization
73 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
74 throw( css::uno::Exception,
75 css::uno::RuntimeException );
77 // XDiagram
78 virtual OUString SAL_CALL getDiagramType() throw( css::uno::RuntimeException );
79 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 nRow )
80 throw( css::lang::IndexOutOfBoundsException,
81 css::uno::RuntimeException );
82 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
83 throw( css::lang::IndexOutOfBoundsException,
84 css::uno::RuntimeException );
86 // XShape ( ::XDiagram )
87 virtual css::awt::Size SAL_CALL getSize()
88 throw( css::uno::RuntimeException );
89 virtual void SAL_CALL setSize( const css::awt::Size& )
90 throw( css::beans::PropertyVetoException,
91 css::uno::RuntimeException );
92 virtual css::awt::Point SAL_CALL getPosition()
93 throw( css::uno::RuntimeException );
94 virtual void SAL_CALL setPosition( const css::awt::Point& )
95 throw( css::uno::RuntimeException );
97 // XShapeDescriptor ( ::XShape ::XDiagram )
98 virtual OUString SAL_CALL getShapeType() throw( css::uno::RuntimeException );
100 // XAxisXSupplier
101 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getXAxisTitle()
102 throw( css::uno::RuntimeException );
103 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getXAxis()
104 throw( css::uno::RuntimeException );
105 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getXMainGrid()
106 throw( css::uno::RuntimeException );
107 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getXHelpGrid()
108 throw( css::uno::RuntimeException );
110 // XAxisYSupplier
111 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getYAxisTitle()
112 throw( css::uno::RuntimeException );
113 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getYAxis()
114 throw( css::uno::RuntimeException );
115 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getYHelpGrid()
116 throw( css::uno::RuntimeException );
117 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getYMainGrid()
118 throw( css::uno::RuntimeException );
120 // XStatisticDisplay
121 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getUpBar()
122 throw( css::uno::RuntimeException );
123 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getDownBar()
124 throw( css::uno::RuntimeException );
125 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getMinMaxLine()
126 throw( css::uno::RuntimeException );
128 // XServiceName
129 virtual OUString SAL_CALL getServiceName() throw( css::uno::RuntimeException );
131 // XServiceInfo
132 virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException );
133 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
134 throw( css::uno::RuntimeException );
135 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
136 throw( css::uno::RuntimeException );
138 // XRefreshable
139 virtual void SAL_CALL refresh() throw( css::uno::RuntimeException );
140 virtual void SAL_CALL addRefreshListener( const css::uno::Reference< css::util::XRefreshListener >& l )
141 throw( css::uno::RuntimeException );
142 virtual void SAL_CALL removeRefreshListener( const css::uno::Reference< css::util::XRefreshListener >& l )
143 throw( css::uno::RuntimeException );
145 // XLocalizable
146 virtual void SAL_CALL setLocale( const css::lang::Locale& eLocale )
147 throw( css::uno::RuntimeException );
148 virtual css::lang::Locale SAL_CALL getLocale()
149 throw( css::uno::RuntimeException );
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */