| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  | // Copyright 2017 Dolphin Emulator Project
 | 
					
						
							|  |  |  | // Licensed under GPLv2+
 | 
					
						
							|  |  |  | // Refer to the license.txt file included.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <memory>
 | 
					
						
							|  |  |  | #include <vector>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <QWidget>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ControlGroupBox; | 
					
						
							|  |  |  | class InputConfig; | 
					
						
							| 
									
										
										
										
											2017-06-13 17:16:41 +02:00
										 |  |  | class IOWindow; | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  | class MappingBool; | 
					
						
							|  |  |  | class MappingButton; | 
					
						
							|  |  |  | class MappingNumeric; | 
					
						
							|  |  |  | class MappingWindow; | 
					
						
							| 
									
										
										
										
											2018-07-02 15:16:43 +02:00
										 |  |  | class MappingRadio; | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  | class QGroupBox; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace ControllerEmu | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | class Control; | 
					
						
							|  |  |  | class ControlGroup; | 
					
						
							| 
									
										
										
										
											2017-06-13 17:16:41 +02:00
										 |  |  | class EmulatedController; | 
					
						
							| 
									
										
										
										
											2018-05-02 16:55:42 +02:00
										 |  |  | }  // namespace ControllerEmu
 | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace ciface | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | namespace Core | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | class Device; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2018-05-02 16:55:42 +02:00
										 |  |  | }  // namespace ciface
 | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class MappingWidget : public QWidget | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   Q_OBJECT | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |   explicit MappingWidget(MappingWindow* window); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-13 17:16:41 +02:00
										 |  |  |   ControllerEmu::EmulatedController* GetController() const; | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  |   std::shared_ptr<ciface::Core::Device> GetDevice() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   MappingWindow* GetParent() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-01 16:25:34 +02:00
										 |  |  |   bool IsIterativeInput() const; | 
					
						
							|  |  |  |   void NextButton(MappingButton* button); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  |   virtual void LoadSettings() = 0; | 
					
						
							|  |  |  |   virtual void SaveSettings() = 0; | 
					
						
							|  |  |  |   virtual InputConfig* GetConfig() = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void Update(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |   int GetPort() const; | 
					
						
							|  |  |  |   QGroupBox* CreateGroupBox(const QString& name, ControllerEmu::ControlGroup* group); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |   void OnClearFields(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   MappingWindow* m_parent; | 
					
						
							|  |  |  |   bool m_first = true; | 
					
						
							|  |  |  |   std::vector<MappingBool*> m_bools; | 
					
						
							| 
									
										
										
										
											2018-07-02 15:16:43 +02:00
										 |  |  |   std::vector<MappingRadio*> m_radio; | 
					
						
							| 
									
										
										
										
											2017-05-20 17:53:17 +02:00
										 |  |  |   std::vector<MappingButton*> m_buttons; | 
					
						
							|  |  |  |   std::vector<MappingNumeric*> m_numerics; | 
					
						
							|  |  |  | }; |