blob: e96234e3b92644cc656c78a9771adc742bdfd5fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Extra data associated with actions: Label, Section, Tooltip.
*
* Copyright (C) 2020 Tavmjong Bah
*
* The contents of this file may be used under the GNU General Public License Version 2 or later.
*
*/
#ifndef INK_ACTIONS_EXTRA_DATA_H
#define INK_ACTIONS_EXTRA_DATA_H
#include <map>
#include <vector>
#include <glibmm/ustring.h>
class InkActionExtraDatum {
public:
InkActionExtraDatum(Glib::ustring& label, Glib::ustring& section, Glib::ustring& tooltip)
: action_label(label)
, action_section(section)
, action_tooltip(tooltip)
{
}
Glib::ustring get_label() { return action_label; }
Glib::ustring get_section() { return action_section; }
Glib::ustring get_tooltip() { return action_tooltip; }
private:
Glib::ustring action_label;
Glib::ustring action_section;
Glib::ustring action_tooltip;
};
class InkActionExtraData {
public:
InkActionExtraData() = default;
void add_data(std::vector<std::vector<Glib::ustring>> &raw_data);
Glib::ustring get_label_for_action(Glib::ustring& action_name);
Glib::ustring get_section_for_action(Glib::ustring& action_name);
Glib::ustring get_tooltip_for_action(Glib::ustring& action_name);
private:
std::map<Glib::ustring, InkActionExtraDatum> data;
};
#endif // INK_ACTIONS_EXTRA_DATA_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
|