part.h 2.43 KB
Newer Older
1 2
/***********************************************************************
* Copyright 2003-2004  Max Howell <max.howell@methylblue.com>
3
* Copyright 2008-2009  Martin Sandsmark <martin.sandsmark@kde.org>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
*
* 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) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/

#ifndef FILELIGHTPART_H
#define FILELIGHTPART_H

25
#include <QUrl>
26

27 28
#include <KXmlGuiWindow>

29 30
class KJob;
class QLabel;
31

32 33 34
namespace RadialMap {
class Widget;
}
35
class Folder;
36 37 38 39


namespace Filelight
{
40
class Part;
41
class SummaryWidget;
42

43 44
class Part : public
//        KParts::ReadOnlyPart
45
        KXmlGuiWindow
46 47
{
    Q_OBJECT
48

49 50
public:
    Part(QWidget *, QObject *, const QList<QVariant>&);
51

52
    virtual bool openFile();
53
    virtual bool closeUrl();
54

55
    QString prettyUrl() const;
56

57 58 59 60 61 62
signals:
    void started(KJob *);
    void completed();
    void canceled(QString);
    void setWindowCaption(QString);

63
public slots:
64
    virtual bool openUrl(const QUrl&);
65 66
    void configFilelight();
    void rescan();
67

68 69
private slots:
    void postInit();
70 71
    void scanCompleted(Folder*);
    void mapChanged(const Folder*);
72

73
private:
74
    void showSummary();
75

76
    QLayout            *m_layout;
77
    SummaryWidget      *m_summary;
78
    RadialMap::Widget  *m_map;
79
    QWidget            *m_stateWidget;
80
    class ScanManager  *m_manager;
81
    QLabel             *m_numberOfFiles;
82

83
    bool m_started;
84

85
private:
86
    bool start(const QUrl&);
87

88
private slots:
89
    void updateURL(const QUrl &);
90 91 92 93 94 95 96 97 98 99 100


    // Compat
public:
    QUrl url() const;
    QWidget *widget() const;
private:
    void setUrl(const QUrl &url);
    void setWidget(QWidget *widget);
    QWidget *m_widget = nullptr;
    QUrl m_url;
101
};
102

103 104 105
}

#endif