]> cygwin.com Git - cygwin-apps/setup.git/blob - ActionList.h
Regenerate resources with updated translation
[cygwin-apps/setup.git] / ActionList.h
1 /*
2 * Copyright (c) 2016 Jon Turney
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 */
13
14 #ifndef SETUP_ACTIONLIST_H
15 #define SETUP_ACTIONLIST_H
16
17 #include <string>
18 #include <vector>
19 #include "win32.h"
20
21 // ---------------------------------------------------------------------------
22 // interface to class ActionList
23 //
24 // a list of Actions possible on a package
25 // ---------------------------------------------------------------------------
26
27 class Action
28 {
29 public:
30 Action(const std::wstring &_name, int _id, bool _selected, bool _enabled) :
31 name(_name),
32 id(_id),
33 selected(_selected),
34 enabled(_enabled)
35 { };
36
37 std::wstring name;
38 int id;
39 bool selected;
40 bool enabled;
41 };
42
43 typedef std::vector<Action> Actions;
44
45 class ActionList
46 {
47 public:
48 void add(const std::wstring &name, int id, bool selected, bool enabled)
49 {
50 Action act(name, id, selected, enabled);
51 list.push_back(act);
52 };
53 void add(unsigned int name_res, int id, bool selected, bool enabled)
54 {
55 const std::wstring name = LoadStringW(name_res);
56 add(name, id, selected, enabled);
57 };
58 Actions list;
59 };
60
61 #endif /* SETUP_ACTIONLIST_H */
This page took 0.039275 seconds and 5 git commands to generate.