mainwindow.h 2.24 KB
Newer Older
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
1
/*
2
 *  Copyright 2013  Andreas Cord-Landwehr <cordlandwehr@kde.org>
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation; either version 2 of
 *  the License or (at your option) version 3 or any later version
 *  accepted by the membership of KDE e.V. (or its successor approved
 *  by the membership of KDE e.V.), which shall act as a proxy
 *  defined in Section 14 of version 3 of the license.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

24
#include <KXmlGuiWindow>
25
#include "core/resourcemanager.h"
26
#include "core/trainingsession.h"
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
27

28
class Profile;
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
29 30
class KActionCollection;
class KMenu;
31 32
class QQuickView;
class QQuickWidget;
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
33

34 35 36 37
namespace LearnerProfile {
    class ProfileManager;
}

38
class MainWindow : public KXmlGuiWindow
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
39 40
{
    Q_OBJECT
41
    Q_PROPERTY(ResourceManager *globalResourceManager READ resourceManager CONSTANT)
42

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
43
public:
44 45 46 47 48 49
    Q_ENUMS(ViewMode)
    enum ViewMode {
        Trainer,
        Editor
    };

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
50 51 52
    /**
     * Default Constructor
     */
53
    MainWindow();
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
54 55 56 57 58 59

    /**
     * Default Destructor
     */
    virtual ~MainWindow();

60 61
    ResourceManager * resourceManager() const;

62
    void setupActions();
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
63

64
    virtual QSize sizeHint() const { return QSize(1000, 700); }
65

66 67
    bool queryClose();

68 69
public slots:
    void showCourseEditor();
70
    void closeCourseEditor();
71
    void switchMode();
72
    void showSettingsDialog();
73 74
    void downloadNewStuff();
    void updateTrainingPhraseFont();
75
    void updateKcfgUseContributorResources();
76
    void configLearnerProfile();
77

78 79
signals:
     void modeChanged(bool);
80

81
private:
82
    QQuickWidget *m_widget;
83
    Profile *m_trainingProfile, *m_editorProfile;
84
    ResourceManager *m_resourceManager;
85
    TrainingSession *m_trainingSession;
86
    LearnerProfile::ProfileManager *m_profileManager;
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
87 88 89
};

#endif // PAIRS_H