KTextEditor
smartinterface.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "smartinterface.h"
00022
00023 #include <QtCore/QMutex>
00024
00025 using namespace KTextEditor;
00026
00027 class KTextEditor::SmartInterfacePrivate
00028 {
00029 public:
00030 SmartInterfacePrivate()
00031 : mutex(QMutex::Recursive)
00032 , clearOnDocumentReload(true)
00033 {}
00034
00035 QMutex mutex;
00036 bool clearOnDocumentReload;
00037 };
00038
00039 SmartInterface::SmartInterface()
00040 : d(new SmartInterfacePrivate)
00041 {
00042 }
00043
00044 SmartInterface::~ SmartInterface( )
00045 {
00046 delete d;
00047 }
00048
00049 bool SmartInterface::clearOnDocumentReload() const
00050 {
00051 return d->clearOnDocumentReload;
00052 }
00053
00054 void SmartInterface::setClearOnDocumentReload(bool clearOnReload)
00055 {
00056 QMutexLocker lock(smartMutex());
00057 d->clearOnDocumentReload = clearOnReload;
00058 }
00059
00060 QMutex * SmartInterface::smartMutex() const
00061 {
00062 return &d->mutex;
00063 }
00064
00065 void SmartInterface::clearRevision()
00066 {
00067 useRevision(-1);
00068 }
00069
00070 Cursor SmartInterface::translateFromRevision(const Cursor& cursor, SmartCursor::InsertBehavior insertBehavior) const
00071 {
00072 Q_UNUSED(insertBehavior);
00073 return cursor;
00074 }
00075
00076 SmartCursor* SmartInterface::newSmartCursor(int line, int column, SmartCursor::InsertBehavior insertBehavior)
00077 {
00078 return newSmartCursor(Cursor(line, column), insertBehavior);
00079 }
00080
00081 SmartRange* SmartInterface::newSmartRange(const Cursor& startPosition,
00082 const Cursor& endPosition,
00083 SmartRange* parent,
00084 SmartRange::InsertBehaviors insertBehavior)
00085 {
00086 return newSmartRange(Range(startPosition, endPosition), parent, insertBehavior);
00087 }
00088
00089 SmartRange* SmartInterface::newSmartRange(int startLine, int startColumn, int endLine, int endColumn, SmartRange* parent, SmartRange::InsertBehaviors insertBehavior)
00090 {
00091 return newSmartRange(Range(startLine, startColumn, endLine, endColumn), parent, insertBehavior);
00092 }
00093
00094 Range SmartInterface::translateFromRevision(const Range& range, SmartRange::InsertBehaviors insertBehavior) const
00095 {
00096 Q_UNUSED(insertBehavior);
00097 return range;
00098 }
00099
00100