LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
ResourceDialogItem.hpp
1
2/* Copyright 2017 - 2024 R. Thomas
3 * Copyright 2017 - 2024 Quarkslab
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_RESOURCE_DIALOG_ITEM_H
18#define LIEF_PE_RESOURCE_DIALOG_ITEM_H
19#include <ostream>
20#include <sstream>
21#include <set>
22
23#include "LIEF/visibility.h"
24
25#include "LIEF/Object.hpp"
26
27#include "LIEF/PE/enums.hpp"
28
29namespace LIEF {
30namespace PE {
31class ResourcesManager;
32struct ResourcesParser;
33
34namespace details {
35struct pe_dialog_item_template_ext;
36struct pe_dialog_item_template;
37}
38
40class LIEF_API ResourceDialogItem : public Object {
41
42 friend class ResourcesManager;
43 friend struct ResourcesParser;
44
45 public:
47 ResourceDialogItem(const details::pe_dialog_item_template_ext& header);
48 ResourceDialogItem(const details::pe_dialog_item_template& header);
49
51 ResourceDialogItem& operator=(const ResourceDialogItem&);
52
53 ~ResourceDialogItem() override;
54
56 bool is_extended() const;
57
59 uint32_t extended_style() const;
60
63 std::set<EXTENDED_WINDOW_STYLES> extended_style_list() const;
64
67
69 uint32_t style() const;
70
71 std::set<WINDOW_STYLES> style_list() const;
72 bool has_style(WINDOW_STYLES style) const;
73
76 int16_t x() const;
77
80 int16_t y() const;
81
83 int16_t cx() const;
84
86 int16_t cy() const;
87
89 uint32_t id() const;
90
91
92 // Extended API
93 // ============
94
96 uint32_t help_id() const;
97
99 const std::u16string& title() const;
100
101 void accept(Visitor& visitor) const override;
102
103
104 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceDialogItem& dialog_item);
105
106 private:
107 bool is_extended_ = true;
108 uint32_t help_id_ = 0;
109 uint32_t ext_style_ = 0;
110 uint32_t style_ = 0;
111 uint32_t id_ = 0;
112
113 int16_t x_ = 0;
114 int16_t y_ = 0;
115 int16_t cx_ = 0;
116 int16_t cy_ = 0;
117
118 std::u16string window_class_;
119 std::u16string title_;
120
121 uint16_t extra_count_ = 0;
122};
123
124
125}
126}
127
128
129#endif
Definition Object.hpp:25
This class represents an item in the ResourceDialog.
Definition ResourceDialogItem.hpp:40
uint32_t id() const
The control identifier.
std::set< EXTENDED_WINDOW_STYLES > extended_style_list() const
List of PE::EXTENDED_WINDOW_STYLES associated with the ResourceDialogItem::extended_style value.
int16_t cy() const
The height, in dialog box units, of the control.
int16_t y() const
The y-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is al...
bool is_extended() const
True if the control is an extended one
uint32_t style() const
The style of the control.
int16_t cx() const
The width, in dialog box units, of the control.
int16_t x() const
The x-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is al...
uint32_t extended_style() const
The extended styles for a window.
const std::u16string & title() const
Initial text of the control.
uint32_t help_id() const
The help context identifier for the control.
bool has_extended_style(EXTENDED_WINDOW_STYLES style) const
Check if the DialogItem has the given PE::EXTENDED_WINDOW_STYLES.
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Definition Visitor.hpp:219
EXTENDED_WINDOW_STYLES
From https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles.
Definition PE/enums.hpp:204
WINDOW_STYLES
From: https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles.
Definition PE/enums.hpp:229
LIEF namespace.
Definition Abstract/Binary.hpp:32