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_INC_OBJECTHIERARCHY_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_OBJECTHIERARCHY_HXX
22 #include "ObjectIdentifier.hxx"
24 #include <rtl/ustring.hxx>
25 #include <com/sun/star/chart2/XChartDocument.hpp>
26 #include <com/sun/star/awt/KeyEvent.hpp>
34 class ExplicitValueProvider
;
38 class ImplObjectHierarchy
;
44 typedef ObjectIdentifier tOID
;
45 typedef ::std::vector
< tOID
> tChildContainer
;
47 /** @param bFlattenDiagram
48 If <TRUE/>, the content of the diaram (data series, wall, floor,
49 etc.) is treated as being at the same level as the diagram. (This is
50 used for keyboard navigation).
52 explicit ObjectHierarchy(
53 const ::com::sun::star::uno::Reference
<
54 ::com::sun::star::chart2::XChartDocument
> & xChartDocument
,
55 ExplicitValueProvider
* pExplicitValueProvider
= 0,
56 bool bFlattenDiagram
= false,
57 bool bOrderingForElementSelector
= false );
60 static tOID
getRootNodeOID();
61 static bool isRootNode( const tOID
& rOID
);
63 /// equal to getChildren( getRootNodeOID())
64 tChildContainer
getTopLevelChildren() const;
65 bool hasChildren( const tOID
& rParent
) const;
66 tChildContainer
getChildren( const tOID
& rParent
) const;
68 tChildContainer
getSiblings( const tOID
& rNode
) const;
70 /// The result is empty, if the node cannot be found in the tree
71 tOID
getParent( const tOID
& rNode
) const;
72 /// @returns -1, if no parent can be determined
73 sal_Int32
getIndexInParent( const tOID
& rNode
) const;
77 ::std::unique_ptr
< impl::ImplObjectHierarchy
> m_apImpl
;
80 class ObjectKeyNavigation
83 explicit ObjectKeyNavigation( const ObjectHierarchy::tOID
& rCurrentOID
,
84 const ::com::sun::star::uno::Reference
<
85 ::com::sun::star::chart2::XChartDocument
> & xChartDocument
,
86 ExplicitValueProvider
* pExplicitValueProvider
= 0 );
88 bool handleKeyEvent( const ::com::sun::star::awt::KeyEvent
& rEvent
);
89 ObjectHierarchy::tOID
getCurrentSelection() const { return m_aCurrentOID
;}
92 void setCurrentSelection( const ObjectHierarchy::tOID
& rOID
);
102 ObjectHierarchy::tOID m_aCurrentOID
;
103 ::com::sun::star::uno::Reference
<
104 ::com::sun::star::chart2::XChartDocument
> m_xChartDocument
;
105 ExplicitValueProvider
* m_pExplicitValueProvider
;
106 bool m_bStepDownInDiagram
;
111 // INCLUDED_CHART2_SOURCE_CONTROLLER_INC_OBJECTHIERARCHY_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */