fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / inc / ObjectHierarchy.hxx
blob67e4fcf8a485e503718f21d967f6c7490103d721
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 .
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>
28 #include <memory>
29 #include <vector>
31 namespace chart
34 class ExplicitValueProvider;
36 namespace impl
38 class ImplObjectHierarchy;
41 class ObjectHierarchy
43 public:
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 );
58 ~ObjectHierarchy();
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;
75 private:
77 ::std::unique_ptr< impl::ImplObjectHierarchy > m_apImpl;
80 class ObjectKeyNavigation
82 public:
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;}
91 private:
92 void setCurrentSelection( const ObjectHierarchy::tOID& rOID );
93 bool first();
94 bool last();
95 bool next();
96 bool previous();
97 bool up();
98 bool down();
99 bool veryFirst();
100 bool veryLast();
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;
109 } // namespace chart
111 // INCLUDED_CHART2_SOURCE_CONTROLLER_INC_OBJECTHIERARCHY_HXX
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */