25 #ifndef JUCE_CODEDOCUMENT_H_INCLUDED
26 #define JUCE_CODEDOCUMENT_H_INCLUDED
89 int charactersFromStartOfDocument)
noexcept;
112 void setPosition (
int charactersFromStartOfDocument);
128 void setLineAndIndex (
int newLine,
int newIndexInLine);
149 void setPositionMaintained (
bool isMaintained);
155 void moveBy (
int characterDelta);
161 Position movedBy (
int characterDelta)
const;
167 Position movedByLines (
int deltaLines)
const;
177 String getLineText()
const;
181 int characterPos, line, indexInLine;
182 bool positionMaintained;
187 String getAllContent()
const;
190 String getTextBetween (
const Position& start,
const Position& end)
const;
196 int getNumCharacters()
const noexcept;
199 int getNumLines()
const noexcept {
return lines.size(); }
202 int getMaximumLineLength() noexcept;
207 void deleteSection (
const Position& startPosition,
const Position& endPosition);
212 void deleteSection (
int startIndex,
int endIndex);
222 void insertText (
int insertIndex,
const String& text);
227 void replaceSection (
int startIndex,
int endIndex,
const String& newText);
254 String getNewLineCharacters()
const noexcept {
return newLineChars; }
269 void newTransaction();
284 void clearUndoHistory();
299 void setSavePoint() noexcept;
306 bool hasChangedSinceSavePoint()
const noexcept;
310 Position findWordBreakAfter (
const Position& position)
const noexcept;
312 Position findWordBreakBefore (
const Position& position)
const noexcept;
314 void findTokenContaining (
const Position& pos, Position& start, Position& end)
const noexcept;
316 void findLineContaining (
const Position& pos, Position& start, Position& end)
const noexcept;
329 virtual void codeDocumentTextInserted (
const String& newText,
int insertIndex) = 0;
332 virtual void codeDocumentTextDeleted (
int startIndex,
int endIndex) = 0;
339 void addListener (Listener* listener)
noexcept;
344 void removeListener (Listener* listener)
noexcept;
377 void skipWhitespace() noexcept;
380 void skipToEndOfLine() noexcept;
383 int getLine()
const noexcept {
return line; }
386 bool isEOF()
const noexcept;
390 mutable
String::CharPointerType charPointer;
402 Array <Position*> positionsToMaintain;
404 int currentActionIndex, indexOfSavedState;
405 int maximumLineLength;
409 void insert (
const String& text,
int insertPos,
bool undoable);
410 void remove (
int startPos,
int endPos,
bool undoable);
411 void checkLastLineStatus();
417 #endif // JUCE_CODEDOCUMENT_H_INCLUDED
Definition: juce_CodeDocument.cpp:802
int getIndexInLine() const noexcept
Definition: juce_CodeDocument.h:141
Listener()
Definition: juce_CodeDocument.h:325
Definition: juce_CodeDocument.cpp:25
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_CodeDocument.h:59
NewLine newLine
Definition: juce_core.cpp:35
Definition: juce_CodeDocument.h:354
Definition: juce_ApplicationCommandID.h:86
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
UndoManager & getUndoManager() noexcept
Definition: juce_CodeDocument.h:287
Definition: juce_ApplicationCommandID.h:83
Definition: juce_CodeDocument.h:42
Definition: juce_ListenerList.h:69
Definition: juce_CodeDocument.cpp:895
Definition: juce_OutputStream.h:42
int getLineNumber() const noexcept
Definition: juce_CodeDocument.h:133
int getPosition() const noexcept
Definition: juce_CodeDocument.h:117
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
Definition: juce_Array.h:60
Definition: juce_OwnedArray.h:55
virtual ~Listener()
Definition: juce_CodeDocument.h:326
Definition: juce_UndoManager.h:49
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
Definition: juce_CodeDocument.h:322
wchar_t juce_wchar
Definition: juce_CharacterFunctions.h:49
int getPosition() const noexcept
Definition: juce_CodeDocument.h:374