2009-04-24 23:35:41 +00:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file ContractionState.h
|
|
|
|
** Manages visibility of lines for folding and wrapping.
|
|
|
|
**/
|
|
|
|
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
|
|
|
#ifndef CONTRACTIONSTATE_H
|
|
|
|
#define CONTRACTIONSTATE_H
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
namespace Scintilla {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class ContractionState {
|
|
|
|
// These contain 1 element for every document line.
|
|
|
|
RunStyles *visible;
|
|
|
|
RunStyles *expanded;
|
|
|
|
RunStyles *heights;
|
|
|
|
Partitioning *displayLines;
|
|
|
|
int linesInDocument;
|
|
|
|
|
|
|
|
void EnsureData();
|
|
|
|
|
|
|
|
bool OneToOne() const {
|
|
|
|
// True when each document line is exactly one display line so need for
|
|
|
|
// complex data structures.
|
|
|
|
return visible == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
ContractionState();
|
|
|
|
virtual ~ContractionState();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
int LinesInDoc() const;
|
|
|
|
int LinesDisplayed() const;
|
|
|
|
int DisplayFromDoc(int lineDoc) const;
|
2015-06-07 21:19:26 +00:00
|
|
|
int DisplayLastFromDoc(int lineDoc) const;
|
2009-04-24 23:35:41 +00:00
|
|
|
int DocFromDisplay(int lineDisplay) const;
|
|
|
|
|
|
|
|
void InsertLine(int lineDoc);
|
|
|
|
void InsertLines(int lineDoc, int lineCount);
|
|
|
|
void DeleteLine(int lineDoc);
|
|
|
|
void DeleteLines(int lineDoc, int lineCount);
|
|
|
|
|
|
|
|
bool GetVisible(int lineDoc) const;
|
2015-06-07 21:19:26 +00:00
|
|
|
bool SetVisible(int lineDocStart, int lineDocEnd, bool isVisible);
|
2011-07-17 22:30:49 +00:00
|
|
|
bool HiddenLines() const;
|
2009-04-24 23:35:41 +00:00
|
|
|
|
|
|
|
bool GetExpanded(int lineDoc) const;
|
2015-06-07 21:19:26 +00:00
|
|
|
bool SetExpanded(int lineDoc, bool isExpanded);
|
2011-03-22 00:16:49 +00:00
|
|
|
int ContractedNext(int lineDocStart) const;
|
2009-04-24 23:35:41 +00:00
|
|
|
|
|
|
|
int GetHeight(int lineDoc) const;
|
|
|
|
bool SetHeight(int lineDoc, int height);
|
|
|
|
|
|
|
|
void ShowAll();
|
|
|
|
void Check() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|