Add ProgramData to the env var whitelist for running scripts
[cygwin-setup.git] / ActionList.h
blobbe424538171273a2fe7e049e990cc1cff02b2a83
1 /*
2 * Copyright (c) 2016 Jon Turney
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.
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
14 #ifndef SETUP_ACTIONLIST_H
15 #define SETUP_ACTIONLIST_H
17 #include <string>
18 #include <vector>
19 #include "win32.h"
21 // ---------------------------------------------------------------------------
22 // interface to class ActionList
24 // a list of Actions possible on a package
25 // ---------------------------------------------------------------------------
27 class Action
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 { };
37 std::wstring name;
38 int id;
39 bool selected;
40 bool enabled;
43 typedef std::vector<Action> Actions;
45 class ActionList
47 public:
48 void add(const std::wstring &name, int id, bool selected, bool enabled)
50 Action act(name, id, selected, enabled);
51 list.push_back(act);
53 void add(unsigned int name_res, int id, bool selected, bool enabled)
55 const std::wstring name = LoadStringW(name_res);
56 add(name, id, selected, enabled);
58 Actions list;
61 #endif /* SETUP_ACTIONLIST_H */