Messagelib

messagecore/src/helpers/nodehelper.h
1/*
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
3 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
4 SPDX-FileCopyrightText: 2010 Leo Franchi <lfranchi@kde.org>
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "messagecore_export.h"
12
13namespace KMime
14{
15class Content;
16class Message;
17}
18
19namespace MessageCore
20{
21/**
22 * @short Contains some static functions for navigating in KMime::Node trees.
23 */
24namespace NodeHelper
25{
26/**
27 * Returns the next sibling node of the given @p node.
28 * If there is no sibling node @c 0 is returned.
29 */
30MESSAGECORE_EXPORT KMime::Content *nextSibling(const KMime::Content *node);
31
32/**
33 * Returns the next node (child, sibling or parent) of the given @p node.
34 *
35 * @param node The start node for iteration.
36 * @param allowChildren If @c true child nodes will be returned, otherwise only sibling or parent nodes.
37 */
38MESSAGECORE_EXPORT KMime::Content *next(KMime::Content *node, bool allowChildren = true);
39
40/**
41 * Returns the first child node of the given @p node.
42 * If there is no child node @c 0 is returned.
43 */
44MESSAGECORE_EXPORT KMime::Content *firstChild(const KMime::Content *node);
45}
46}
MESSAGECORE_EXPORT KMime::Content * firstChild(const KMime::Content *node)
Returns the first child node of the given node.
MESSAGECORE_EXPORT KMime::Content * next(KMime::Content *node, bool allowChildren=true)
Returns the next node (child, sibling or parent) of the given node.
MESSAGECORE_EXPORT KMime::Content * nextSibling(const KMime::Content *node)
Returns the next sibling node of the given node.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.