Merge branch 'upstream' into experimental
[debian/pino.git] / src / streams_types.vala
1 using Gee;
2 using PinoEnums;
3
4 /** Abstract class, holdes all available types of any streams */
5 public class StreamsTypes : HashMap<StreamEnum, StreamMeta> {
6
7         public StreamsTypes() throws GLib.Error {
8                 Gtk.IconTheme theme = Gtk.IconTheme.get_default();
9                 
10                 Gdk.Pixbuf home_icon = theme.load_icon("go-home", 24, 0);
11                 StreamMeta home = new StreamMeta("Home", home_icon);
12                 set(StreamEnum.HOME, home);
13
14                 Gdk.Pixbuf mentions_icon = new Gdk.Pixbuf.from_file(Config.MENTIONS_PATH);
15                 StreamMeta mentions = new StreamMeta("Mentions", mentions_icon);
16                 set(StreamEnum.MENTIONS, mentions);
17                 
18                 Gdk.Pixbuf public_icon = theme.load_icon("applications-internet", 24, 0);
19                 StreamMeta public = new StreamMeta("Public", public_icon);
20                 set(StreamEnum.PUBLIC, public);
21                 
22                 Gdk.Pixbuf favorites_icon = theme.load_icon("gtk-about", 24, 0);
23                 StreamMeta favorites = new StreamMeta("Favorites", favorites_icon);
24                 set(StreamEnum.FAVORITES, favorites);
25                 
26                 Gdk.Pixbuf search_icon = theme.load_icon("gtk-find", 24, 0);
27                 StreamMeta search = new StreamMeta("Search", search_icon);
28                 set(StreamEnum.SEARCH, search);
29         }
30         
31         /** Return type by a string value */
32         /*
33         public virtual StreamMmeta? get_type_by_string(StreamEnum stype) {
34                 foreach(StreamMeta meta in keys) {
35                         if(get(meta).name == stype) {
36                                 return tp;
37                         }
38                 }
39
40                 return null;
41         }
42         */
43 }