sublime
document.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SUBLIMEDOCUMENT_H
00020 #define SUBLIMEDOCUMENT_H
00021
00022 #include <QtCore/QObject>
00023 #include <QtCore/QList>
00024
00025
00026 #include "sublimeexport.h"
00027
00028 class QWidget;
00029
00030 namespace Sublime {
00031
00032 class View;
00033 class Controller;
00034
00041 class SUBLIME_EXPORT Document: public QObject {
00042 Q_OBJECT
00043 public:
00045 Document(const QString &title, Controller *controller);
00046 ~Document();
00047
00050 View *createView();
00052 const QList<View*> &views() const;
00053
00055 Controller *controller() const;
00056
00058 QString title() const;
00060 void setTitle(const QString& newTitle);
00061
00063 virtual QString documentType() const = 0;
00064
00066 virtual QString documentSpecifier() const = 0;
00067
00068 Q_SIGNALS:
00071 void viewNumberChanged(Sublime::Document *doc);
00073 void aboutToDelete(Sublime::Document *doc);
00075 void titleChanged(Sublime::Document *doc);
00076
00077 protected:
00080 virtual View *newView(Document *doc);
00084 virtual QWidget *createViewWidget(QWidget *parent = 0) = 0;
00085
00086 private:
00087 Q_PRIVATE_SLOT(d, void removeView(QObject*))
00088
00089 struct DocumentPrivate *const d;
00090
00091 friend struct DocumentPrivate;
00092 friend class View;
00093 };
00094
00095 }
00096
00097 #endif
00098