Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (33 sloc) 1.297 kb
cabbde7 @adamv Lines now uses IFoldingEditor reference instead of full EditorCtrl refer...
adamv authored
1 #ifndef __IFOLDINGEDITOR_H__
2 #define __IFOLDINGEDITOR_H__
3
4 // This header defines an interface for editor folds.
5 // This is implemented by EditorCtrl, and is used by Lines.
6 // We define an interface for this to provide a "wedge" for testing Lines
7 // w/o needing to pass in a real editor.
8
9 class IFoldingEditor {
10 public:
cafd0e1 @adamv Pushing methods of EditorCtrl used by Lines into an interface.
adamv authored
11 enum cxFoldType {
12 cxFOLD_START,
13 cxFOLD_START_FOLDED,
14 cxFOLD_END
15 };
16
17 struct cxFold {
18 public:
19 cxFold(unsigned int line, cxFoldType type, unsigned int indent);
20 cxFold(unsigned int line) : line_id(line) {};
21 bool operator<(const cxFold& f) const {return line_id < f.line_id;};
22 bool operator<(unsigned int line) const {return line_id < line;};
23 unsigned int line_id;
24 cxFoldType type;
25 unsigned int count;
26 unsigned int indent;
27 };
28
29 virtual bool IsPosInFold(unsigned int pos, unsigned int* fold_start=NULL, unsigned int* fold_end=NULL) = 0;
30 virtual void UnFoldParents(unsigned int line_id) = 0;
31 virtual const vector<cxFold>& GetFolds() const = 0;
cabbde7 @adamv Lines now uses IFoldingEditor reference instead of full EditorCtrl refer...
adamv authored
32
33 // This isn't used by Lines directly, but is passed to internal data member Line.
68df407 @adamv Expanded comment.
adamv authored
34 // The only use of this member is in Lines (though of course the underlying EditorCtrl member
35 // is used internally in the editor control.
cabbde7 @adamv Lines now uses IFoldingEditor reference instead of full EditorCtrl refer...
adamv authored
36 virtual const interval& GetHlBracket() const = 0;
37 };
38
39 #endif // __IFOLDINGEDITOR_H__
Something went wrong with that request. Please try again.