1 /*
2  * Copyright (C) 2013-2021 Graeme Gott <graeme@gottcode.org>
3  *
4  * This library is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef WHISKERMENU_FAVORITES_PAGE_H
19 #define WHISKERMENU_FAVORITES_PAGE_H
20 
21 #include "page.h"
22 
23 #include <vector>
24 
25 namespace WhiskerMenu
26 {
27 
28 class FavoritesPage : public Page
29 {
30 public:
31 	explicit FavoritesPage(Window* window);
32 	~FavoritesPage();
33 
34 	bool contains(Launcher* launcher) const;
35 
36 	void add(Launcher* launcher);
37 	void remove(Launcher* launcher);
38 	void set_menu_items();
39 	void unset_menu_items();
40 
41 private:
42 	void extend_context_menu(GtkWidget* menu) override;
43 	bool remember_launcher(Launcher* launcher) override;
44 	void on_row_changed(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter);
45 	void on_row_inserted(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter);
46 	void on_row_deleted(GtkTreePath* path);
47 	std::vector<Launcher*> sort() const;
48 	void sort_ascending();
49 	void sort_descending();
50 	void view_created() override;
51 };
52 
53 }
54 
55 #endif // WHISKERMENU_FAVORITES_PAGE_H
56