split message into several paras and fix file extension markup
[kdepim.git] / knode / knarticlewindow.h
blobc772fd30884b11f8c28134728a66c5d75d34c327
1 /*
2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
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.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 #ifndef KNODE_KNARTICLEWINDOW_H
16 #define KNODE_KNARTICLEWINDOW_H
18 #include "knarticle.h"
19 #include "knarticlecollection.h"
21 #include <kxmlguiwindow.h>
23 #include <QByteArray>
24 #include <QList>
26 namespace KNode {
28 class ArticleWidget;
30 /** A stand-alone article viewer window. */
31 class ArticleWindow : public KXmlGuiWindow {
33 Q_OBJECT
35 public:
36 /** Create a new article window.
37 * @param art The article to show in this window.
39 explicit ArticleWindow( KNArticle::Ptr art );
40 /// Destroy this article viewer window.
41 ~ArticleWindow();
42 /** Returns the article widget of this window. */
43 ArticleWidget* articleWidget() const { return mArticleWidget; }
45 /// List of article windows.
46 typedef QList<KNode::ArticleWindow*> List;
48 /** Close all article windows showing articles from the given collection.
49 * @param col The article collection (folder/group).
50 * @param force Really close the windows.
51 * @return true if all windows have been closed.
53 static bool closeAllWindowsForCollection( KNArticleCollection::Ptr col, bool force = true );
54 /** Clise all windows showing the given article.
55 * @param art Close all windows showing this article.
56 * @param force Really close the windows.
57 * @return true if all windows have been closed.
59 static bool closeAllWindowsForArticle( KNArticle::Ptr art, bool force = true );
60 /** Raise the article window for the given article.
61 * @param art The article.
62 * @return false if no article window was found.
64 static bool raiseWindowForArticle( KNArticle::Ptr art );
65 /** Raise the article window showing a specific article.
66 * @param mid Message-ID of the article.
67 * @return false if no article was found.
69 static bool raiseWindowForArticle(const QByteArray &mid);
71 protected:
72 /// The article widget of this window.
73 ArticleWidget *mArticleWidget;
74 /// List of all article windows.
75 static List mInstances;
80 #endif // KNODE_KNARTICLEWINDOW_H