forked from KDE/ktuberling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoplevel.h
84 lines (66 loc) · 2.4 KB
/
toplevel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/***************************************************************************
* Copyright (C) 1999-2006 by Éric Bischoff <[email protected]> *
* Copyright (C) 2007 by Albert Astals Cid <[email protected]> *
* *
* 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) any later version. *
***************************************************************************/
#ifndef _TOPLEVEL_H_
#define _TOPLEVEL_H_
#include <kxmlguiwindow.h>
#include <kurl.h>
#include <kcombobox.h>
class QActionGroup;
class PlayGround;
class SoundFactory;
class TopLevel : public KXmlGuiWindow
{
Q_OBJECT
public:
TopLevel();
~TopLevel();
void open(const QUrl &url);
void registerGameboard(const QString& menuText, const QString& boardFile, const QPixmap& pixmap);
void registerLanguage(const QString &code, const QString &soundFile, bool enabled);
void changeLanguage(const QString &langCode);
void playSound(const QString &ref) const;
bool isSoundEnabled() const;
void changeGameboard(const QString &gameboard);
protected:
void readOptions(QString &board, QString &language);
void writeOptions();
void setupKAction();
protected slots:
void saveNewToolbarConfig();
private slots:
void fileNew();
void fileOpen();
void fileSave();
void filePicture();
void filePrint();
void editCopy();
void soundOff();
void changeGameboardFromCombo(int index);
void changeGameboard();
void changeLanguage();
void toggleFullScreen();
void lockAspectRatio(bool lock);
private:
int // Menu items identificators
newID, openID, saveID, pictureID, printID, quitID,
copyID, undoID, redoID,
gameboardID, speechID;
enum { // Tool bar buttons identificators
ID_NEW, ID_OPEN, ID_SAVE, ID_PRINT,
ID_UNDO, ID_REDO,
ID_HELP };
enum { BOARD_THEME = Qt::UserRole + 1};
QActionGroup *playgroundsGroup, *languagesGroup;
KComboBox *playgroundCombo;
PlayGround *playGround; // Play ground central widget
SoundFactory *soundFactory; // Speech organ
QMap<QString, QString> sounds; // language code, file
};
#endif