Debian Codegraph @

Source/Core/DolphinQt/Config/GeckoCodeWidget.h

raw symbols SCIP
1 // Copyright 2017 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <QWidget>
7
8 #include <string>
9 #include <vector>
10
11 #include "Common/CommonTypes.h"
12
13 class CheatCodeEditor;
14 class CheatWarningWidget;
15 #ifdef USE_RETRO_ACHIEVEMENTS
16 class HardcoreWarningWidget;
17 #endif // USE_RETRO_ACHIEVEMENTS
18 class QLabel;
19 class QListWidget;
20 class QListWidgetItem;
21 class QTextEdit;
22 class QPushButton;
23
24 namespace Gecko
25 {
26 class GeckoCode;
27 }
28
29 class GeckoCodeWidget : public QWidget
30 {
31 Q_OBJECT
32 public:
33 explicit GeckoCodeWidget(std::string game_id, std::string gametdb_id, u16 game_revision,
34 bool restart_required = true);
35 ~GeckoCodeWidget() override;
36
37 void ChangeGame(std::string game_id, std::string gametdb_id, u16 game_revision);
38
39 signals:
40 void OpenGeneralSettings();
41 #ifdef USE_RETRO_ACHIEVEMENTS
42 void OpenAchievementSettings();
43 #endif // USE_RETRO_ACHIEVEMENTS
44
45 private:
46 void OnSelectionChanged();
47 void OnItemChanged(QListWidgetItem* item);
48 void OnListReordered();
49 void OnContextMenuRequested();
50
51 void CreateWidgets();
52 void ConnectWidgets();
53 void UpdateList();
54 void AddCode();
55 void EditCode();
56 void RemoveCode();
57 void DownloadCodes();
58 void LoadCodes();
59 void SaveCodes();
60 void SortAlphabetically();
61 void SortEnabledCodesFirst();
62 void SortDisabledCodesFirst();
63
64 std::string m_game_id;
65 std::string m_gametdb_id;
66 u16 m_game_revision;
67
68 CheatWarningWidget* m_warning;
69 #ifdef USE_RETRO_ACHIEVEMENTS
70 HardcoreWarningWidget* m_hc_warning;
71 #endif // USE_RETRO_ACHIEVEMENTS
72 QListWidget* m_code_list;
73 QLabel* m_name_label;
74 QLabel* m_creator_label;
75 QTextEdit* m_code_description;
76 QTextEdit* m_code_view;
77 QPushButton* m_add_code;
78 QPushButton* m_edit_code;
79 QPushButton* m_remove_code;
80 QPushButton* m_download_codes;
81 CheatCodeEditor* m_cheat_code_editor;
82 std::vector<Gecko::GeckoCode> m_gecko_codes;
83 bool m_restart_required;
84 };