Fix game:addSpawnShapesByZone
[ryzomcore.git] / studio / src / plugins / core / icontext.h
blob78bde18321e8e33fe8b4af5094b4d0a56059ac7e
1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
7 //
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef ICONTEXT_H
22 #define ICONTEXT_H
24 // Project includes
25 #include "core_global.h"
27 // Qt includes
28 #include <QtCore/QObject>
29 #include <QtCore/QString>
30 #include <QtGui/QIcon>
32 QT_BEGIN_NAMESPACE
33 class QWidget;
34 class QUndoStack;
35 QT_END_NAMESPACE
37 namespace Core
39 /**
40 @interface IContext
41 @brief The IContext is an interface for providing tab pages in main window.
42 @details You need to subclass this interface and put an instance of your subclass
43 into the plugin manager object pool.
45 class CORE_EXPORT IContext: public QObject
47 Q_OBJECT
48 public:
49 IContext(QObject *parent = 0): QObject(parent) {}
50 virtual ~IContext() {}
52 /// id() is a unique identifier for referencing this page
53 virtual QString id() const = 0;
55 /// trName() is the (translated) name for display.
56 virtual QString trName() const = 0;
58 /// icon() is the icon for display
59 virtual QIcon icon() const = 0;
61 /// The widget will be destroyed by the widget hierarchy when the main window closes
62 virtual QWidget *widget() = 0;
64 virtual QUndoStack *undoStack() = 0;
66 virtual void open() = 0;
68 virtual void save(){}
70 virtual void saveAs(){}
72 virtual void newDocument(){}
74 virtual void close(){}
76 virtual void onActivated(){}
79 } // namespace Core
81 #endif // ICONTEXT_H