~noskcaj/ubuntu/vivid/xfce4-whiskermenu-plugin/1.4.3

« back to all changes in this revision

Viewing changes to src/category.hpp

  • Committer: Package Import Robot
  • Author(s): Yves-Alexis Perez, Jackson Doak
  • Date: 2013-11-09 00:31:47 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131109003147-5o9092rpgh89xnj8
Tags: 1.2.0-1
[ Jackson Doak ]
* New upstream release
* Drop manpage, included upstream
* debian/docs: Install NEWS as the changelog, don't install CREDITS
* debian/control: Remove bad character from desciption

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#ifndef WHISKERMENU_CATEGORY_HPP
18
18
#define WHISKERMENU_CATEGORY_HPP
19
19
 
20
 
#include <algorithm>
 
20
#include "launcher.hpp"
 
21
 
21
22
#include <vector>
22
23
 
23
24
extern "C"
31
32
class Launcher;
32
33
class SectionButton;
33
34
 
34
 
class Category
 
35
class Category : public Element
35
36
{
36
37
public:
37
38
        explicit Category(GarconMenuDirectory* directory);
38
39
        ~Category();
39
40
 
40
 
        SectionButton* get_button() const
41
 
        {
42
 
                return m_button;
43
 
        }
44
 
 
45
 
        bool contains(Launcher* launcher) const
46
 
        {
47
 
                return std::find(m_items.begin(), m_items.end(), launcher) != m_items.end();
48
 
        }
49
 
 
50
 
        bool empty() const
51
 
        {
52
 
                return m_items.empty();
53
 
        }
54
 
 
55
 
        void push_back(Launcher* launcher)
56
 
        {
 
41
        enum
 
42
        {
 
43
                Type = 1
 
44
        };
 
45
        int get_type() const
 
46
        {
 
47
                return Type;
 
48
        }
 
49
 
 
50
        SectionButton* get_button();
 
51
 
 
52
        GtkTreeModel* get_model();
 
53
 
 
54
        bool empty() const;
 
55
 
 
56
        bool has_separators() const
 
57
        {
 
58
                return m_has_separators;
 
59
        }
 
60
 
 
61
        void append_item(Launcher* launcher)
 
62
        {
 
63
                unset_model();
57
64
                m_items.push_back(launcher);
58
65
        }
59
66
 
60
 
private:
61
 
        std::vector<Launcher*> m_items;
 
67
        Category* append_menu(GarconMenuDirectory* directory);
 
68
 
 
69
        void append_separator();
 
70
 
 
71
        void sort();
 
72
 
 
73
private:
 
74
        void insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gchar* fallback_icon);
 
75
        void insert_items(GtkListStore* model);
 
76
        void merge();
 
77
        void unset_model();
 
78
 
 
79
private:
62
80
        SectionButton* m_button;
 
81
        std::vector<Element*> m_items;
 
82
        GtkTreeModel* m_model;
 
83
        bool m_has_separators;
 
84
        bool m_has_subcategories;
63
85
};
64
86
 
65
87
}