File indexing completed on 2024-04-14 03:49:11

0001 /*
0002     SPDX-FileCopyrightText: 2009 Daniel Laidig <d.laidig@gmx.de>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef PRACTICE_MAINWINDOW_H
0007 #define PRACTICE_MAINWINDOW_H
0008 
0009 #include "sessionmanagerbase.h"
0010 #include <KXmlGuiWindow>
0011 #include <QKeyEvent>
0012 
0013 class ParleyMainWindow;
0014 class KToggleFullScreenAction;
0015 class QPropertyAnimation;
0016 
0017 ///@brief contains all objects for the practice window
0018 namespace Practice
0019 {
0020 class PracticeStateMachine;
0021 class GuiFrontend;
0022 
0023 class PracticeMainWindow : public KXmlGuiWindow
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit PracticeMainWindow(SessionManagerBase *sessionManager, ParleyMainWindow *mainWindow = nullptr);
0028     ~PracticeMainWindow() override;
0029 
0030     void startPractice();
0031 
0032 public Q_SLOTS:
0033     void toggleFullScreenMode(bool fullScreen);
0034     void practiceFinished();
0035 
0036 Q_SIGNALS:
0037     void enterPressed();
0038     void stopPractice();
0039 
0040 protected:
0041     void resizeEvent(QResizeEvent *e) override;
0042     bool event(QEvent *event) override;
0043 
0044 private:
0045     void initActions();
0046 
0047     GuiFrontend *m_guiFrontend{nullptr};
0048     PracticeStateMachine *m_stateMachine{nullptr};
0049     ParleyMainWindow *m_mainWindow{nullptr};
0050     QWidget *m_floatingToolBar{nullptr};
0051     KToggleFullScreenAction *m_fullScreenAction{nullptr};
0052     QPropertyAnimation *m_animation{nullptr};
0053 };
0054 }
0055 
0056 #endif