GUIFramework
1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
IconListViewParser.cpp
Go to the documentation of this file.
1
#include "
IconListViewParser.h
"
2
3
#include "
Holders/LoadableHolders/BaseLoadableHolder.h
"
4
5
using namespace
std;
6
7
namespace
gui_framework
8
{
9
namespace
parsers
10
{
11
IconListViewParser::IconListViewParser
() :
12
imagesWidth(0),
13
imagesHeight(0),
14
type(utility::iconListViewType::icon)
15
{
16
17
}
18
19
void
IconListViewParser::parse
(
const
json::utility::jsonObject& description)
20
{
21
BaseComponentParser::parse
(description);
22
23
vector<string> tem = json::utility::JSONArrayWrapper(description.getArray(
"listViewIconValues"
)).getAsStringArray();
24
25
icons
.reserve(tem.size());
26
27
for
(
const
auto
& i : tem)
28
{
29
icons
.emplace_back(i);
30
}
31
32
imagesWidth
=
static_cast<
uint16_t
>
(description.getUnsignedInt(
"imagesWidth"
));
33
imagesHeight
=
static_cast<
uint16_t
>
(description.getUnsignedInt(
"imagesHeight"
));
34
35
if
(
imagesWidth
==
standard_sizes::largeIconWidth
&&
imagesHeight
==
standard_sizes::largeIconHeight
)
36
{
37
type
=
utility::iconListViewType::icon
;
38
}
39
else
40
{
41
type
=
utility::iconListViewType::smallIcon
;
42
}
43
}
44
}
45
}
BaseLoadableHolder.h
IconListViewParser.h
gui_framework::standard_sizes::largeIconHeight
const uint16_t largeIconHeight
Definition
GUIFrameworkConstants.h:47
gui_framework::standard_sizes::largeIconWidth
const uint16_t largeIconWidth
Definition
GUIFrameworkConstants.h:46
gui_framework::utility::iconListViewType::smallIcon
@ smallIcon
gui_framework::utility::iconListViewType::icon
@ icon
gui_framework
Definition
BaseComponent.cpp:21
gui_framework::parsers::BaseComponentParser::parse
virtual void parse(const json::utility::jsonObject &description)
Definition
BaseComponentParser.cpp:20
gui_framework::parsers::IconListViewParser::imagesHeight
uint16_t imagesHeight
Definition
IconListViewParser.h:15
gui_framework::parsers::IconListViewParser::IconListViewParser
IconListViewParser()
Definition
IconListViewParser.cpp:11
gui_framework::parsers::IconListViewParser::parse
virtual void parse(const json::utility::jsonObject &description) override
Definition
IconListViewParser.cpp:19
gui_framework::parsers::IconListViewParser::imagesWidth
uint16_t imagesWidth
Definition
IconListViewParser.h:14
gui_framework::parsers::IconListViewParser::icons
std::vector< std::filesystem::path > icons
Definition
IconListViewParser.h:13
gui_framework::parsers::IconListViewParser::type
utility::iconListViewType type
Definition
IconListViewParser.h:16
GUIFramework
src
Deserialization
Parsers
ListViews
IconListViewParser.cpp
Generated by
1.12.0