2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-11-26 18:14:50 +00:00
|
|
|
|
2014-04-18 22:23:58 +02:00
|
|
|
#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
|
|
|
|
#define INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
|
2004-11-26 18:14:50 +00:00
|
|
|
|
|
|
|
#include <sal/types.h>
|
|
|
|
#include <vector>
|
|
|
|
|
2005-03-30 07:13:33 +00:00
|
|
|
|
2004-11-26 18:14:50 +00:00
|
|
|
/* Definition of DocTreeNode class */
|
|
|
|
|
2006-12-13 14:54:44 +00:00
|
|
|
namespace slideshow
|
2004-11-26 18:14:50 +00:00
|
|
|
{
|
|
|
|
namespace internal
|
|
|
|
{
|
|
|
|
|
2005-03-30 07:13:33 +00:00
|
|
|
/** This class represents kind of a DOM tree node for shape
|
|
|
|
text
|
2004-11-26 18:14:50 +00:00
|
|
|
|
|
|
|
In order to animate subsets of shape text, we need
|
|
|
|
information about the logical and formatting structure of
|
|
|
|
that text (lines, paragraphs, words etc.). This is
|
|
|
|
represented in a tree structure, with DocTreeNodes as the
|
2005-03-30 07:13:33 +00:00
|
|
|
nodes. Instances of this class can be queried from the
|
|
|
|
DocTreeNodeSupplier interface.
|
2004-11-26 18:14:50 +00:00
|
|
|
|
|
|
|
This class has nothing to do with the Draw document tree.
|
|
|
|
*/
|
|
|
|
class DocTreeNode
|
|
|
|
{
|
|
|
|
public:
|
2005-03-30 07:13:33 +00:00
|
|
|
/// Type of shape entity represented by this node
|
2017-02-14 15:52:53 +02:00
|
|
|
enum class NodeType
|
2004-11-26 18:14:50 +00:00
|
|
|
{
|
2017-02-14 15:52:53 +02:00
|
|
|
Invalid=0,
|
2004-11-26 18:14:50 +00:00
|
|
|
|
2005-03-30 07:13:33 +00:00
|
|
|
/// This node represents a paragraph
|
2017-02-14 15:52:53 +02:00
|
|
|
LogicalParagraph=129,
|
2005-03-30 07:13:33 +00:00
|
|
|
/// This node represents a word
|
2017-02-14 15:52:53 +02:00
|
|
|
LogicalWord=131,
|
2005-03-30 07:13:33 +00:00
|
|
|
/// This node represents a character
|
2017-02-14 15:52:53 +02:00
|
|
|
LogicalCharacterCell=132
|
2004-11-26 18:14:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Create empty tree node
|
|
|
|
*/
|
|
|
|
DocTreeNode() :
|
|
|
|
mnStartIndex(-1),
|
2017-07-03 13:10:00 +02:00
|
|
|
mnEndIndex(-1)
|
2004-11-26 18:14:50 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Create tree node from start and end index.
|
|
|
|
|
|
|
|
Create a tree node for the given range and type.
|
|
|
|
|
|
|
|
@param nStartIndex
|
|
|
|
Start index
|
|
|
|
|
|
|
|
@param nEndIndex
|
|
|
|
End index (exclusive)
|
|
|
|
|
|
|
|
@param eType
|
|
|
|
Node type
|
|
|
|
*/
|
2005-03-30 07:13:33 +00:00
|
|
|
DocTreeNode( sal_Int32 nStartIndex,
|
2017-07-03 13:10:00 +02:00
|
|
|
sal_Int32 nEndIndex ) :
|
2004-11-26 18:14:50 +00:00
|
|
|
mnStartIndex(nStartIndex),
|
2017-07-03 13:10:00 +02:00
|
|
|
mnEndIndex(nEndIndex)
|
2004-11-26 18:14:50 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-03-30 07:13:33 +00:00
|
|
|
bool isEmpty() const { return mnStartIndex == mnEndIndex; }
|
2004-11-26 18:14:50 +00:00
|
|
|
|
|
|
|
sal_Int32 getStartIndex() const { return mnStartIndex; }
|
|
|
|
sal_Int32 getEndIndex() const { return mnEndIndex; }
|
|
|
|
void setEndIndex( sal_Int32 nIndex ) { mnEndIndex = nIndex; }
|
|
|
|
|
2005-10-11 07:49:23 +00:00
|
|
|
void reset()
|
|
|
|
{
|
|
|
|
mnStartIndex = -1;
|
|
|
|
mnEndIndex = -1;
|
|
|
|
}
|
|
|
|
|
2004-11-26 18:14:50 +00:00
|
|
|
private:
|
2005-03-30 07:13:33 +00:00
|
|
|
sal_Int32 mnStartIndex;
|
|
|
|
sal_Int32 mnEndIndex;
|
2004-11-26 18:14:50 +00:00
|
|
|
|
|
|
|
};
|
2005-03-30 07:13:33 +00:00
|
|
|
|
|
|
|
typedef ::std::vector< DocTreeNode > VectorOfDocTreeNodes;
|
2004-11-26 18:14:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-18 22:23:58 +02:00
|
|
|
#endif // INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODE_HXX
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|