SVN_SILENT made messages (.desktop file)
[kdepim.git] / messagecore / nodehelper.h
blobdf5813a557bbd141cb6600ea7666a8d2ef7f3d1a
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
3 Copyright (c) 2009 Andras Mantia <andras@kdab.net>
4 Copyright (c) 2010 Leo Franchi <lfranchi@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef MESSAGECORE_NODEHELPER_H
22 #define MESSAGECORE_NODEHELPER_H
24 #include "messagecore_export.h"
26 namespace KMime {
27 class Content;
28 class Message;
31 namespace MessageCore {
33 /**
34 * @short Contains some static functions for nagivating in KMime::Node trees.
36 namespace NodeHelper {
38 /**
39 * Returns the next sibling node of the given @p node.
40 * If there is no sibling node @c 0 is returned.
42 MESSAGECORE_EXPORT KMime::Content *nextSibling( const KMime::Content *node );
44 /**
45 * Returns the next node (child, sibling or parent) of the given @p node.
47 * @param node The start node for iteration.
48 * @param allowChildren If @c true child nodes will be returned, otherwise only sibling or parent nodes.
50 MESSAGECORE_EXPORT KMime::Content *next( KMime::Content *node, bool allowChildren = true );
52 /**
53 * Returns the first child node of the given @p node.
54 * If there is no child node @c 0 is returned.
56 MESSAGECORE_EXPORT KMime::Content *firstChild( const KMime::Content *node );
58 /**
59 * Returns whether the given @p node is an attachment.
61 * @todo The node parameters here should be const, be there is no const version of
62 * functions like contentDisposition() yet
64 MESSAGECORE_EXPORT bool isAttachment( KMime::Content *node );
66 /**
67 * Returns whether the given @p node is an attachment.
69 * In opposite to isAttachment() some additional tests are executed which
70 * might however return a false result.
72 * @todo The node parameters here should be const, be there is no const version of
73 * functions like contentDisposition() yet
75 MESSAGECORE_EXPORT bool isHeuristicalAttachment( KMime::Content* node );
80 #endif