1 // Written in the D programming language.
2 
3 /**
4 Definition of standard actions commonly used in dialogs and controls.
5 
6 Synopsis:
7 
8 ----
9 import dlangui.core.stdaction;
10 
11 ----
12 
13 Copyright: Vadim Lopatin, 2014
14 License:   Boost License 1.0
15 Authors:   Vadim Lopatin, coolreader.org@gmail.com
16 */
17 module dlangui.core.stdaction;
18 
19 public import dlangui.core.events;
20 
21 /// standard (commonly used) action codes
22 enum StandardAction : int {
23     Ok = 1,
24     Cancel,
25     Yes,
26     No,
27     Close, 
28     Abort,
29     Retry,
30     Ignore,
31     Open,
32     Save,
33     SaveAll,
34     DiscardChanges,
35     DiscardAll,
36     OpenUrl,
37     Apply,
38     OpenDirectory,
39     CreateDirectory,
40 }
41 
42 const Action ACTION_OK = new Action(StandardAction.Ok, "ACTION_OK"c, "dialog-ok");
43 const Action ACTION_CANCEL = new Action(StandardAction.Cancel, "ACTION_CANCEL"c, "dialog-cancel").addAccelerator(KeyCode.ESCAPE);
44 const Action ACTION_APPLY = new Action(StandardAction.Apply, "ACTION_APPLY"c, null);
45 const Action ACTION_YES = new Action(StandardAction.Yes, "ACTION_YES"c, "dialog-ok");
46 const Action ACTION_NO = new Action(StandardAction.No, "ACTION_NO"c, "dialog-cancel");
47 const Action ACTION_CLOSE = new Action(StandardAction.Close, "ACTION_CLOSE"c, "dialog-close");
48 const Action ACTION_ABORT =  new Action(StandardAction.Abort, "ACTION_ABORT"c);
49 const Action ACTION_RETRY = new Action(StandardAction.Retry, "ACTION_RETRY"c);
50 const Action ACTION_IGNORE = new Action(StandardAction.Ignore, "ACTION_IGNORE"c);
51 const Action ACTION_OPEN = new Action(StandardAction.Open, "ACTION_OPEN"c);
52 const Action ACTION_OPEN_DIRECTORY = new Action(StandardAction.OpenDirectory, "ACTION_OPEN_DIRECTORY"c);
53 const Action ACTION_CREATE_DIRECTORY = new Action(StandardAction.CreateDirectory, "ACTION_CREATE_DIRECTORY"c);
54 const Action ACTION_SAVE = new Action(StandardAction.Save, "ACTION_SAVE"c);
55 const Action ACTION_SAVE_ALL = new Action(StandardAction.SaveAll, "ACTION_SAVE_ALL"c);
56 const Action ACTION_DISCARD_CHANGES = new Action(StandardAction.DiscardChanges, "ACTION_DISCARD_CHANGES"c);
57 const Action ACTION_DISCARD_ALL = new Action(StandardAction.DiscardAll, "ACTION_DISCARD_ALL"c);
58 const Action ACTION_OPEN_URL = (new Action(StandardAction.OpenUrl)).iconId("applications-internet");
59