File indexing completed on 2025-03-09 04:54:13

0001 /*
0002   SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
0003   SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
0004   SPDX-FileCopyrightText: 2010 Leo Franchi <lfranchi@kde.org>
0005 
0006   SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include "messagecore_export.h"
0012 
0013 namespace KMime
0014 {
0015 class Content;
0016 class Message;
0017 }
0018 
0019 namespace MessageCore
0020 {
0021 /**
0022  * @short Contains some static functions for navigating in KMime::Node trees.
0023  */
0024 namespace NodeHelper
0025 {
0026 /**
0027  * Returns the next sibling node of the given @p node.
0028  * If there is no sibling node @c 0 is returned.
0029  */
0030 MESSAGECORE_EXPORT KMime::Content *nextSibling(const KMime::Content *node);
0031 
0032 /**
0033  * Returns the next node (child, sibling or parent) of the given @p node.
0034  *
0035  * @param node The start node for iteration.
0036  * @param allowChildren If @c true child nodes will be returned, otherwise only sibling or parent nodes.
0037  */
0038 MESSAGECORE_EXPORT KMime::Content *next(KMime::Content *node, bool allowChildren = true);
0039 
0040 /**
0041  * Returns the first child node of the given @p node.
0042  * If there is no child node @c 0 is returned.
0043  */
0044 MESSAGECORE_EXPORT KMime::Content *firstChild(const KMime::Content *node);
0045 }
0046 }