Changeset View
Changeset View
Standalone View
Standalone View
sidebar/SidebarMode.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 45 | { | |||
---|---|---|---|---|---|
47 | 47 | | |||
48 | Q_PROPERTY(QAbstractItemModel *categoryModel READ categoryModel CONSTANT) | 48 | Q_PROPERTY(QAbstractItemModel *categoryModel READ categoryModel CONSTANT) | ||
49 | Q_PROPERTY(QAbstractItemModel *subCategoryModel READ subCategoryModel CONSTANT) | 49 | Q_PROPERTY(QAbstractItemModel *subCategoryModel READ subCategoryModel CONSTANT) | ||
50 | Q_PROPERTY(QAbstractItemModel *mostUsedModel READ mostUsedModel CONSTANT) | 50 | Q_PROPERTY(QAbstractItemModel *mostUsedModel READ mostUsedModel CONSTANT) | ||
51 | Q_PROPERTY(int activeCategory READ activeCategory WRITE setActiveCategory NOTIFY activeCategoryChanged) | 51 | Q_PROPERTY(int activeCategory READ activeCategory WRITE setActiveCategory NOTIFY activeCategoryChanged) | ||
52 | Q_PROPERTY(int activeSubCategory READ activeSubCategory WRITE setActiveSubCategory NOTIFY activeSubCategoryChanged) | 52 | Q_PROPERTY(int activeSubCategory READ activeSubCategory WRITE setActiveSubCategory NOTIFY activeSubCategoryChanged) | ||
53 | Q_PROPERTY(int width READ width NOTIFY widthChanged) | 53 | Q_PROPERTY(int width READ width NOTIFY widthChanged) | ||
54 | Q_PROPERTY(bool actionMenuVisible READ actionMenuVisible NOTIFY actionMenuVisibleChanged) | 54 | Q_PROPERTY(bool actionMenuVisible READ actionMenuVisible NOTIFY actionMenuVisibleChanged) | ||
55 | Q_PROPERTY(bool introPageVisible READ introPageVisible WRITE setIntroPageVisible NOTIFY introPageVisibleChanged) | ||||
55 | 56 | | |||
56 | public: | 57 | public: | ||
57 | SidebarMode(QObject * parent, const QVariantList& ); | 58 | SidebarMode(QObject * parent, const QVariantList& ); | ||
58 | ~SidebarMode() override; | 59 | ~SidebarMode() override; | ||
59 | QWidget * mainWidget() override; | 60 | QWidget * mainWidget() override; | ||
60 | void initEvent() override; | 61 | void initEvent() override; | ||
61 | void giveFocus() override; | 62 | void giveFocus() override; | ||
62 | KAboutData * aboutData() override; | 63 | KAboutData * aboutData() override; | ||
63 | ModuleView * moduleView() const override; | 64 | ModuleView * moduleView() const override; | ||
64 | QAbstractItemModel *categoryModel() const; | 65 | QAbstractItemModel *categoryModel() const; | ||
65 | QAbstractItemModel *subCategoryModel() const; | 66 | QAbstractItemModel *subCategoryModel() const; | ||
66 | QAbstractItemModel *mostUsedModel() const; | 67 | QAbstractItemModel *mostUsedModel() const; | ||
67 | 68 | | |||
68 | int activeCategory() const; | 69 | int activeCategory() const; | ||
69 | void setActiveCategory(int cat); | 70 | void setActiveCategory(int cat); | ||
70 | 71 | | |||
71 | int activeSubCategory() const; | 72 | int activeSubCategory() const; | ||
72 | void setActiveSubCategory(int cat); | 73 | void setActiveSubCategory(int cat); | ||
73 | 74 | | |||
74 | int width() const; | 75 | int width() const; | ||
75 | 76 | | |||
76 | bool actionMenuVisible() const; | 77 | bool actionMenuVisible() const; | ||
77 | 78 | | |||
79 | bool introPageVisible() const; | ||||
80 | void setIntroPageVisible(const bool &introPageVisible); | ||||
81 | | ||||
78 | Q_INVOKABLE QAction *action(const QString &name) const; | 82 | Q_INVOKABLE QAction *action(const QString &name) const; | ||
79 | // QML doesn't understand QIcon, otherwise we could get it from the QAction itself | 83 | // QML doesn't understand QIcon, otherwise we could get it from the QAction itself | ||
80 | Q_INVOKABLE QString actionIconName(const QString &name) const; | 84 | Q_INVOKABLE QString actionIconName(const QString &name) const; | ||
81 | Q_INVOKABLE void requestToolTip(int index, const QRectF &rect); | 85 | Q_INVOKABLE void requestToolTip(int index, const QRectF &rect); | ||
82 | Q_INVOKABLE void requestSubCategoryToolTip(int index, const QRectF &rect); | 86 | Q_INVOKABLE void requestSubCategoryToolTip(int index, const QRectF &rect); | ||
83 | Q_INVOKABLE void hideToolTip(); | 87 | Q_INVOKABLE void hideToolTip(); | ||
84 | Q_INVOKABLE void hideSubCategoryToolTip(); | 88 | Q_INVOKABLE void hideSubCategoryToolTip(); | ||
85 | Q_INVOKABLE void loadMostUsed(int index); | 89 | Q_INVOKABLE void loadMostUsed(int index); | ||
86 | Q_INVOKABLE void showActionMenu(const QPoint &position); | 90 | Q_INVOKABLE void showActionMenu(const QPoint &position); | ||
87 | 91 | | |||
88 | protected: | 92 | protected: | ||
89 | QList<QAbstractItemView*> views() const override; | 93 | QList<QAbstractItemView*> views() const override; | ||
90 | bool eventFilter(QObject* watched, QEvent* event) override; | 94 | bool eventFilter(QObject* watched, QEvent* event) override; | ||
91 | 95 | | |||
92 | private Q_SLOTS: | 96 | private Q_SLOTS: | ||
93 | void changeModule( const QModelIndex& activeModule ); | 97 | void changeModule( const QModelIndex& activeModule ); | ||
94 | void moduleLoaded(); | 98 | void moduleLoaded(); | ||
95 | void initWidget(); | 99 | void initWidget(); | ||
96 | 100 | | |||
97 | Q_SIGNALS: | 101 | Q_SIGNALS: | ||
98 | void activeCategoryChanged(); | 102 | void activeCategoryChanged(); | ||
99 | void activeSubCategoryChanged(); | 103 | void activeSubCategoryChanged(); | ||
100 | void widthChanged(); | 104 | void widthChanged(); | ||
101 | void actionMenuVisibleChanged(); | 105 | void actionMenuVisibleChanged(); | ||
106 | void introPageVisibleChanged(); | ||||
102 | 107 | | |||
103 | private: | 108 | private: | ||
104 | class Private; | 109 | class Private; | ||
105 | Private *const d; | 110 | Private *const d; | ||
106 | }; | 111 | }; | ||
107 | 112 | | |||
108 | #endif | 113 | #endif |