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 .
21 #include <ObjectIdentifier.hxx>
23 namespace com::sun::star::awt
{ struct KeyEvent
; }
24 namespace com::sun::star::chart2
{ class XChartDocument
; }
32 class ExplicitValueProvider
;
36 class ImplObjectHierarchy
;
42 typedef std::vector
< ObjectIdentifier
> tChildContainer
;
44 /** @param bFlattenDiagram
45 If <TRUE/>, the content of the diagram (data series, wall, floor,
46 etc.) is treated as being at the same level as the diagram. (This is
47 used for keyboard navigation).
49 explicit ObjectHierarchy(
50 const css::uno::Reference
< css::chart2::XChartDocument
> & xChartDocument
,
51 ExplicitValueProvider
* pExplicitValueProvider
,
52 bool bFlattenDiagram
= false,
53 bool bOrderingForElementSelector
= false );
56 static ObjectIdentifier
getRootNodeOID();
57 static bool isRootNode( const ObjectIdentifier
& rOID
);
59 /// equal to getChildren( getRootNodeOID())
60 tChildContainer
getTopLevelChildren() const;
61 bool hasChildren( const ObjectIdentifier
& rParent
) const;
62 tChildContainer
getChildren( const ObjectIdentifier
& rParent
) const;
64 tChildContainer
getSiblings( const ObjectIdentifier
& rNode
) const;
66 /// The result is empty, if the node cannot be found in the tree
67 ObjectIdentifier
getParent( const ObjectIdentifier
& rNode
) const;
68 /// @returns -1, if no parent can be determined
69 sal_Int32
getIndexInParent( const ObjectIdentifier
& rNode
) const;
73 std::unique_ptr
< impl::ImplObjectHierarchy
> m_apImpl
;
76 class ObjectKeyNavigation
79 explicit ObjectKeyNavigation( const ObjectIdentifier
& rCurrentOID
,
80 const css::uno::Reference
< css::chart2::XChartDocument
> & xChartDocument
,
81 ExplicitValueProvider
* pExplicitValueProvider
);
83 bool handleKeyEvent( const css::awt::KeyEvent
& rEvent
);
84 const ObjectIdentifier
& getCurrentSelection() const { return m_aCurrentOID
;}
87 void setCurrentSelection( const ObjectIdentifier
& rOID
);
97 ObjectIdentifier m_aCurrentOID
;
98 css::uno::Reference
< css::chart2::XChartDocument
> m_xChartDocument
;
99 ExplicitValueProvider
* m_pExplicitValueProvider
;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */