newstuff.h 2.37 KB
Newer Older
Enrico Ros's avatar
Enrico Ros committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/***************************************************************************
 *   Copyright (C) 2005 by Enrico Ros <eros.kde@email.it>                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef _KPDF_NEWSTUFF_H_
#define _KPDF_NEWSTUFF_H_

#include <qdialog.h>
#include <knewstuff/provider.h>
using namespace KNS;
namespace KIO { class JOB; }

class AvailableItem;

class NewStuffDialog : public QDialog
{
    Q_OBJECT
    public:
        NewStuffDialog( QWidget * parent );
        ~NewStuffDialog();

        // show a message in the bottom bar
        enum MessageType { Normal, Info, Error };
29
30
31
32
33
34
35
36
37
38
39
40
41
42
        void displayMessage( const QString & msg,
            MessageType type = Normal, int timeOutMs = 3000 );

        // begin installing that item
        void installItem( AvailableItem * item );

        // remove an already installed item
        void removeItem( AvailableItem * item );

    signals:
        // tells that a file has been installed
        void installedFile( QString fileName, QString type );
        // tells that a file has been removed
        void removedFile( QString oldFileName );
Enrico Ros's avatar
Enrico Ros committed
43
44
45
46
47
48
49
50
51

    private:
        // private storage class
        class NewStuffDialogPrivate * d;

    private slots:
        void slotResetMessageColors();
        void slotNetworkTimeout();
        void slotSortingSelected( int sortType );
52
53
54
55
56
        // providersList loading
        void slotLoadProvidersList();
        void slotProvidersListInfoData( KIO::Job *, const QByteArray & );
        void slotProvidersListResult( KIO::Job * );
        // provider loading
Enrico Ros's avatar
Enrico Ros committed
57
58
59
        void slotLoadProvider( int provider = 0 );
        void slotProviderInfoData( KIO::Job *, const QByteArray & );
        void slotProviderInfoResult( KIO::Job * );
60
61
62
63
64
        // file downloading
        void slotDownloadItem( AvailableItem * );
        void slotItemMessage( KIO::Job *, const QString & );
        void slotItemPercentage( KIO::Job *, unsigned long );
        void slotItemResult( KIO::Job * );
Enrico Ros's avatar
Enrico Ros committed
65
66
67
};

#endif