X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=launcher%2Fsrc%2Fshortcutappmodel.h;fp=launcher%2Fsrc%2Fshortcutappmodel.h;h=e11e121f0f7ccf216f33a42ceaf6d47c82298255;hb=3508d025b0046fffb337ffceb912947ef1dcf47d;hp=0000000000000000000000000000000000000000;hpb=353da85004c72efb2bd6f117a15713b58e0df866;p=apps%2Flauncher.git diff --git a/launcher/src/shortcutappmodel.h b/launcher/src/shortcutappmodel.h new file mode 100644 index 0000000..e11e121 --- /dev/null +++ b/launcher/src/shortcutappmodel.h @@ -0,0 +1,53 @@ +#ifndef SHORTCUTAPPMODEL_H +#define SHORTCUTAPPMODEL_H + +#include +#include +#include +#include +#include +#include + +struct RegisterApp { + QString id; + QString name; + QString icon; + bool isBlank; +}; + +class ShortcutAppModel : public QAbstractListModel +{ + Q_OBJECT +public: + explicit ShortcutAppModel(QObject *parent = nullptr); + ~ShortcutAppModel(); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash roleNames() const override; + + Q_INVOKABLE QString getId(int index) const; + Q_INVOKABLE QString getName(int index) const; + Q_INVOKABLE QString getIcon(int index) const; + Q_INVOKABLE bool isBlank(int index) const; + +public slots: + void shortcutUpdate(QStringList shortcut_list); + +signals: + void updateShortcut(); + +private: + void init(); + void getAppQueue(); + void setAppQueuePoint(QString id, QString name); + QString getIconPath(QString id); + + class Private; + Private *d; + RegisterApp app; + +}; + +#endif // SHORTCUTAPPMODEL_H