#ifndef CODEFOLDING_H #define CODEFOLDING_H #include #include #include #include struct SynEditFoldRegion; typedef std::shared_ptr PSynEditFoldRegion; class SynEditFoldRegions { private: std::vector fRegions; public: int count(); int add(bool addEnding, const QChar& openSymbol, const QChar& closeSymbol, const QString& highlight); PSynEditFoldRegion get(int index); }; typedef std::shared_ptr PSynFoldRegions; struct SynEditFoldRegion { bool addEnding; SynEditFoldRegions subFoldRegions; QChar openSymbol; QChar closeSymbol; QString highlight; }; struct SynEditCodeFolding { bool indentGuides; bool showCollapsedLine; QColor collapsedLineColor; QColor folderBarLinesColor; QColor indentGuidesColor; SynEditFoldRegions foldRegions; SynEditCodeFolding(); }; class SynEditFoldRange; typedef std::shared_ptr PSynEditFoldRange; class SynEditFoldRanges; typedef std::shared_ptr PSynEditFoldRanges; class SynEditFoldRanges{ private: QVector mRanges; public: PSynEditFoldRange range(int index); void clear(); int count(); SynEditFoldRanges(); PSynEditFoldRange addByParts(PSynEditFoldRange aParent, PSynEditFoldRanges aAllFold, int aFromLine, PSynEditFoldRegion aFoldRegion, int aToLine); void insert(int index, PSynEditFoldRange range); int remove(int index); void add(PSynEditFoldRange foldRange); PSynEditFoldRange operator[](int index); }; // A single fold class SynEditFoldRange { public: int fromLine; // Beginning line int toLine; // End line int linesCollapsed; // Number of collapsed lines PSynEditFoldRanges subFoldRanges; // Sub fold ranges bool collapsed; // Is collapsed? PSynEditFoldRanges allFoldRanges;// TAllFoldRanges pointer PSynEditFoldRegion foldRegion; // FoldRegion int hintMarkLeft; PSynEditFoldRange parent; bool parentCollapsed(); void move(int count); explicit SynEditFoldRange(PSynEditFoldRange aParent, PSynEditFoldRanges aAllFold, int aFromLine, PSynEditFoldRegion aFoldRegion, int aToLine); }; #endif // CODEFOLDING_H