1
// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
3
* Copyright (c) 2014-2015 elementary LLC. (https://elementary.io)
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
* Authored by: Corentin Noël <corentin@elementary.io>
23
public static Gee.TreeSet<Widgets.CategoryItem> get_app_categories () {
24
var items = new Gee.TreeSet<Widgets.CategoryItem> ();
25
items.add (get_audio_category ());
26
items.add (get_development_category ());
27
items.add (get_accessories_category ());
28
items.add (get_office_category ());
29
items.add (get_system_category ());
30
items.add (get_video_category ());
31
items.add (get_graphics_category ());
32
items.add (get_games_category ());
33
items.add (get_education_category ());
34
items.add (get_internet_category ());
35
items.add (get_science_category ());
36
items.add (get_a11y_category ());
40
public static Widgets.CategoryItem get_audio_category () {
41
var category = new AppStream.Category ();
42
category.set_name (_("Audio"));
43
category.set_icon ("applications-audio-symbolic");
44
category.get_included ().append ("Audio");
45
var item = new Widgets.CategoryItem (category);
46
item.add_category_class ("audio");
51
public static Widgets.CategoryItem get_development_category () {
52
var category = new AppStream.Category ();
53
category.set_name (_("Development"));
54
category.get_included ().append ("Development");
55
category.get_included ().append ("IDE");
56
var item = new Widgets.CategoryItem (category);
57
item.add_category_class ("development");
62
public static Widgets.CategoryItem get_accessories_category () {
63
var category = new AppStream.Category ();
64
category.set_name (_("Accessories"));
65
category.set_icon ("applications-accessories");
66
category.get_included ().append ("Utility");
67
var item = new Widgets.CategoryItem (category);
68
item.add_category_class ("accessories");
73
public static Widgets.CategoryItem get_office_category () {
74
var category = new AppStream.Category ();
75
category.set_name (_("Office"));
76
category.set_icon ("applications-office-symbolic");
77
category.get_included ().append ("Office");
78
var item = new Widgets.CategoryItem (category);
79
item.add_category_class ("office");
84
public static Widgets.CategoryItem get_system_category () {
85
var category = new AppStream.Category ();
86
category.set_name (_("System"));
87
category.set_icon ("applications-system");
88
category.get_included ().append ("System");
89
var item = new Widgets.CategoryItem (category);
90
item.add_category_class ("system");
95
public static Widgets.CategoryItem get_video_category () {
96
var category = new AppStream.Category ();
97
category.set_name (_("Video"));
98
category.set_icon ("applications-video-symbolic");
99
category.get_included ().append ("Video");
100
var item = new Widgets.CategoryItem (category);
101
item.add_category_class ("video");
106
public static Widgets.CategoryItem get_graphics_category () {
107
var category = new AppStream.Category ();
108
category.set_name (_("Graphics"));
109
category.get_included ().append ("Graphics");
110
var item = new Widgets.CategoryItem (category);
111
item.add_category_class ("graphics");
116
public static Widgets.CategoryItem get_games_category () {
117
var category = new AppStream.Category ();
118
category.set_name (_("GAMES"));
119
category.get_included ().append ("Game");
120
category.set_icon ("applications-games-symbolic");
121
var item = new Widgets.CategoryItem (category);
122
item.add_category_class ("games");
127
public static Widgets.CategoryItem get_education_category () {
128
var category = new AppStream.Category ();
129
category.set_name (_("Education"));
130
category.get_included ().append ("Education");
131
var item = new Widgets.CategoryItem (category);
132
item.add_category_class ("education");
137
public static Widgets.CategoryItem get_internet_category () {
138
var category = new AppStream.Category ();
139
category.set_name (_("Internet"));
140
category.set_icon ("applications-internet");
141
category.get_included ().append ("Network");
142
var item = new Widgets.CategoryItem (category);
143
item.add_category_class ("internet");
148
public static Widgets.CategoryItem get_science_category () {
149
var category = new AppStream.Category ();
150
// TRANSLATORS: We need to force the newline so that the buttons get a decent size
151
category.set_name (_("Science &\nEngineering"));
152
category.get_included ().append ("Science");
153
var item = new Widgets.CategoryItem (category);
154
item.add_category_class ("science");
159
public static Widgets.CategoryItem get_a11y_category () {
160
var category = new AppStream.Category ();
161
// TRANSLATORS: We need to force the newline so that the buttons get a decent size
162
category.set_name (_("UNIVERSAL\nACCESS"));
163
category.set_icon ("applications-accessibility-symbolic");
164
category.get_included ().append ("Accessibility");
165
var item = new Widgets.CategoryItem (category);
166
item.add_category_class ("accessibility");