split message into several paras and fix file extension markup
[kdepim.git] / knode / kncleanup.h
blob628771bde4f7febd28a98ea4e1c63f6004870539
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 KNCLEANUP_H
16 #define KNCLEANUP_H
18 #include "knarticlecollection.h"
19 #include "kngroup.h"
21 #include <QList>
22 #include <KDialog>
24 class QProgressBar;
25 class QCloseEvent;
26 class QLabel;
28 class KNFolder;
30 namespace KNode {
31 class Cleanup;
35 /** This class handles group expiration and folder compaction. */
36 class KNCleanUp {
38 public:
39 KNCleanUp();
40 ~KNCleanUp();
42 /**
43 * Add a collection to handle.
45 void appendCollection( KNArticleCollection::Ptr c )
46 { mColList.append( c ); }
47 void start();
48 void reset();
50 void expireGroup( KNGroup::Ptr g, bool showResult = false );
51 /** Compacts the given folder, ie. remove all deleted messages from the
52 * mbox file.
53 * @param f The folder to compact.
55 void compactFolder( KNFolder::Ptr f );
57 protected:
59 /** Cleanup progress dialog. */
60 class ProgressDialog : public KDialog {
62 public:
63 /** Creates a new progress dialog.
64 * @param steps The number of progress steps.
65 * @param parent The parent widget.
67 explicit ProgressDialog( int steps, QWidget *parent = 0 );
68 ~ProgressDialog();
70 /** Shows a message in the progress dialog.
71 * @param s The message to show.
73 void showMessage(const QString &s);
74 /** Increments the progress counter by one. */
75 void doProgress();
77 protected:
78 void closeEvent(QCloseEvent *e);
80 QLabel *m_sg;
81 QProgressBar *mProgressBar;
84 ProgressDialog *d_lg;
85 KNArticleCollection::List mColList;
89 #endif