OpenMW
apps/opencs/view/world/scriptsubview.hpp
Go to the documentation of this file.
00001 #ifndef CSV_WORLD_SCRIPTSUBVIEW_H
00002 #define CSV_WORLD_SCRIPTSUBVIEW_H
00003 
00004 #include "../doc/subview.hpp"
00005 
00006 #include <QTimer>
00007 
00008 class QTextEdit;
00009 class QModelIndex;
00010 
00011 namespace CSMDoc
00012 {
00013     class Document;
00014 }
00015 
00016 namespace CSMWorld
00017 {
00018     class IdTable;
00019 }
00020 
00021 namespace CSVWorld
00022 {
00023     class ScriptHighlighter;
00024 
00025     class ScriptSubView : public CSVDoc::SubView
00026     {
00027             Q_OBJECT
00028 
00029             QTextEdit *mEditor;
00030             CSMDoc::Document& mDocument;
00031             CSMWorld::IdTable *mModel;
00032             int mColumn;
00033             int mChangeLocked;
00034             ScriptHighlighter *mHighlighter;
00035             QTimer mUpdateTimer;
00036 
00037             class ChangeLock
00038             {
00039                     ScriptSubView& mView;
00040 
00041                     ChangeLock (const ChangeLock&);
00042                     ChangeLock& operator= (const ChangeLock&);
00043 
00044                 public:
00045 
00046                     ChangeLock (ScriptSubView& view);
00047                     ~ChangeLock();
00048             };
00049 
00050             friend class ChangeLock;
00051 
00052         public:
00053 
00054             ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
00055 
00056             virtual void setEditLock (bool locked);
00057 
00058         public slots:
00059 
00060             void idListChanged();
00061 
00062             void textChanged();
00063 
00064             void dataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
00065 
00066             void rowsAboutToBeRemoved (const QModelIndex& parent, int start, int end);
00067 
00068         private slots:
00069 
00070             void updateHighlighting();
00071     };
00072 }
00073 
00074 #endif