File: UpdateItem.h

package info (click to toggle)
plasma-discover 6.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,288 kB
  • sloc: cpp: 30,576; xml: 2,710; python: 311; sh: 5; makefile: 5
file content (77 lines) | stat: -rw-r--r-- 1,619 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 *   SPDX-FileCopyrightText: 2011 Jonathan Thomas <echidnaman@kubuntu.org>
 *
 *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
 */

#pragma once

// Qt includes
#include "discovercommon_export.h"
#include "resources/AbstractBackendUpdater.h"
#include <QSet>
#include <QString>

#include <QIcon>

class AbstractResource;
class DISCOVERCOMMON_EXPORT UpdateItem
{
public:
    explicit UpdateItem(AbstractResource *app);

    ~UpdateItem();

    void setProgress(qreal progress);
    qreal progress() const;

    AbstractBackendUpdater::State state() const
    {
        return m_state;
    }
    void setState(AbstractBackendUpdater::State state)
    {
        m_state = state;
    }

    QString changelog() const;
    void setChangelog(const QString &changelog);

    AbstractResource *app() const;
    QString name() const;
    QVariant icon() const;
    qint64 size() const;
    Qt::CheckState checked() const;

    void setExtended(bool extended)
    {
        m_isExtended = extended;
    }
    AbstractResource *resource() const
    {
        return m_app;
    }
    bool isVisible() const
    {
        return m_visible;
    }
    bool isExtended() const
    {
        return m_isExtended;
    }
    void setVisible(bool visible)
    {
        m_visible = visible;
    }

private:
    AbstractResource *const m_app;

    const QString m_categoryName;
    const QIcon m_categoryIcon;
    qreal m_progress = 0.;
    bool m_visible = true;
    AbstractBackendUpdater::State m_state = AbstractBackendUpdater::None;
    QString m_changelog;
    bool m_isExtended = false;
};