1/*
2Copyright (c) 2011 by Simon Schneegans
3
4This program is free software: you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the Free
6Software Foundation, either version 3 of the License, or (at your option)
7any later version.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12more details.
13
14You should have received a copy of the GNU General Public License along with
15this program.  If not, see <http://www.gnu.org/licenses/>.
16*/
17
18namespace GnomePie {
19
20/////////////////////////////////////////////////////////////////////////
21/// A base class for actions, which are executed when the user
22/// activates a pie's slice.
23/////////////////////////////////////////////////////////////////////////
24
25public abstract class Action : GLib.Object {
26
27    /////////////////////////////////////////////////////////////////////
28    /// The command which gets executed when user activates the Slice.
29    /// It may be anything but has to be representable with a string.
30    /////////////////////////////////////////////////////////////////////
31
32    public abstract string real_command { get; construct set; }
33
34    /////////////////////////////////////////////////////////////////////
35    /// The command displayed to the user. It should be a bit more
36    /// beautiful than the real_command.
37    /////////////////////////////////////////////////////////////////////
38
39    public abstract string display_command { get; }
40
41    /////////////////////////////////////////////////////////////////////
42    /// The name of the Action.
43    /////////////////////////////////////////////////////////////////////
44
45    public virtual string name { get; set; }
46
47    /////////////////////////////////////////////////////////////////////
48    /// The name of the icon of this Action. It should be in the users
49    /// current icon theme.
50    /////////////////////////////////////////////////////////////////////
51
52    public virtual string icon { get; set; }
53
54    /////////////////////////////////////////////////////////////////////
55    /// True, if this Action is the quickAction of the associated Pie.
56    /// The quickAction of a Pie gets executed when the users clicks on
57    /// the center of a Pie.
58    /////////////////////////////////////////////////////////////////////
59
60    public virtual bool is_quickaction { get; set; }
61
62    /////////////////////////////////////////////////////////////////////
63    /// C'tor, initializes all members.
64    /////////////////////////////////////////////////////////////////////
65
66    Action(string name, string icon, bool is_quickaction) {
67        GLib.Object(name : name, icon : icon, is_quickaction : is_quickaction);
68    }
69
70    /////////////////////////////////////////////////////////////////////
71    /// This one is called, when the user activates the Slice.
72    /////////////////////////////////////////////////////////////////////
73
74    public abstract void activate();
75}
76
77}
78