Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / inc / doctreenode.hxx
blob008979651b8ab32d4d5198646c92a3b2c2dae695
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 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
23 #include <sal/types.h>
24 #include <vector>
27 /* Definition of DocTreeNode class */
29 namespace slideshow
31 namespace internal
34 /** This class represents kind of a DOM tree node for shape
35 text
37 In order to animate subsets of shape text, we need
38 information about the logical and formatting structure of
39 that text (lines, paragraphs, words etc.). This is
40 represented in a tree structure, with DocTreeNodes as the
41 nodes. Instances of this class can be queried from the
42 DocTreeNodeSupplier interface.
44 This class has nothing to do with the Draw document tree.
46 class DocTreeNode
48 public:
49 /// Type of shape entity represented by this node
50 enum class NodeType
52 Invalid=0,
54 /// This node represents a paragraph
55 LogicalParagraph=129,
56 /// This node represents a word
57 LogicalWord=131,
58 /// This node represents a character
59 LogicalCharacterCell=132
62 /** Create empty tree node
64 DocTreeNode() :
65 mnStartIndex(-1),
66 mnEndIndex(-1)
70 /** Create tree node from start and end index.
72 Create a tree node for the given range and type.
74 @param nStartIndex
75 Start index
77 @param nEndIndex
78 End index (exclusive)
80 @param eType
81 Node type
83 DocTreeNode( sal_Int32 nStartIndex,
84 sal_Int32 nEndIndex ) :
85 mnStartIndex(nStartIndex),
86 mnEndIndex(nEndIndex)
90 bool isEmpty() const { return mnStartIndex == mnEndIndex; }
92 sal_Int32 getStartIndex() const { return mnStartIndex; }
93 void setStartIndex( sal_Int32 nIndex ) { mnStartIndex = nIndex; }
94 sal_Int32 getEndIndex() const { return mnEndIndex; }
95 void setEndIndex( sal_Int32 nIndex ) { mnEndIndex = nIndex; }
97 void reset()
99 mnStartIndex = -1;
100 mnEndIndex = -1;
103 private:
104 sal_Int32 mnStartIndex;
105 sal_Int32 mnEndIndex;
109 typedef ::std::vector< DocTreeNode > VectorOfDocTreeNodes;
113 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */