dolphin/Source/Core/DolphinQt2/MainWindow.h
2017-12-28 19:07:18 +01:00

148 lines
3.5 KiB
C++

// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QMainWindow>
#include <QStackedWidget>
#include <QString>
#include <QToolBar>
#include <memory>
#include <optional>
#include "DolphinQt2/GameList/GameList.h"
#include "DolphinQt2/MenuBar.h"
#include "DolphinQt2/RenderWidget.h"
#include "DolphinQt2/ToolBar.h"
struct BootParameters;
class FIFOPlayerWindow;
class HotkeyScheduler;
class LogConfigWidget;
class LogWidget;
class MappingWindow;
class NetPlayClient;
class NetPlayDialog;
class NetPlayServer;
class NetPlaySetupDialog;
class SettingsWindow;
class ControllersWindow;
class DragEnterEvent;
class GraphicsWindow;
class RegisterWidget;
class MainWindow final : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(std::unique_ptr<BootParameters> boot_parameters);
~MainWindow();
bool eventFilter(QObject* object, QEvent* event) override;
signals:
void ReadOnlyModeChanged(bool read_only);
void RecordingStatusChanged(bool recording);
private:
void Open();
void Play(const std::optional<std::string>& savestate_path = {});
void Pause();
// May ask for confirmation. Returns whether or not it actually stopped.
bool RequestStop();
void ForceStop();
void Reset();
void FrameAdvance();
void StateLoad();
void StateSave();
void StateLoadSlot();
void StateSaveSlot();
void StateLoadSlotAt(int slot);
void StateSaveSlotAt(int slot);
void StateLoadUndo();
void StateSaveUndo();
void StateSaveOldest();
void SetStateSlot(int slot);
void BootWiiSystemMenu();
void PerformOnlineUpdate(const std::string& region);
void FullScreen();
void ScreenShot();
void CreateComponents();
void ConnectGameList();
void ConnectHotkeys();
void ConnectMenuBar();
void ConnectRenderWidget();
void ConnectStack();
void ConnectToolBar();
void InitControllers();
void ShutdownControllers();
void InitCoreCallbacks();
void StartGame(const QString& path, const std::optional<std::string>& savestate_path = {});
void StartGame(std::unique_ptr<BootParameters>&& parameters);
void ShowRenderWidget();
void HideRenderWidget();
void ShowSettingsWindow();
void ShowGeneralWindow();
void ShowAudioWindow();
void ShowControllersWindow();
void ShowGraphicsWindow();
void ShowAboutDialog();
void ShowHotkeyDialog();
void ShowNetPlaySetupDialog();
void ShowFIFOPlayer();
void NetPlayInit();
bool NetPlayJoin();
bool NetPlayHost(const QString& game_id);
void NetPlayQuit();
void OnBootGameCubeIPL(DiscIO::Region region);
void OnImportNANDBackup();
void OnPlayRecording();
void OnStartRecording();
void OnStopRecording();
void OnExportRecording();
void OnStopComplete();
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
QSize sizeHint() const override;
QStackedWidget* m_stack;
ToolBar* m_tool_bar;
MenuBar* m_menu_bar;
GameList* m_game_list;
RenderWidget* m_render_widget;
bool m_rendering_to_main;
bool m_stop_requested = false;
bool m_exit_requested = false;
int m_state_slot = 1;
std::unique_ptr<BootParameters> m_pending_boot;
HotkeyScheduler* m_hotkey_scheduler;
ControllersWindow* m_controllers_window;
SettingsWindow* m_settings_window;
MappingWindow* m_hotkey_window;
NetPlayDialog* m_netplay_dialog;
NetPlaySetupDialog* m_netplay_setup_dialog;
GraphicsWindow* m_graphics_window;
LogWidget* m_log_widget;
LogConfigWidget* m_log_config_widget;
FIFOPlayerWindow* m_fifo_window;
RegisterWidget* m_register_widget;
};