1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_AXISWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_AXISWRAPPER_HXX
22 #include "WrappedPropertySet.hxx"
23 #include "ReferenceSizePropertyProvider.hxx"
24 #include <cppuhelper/implbase5.hxx>
25 #include <comphelper/uno3.hxx>
26 #include <cppuhelper/interfacecontainer.hxx>
27 #include <com/sun/star/chart/XAxis.hpp>
28 #include <com/sun/star/chart2/XAxis.hpp>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/drawing/XShape.hpp>
31 #include <com/sun/star/lang/XComponent.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
36 #include <boost/shared_ptr.hpp>
42 class Chart2ModelContact
;
44 class AxisWrapper
: public ::cppu::ImplInheritanceHelper5
<
46 , com::sun::star::chart::XAxis
47 , com::sun::star::drawing::XShape
48 , com::sun::star::lang::XComponent
49 , com::sun::star::lang::XServiceInfo
50 , com::sun::star::util::XNumberFormatsSupplier
52 , public ReferenceSizePropertyProvider
64 AxisWrapper( tAxisType eType
, ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
65 virtual ~AxisWrapper();
67 static void getDimensionAndMainAxisBool( tAxisType eType
, sal_Int32
& rnDimensionIndex
, bool& rbMainAxis
);
69 /// XServiceInfo declarations
70 virtual OUString SAL_CALL
getImplementationName()
71 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
73 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
75 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
77 static OUString
getImplementationName_Static();
78 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
80 //ReferenceSizePropertyProvider
81 virtual void updateReferenceSize() SAL_OVERRIDE
;
82 virtual ::com::sun::star::uno::Any
getReferenceSize() SAL_OVERRIDE
;
83 virtual ::com::sun::star::awt::Size
getCurrentSizeForReference() SAL_OVERRIDE
;
85 // ____ XComponent ____
86 virtual void SAL_CALL
dispose()
87 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
<
89 ::com::sun::star::lang::XEventListener
>& xListener
)
90 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
<
92 ::com::sun::star::lang::XEventListener
>& aListener
)
93 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 // ____ chart::XAxis ____
96 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getAxisTitle( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getMajorGrid( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
getMinorGrid( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 virtual ::com::sun::star::awt::Point SAL_CALL
getPosition()
102 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 virtual void SAL_CALL
setPosition( const ::com::sun::star::awt::Point
& aPosition
)
104 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 virtual ::com::sun::star::awt::Size SAL_CALL
getSize()
106 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 virtual void SAL_CALL
setSize( const ::com::sun::star::awt::Size
& aSize
)
108 throw (::com::sun::star::beans::PropertyVetoException
,
109 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 // ____ XShapeDescriptor (base of XShape) ____
112 virtual OUString SAL_CALL
getShapeType()
113 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 // ____ XNumberFormatsSupplier ____
116 virtual ::com::sun::star::uno::Reference
<
117 ::com::sun::star::beans::XPropertySet
> SAL_CALL
getNumberFormatSettings()
118 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
119 virtual ::com::sun::star::uno::Reference
<
120 ::com::sun::star::util::XNumberFormats
> SAL_CALL
getNumberFormats()
121 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 // ____ WrappedPropertySet ____
125 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence() SAL_OVERRIDE
;
126 virtual const std::vector
< WrappedProperty
* > createWrappedProperties() SAL_OVERRIDE
;
127 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getInnerPropertySet() SAL_OVERRIDE
;
130 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
> getAxis();
133 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
134 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer
;
138 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xAxisTitle
;
139 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xMajorGrid
;
140 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xMinorGrid
;
143 } // namespace wrapper
146 // INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_AXISWRAPPER_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */