File: ScintillaDocument.h

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (109 lines) | stat: -rw-r--r-- 3,108 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// ScintillaDocument.h
// Wrapper for Scintilla document object so it can be manipulated independently.
// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware

#ifndef SCINTILLADOCUMENT_H
#define SCINTILLADOCUMENT_H

#include <QObject>

class WatcherHelper;

#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif

#ifndef EXPORT_IMPORT_API
#ifdef WIN32
#ifdef MAKING_LIBRARY
#define EXPORT_IMPORT_API __declspec(dllexport)
#else
// Defining dllimport upsets moc
#define EXPORT_IMPORT_API __declspec(dllimport)
//#define EXPORT_IMPORT_API
#endif
#else
#define EXPORT_IMPORT_API
#endif
#endif

class EXPORT_IMPORT_API ScintillaDocument : public QObject
{
    Q_OBJECT

    void *pdoc;
    WatcherHelper *docWatcher;

public:
    explicit ScintillaDocument(QObject *parent = 0, void *pdoc_=0);
    virtual ~ScintillaDocument();
    void *pointer();

    int line_from_position(int pos);
    bool is_cr_lf(int pos);
    bool delete_chars(int pos, int len);
    int undo();
    int redo();
    bool can_undo();
    bool can_redo();
    void delete_undo_history();
    bool set_undo_collection(bool collect_undo);
    bool is_collecting_undo();
    void begin_undo_action();
    void end_undo_action();
    void set_save_point();
    bool is_save_point();
    void set_read_only(bool read_only);
    bool is_read_only();
    void insert_string(int position, QByteArray &str);
    QByteArray get_char_range(int position, int length);
    char style_at(int position);
    int line_start(int lineno);
    int line_end(int lineno);
    int line_end_position(int pos);
    int length();
    int lines_total();
    void start_styling(int position, char flags);
    bool set_style_for(int length, char style);
    int get_end_styled();
    void ensure_styled_to(int position);
    void set_current_indicator(int indic);
    void decoration_fill_range(int position, int value, int fillLength);
    int decorations_value_at(int indic, int position);
    int decorations_start(int indic, int position);
    int decorations_end(int indic, int position);
    int get_code_page();
    void set_code_page(int code_page);
    int get_eol_mode();
    void set_eol_mode(int eol_mode);
    int move_position_outside_char(int pos, int move_dir, bool check_line_end);

    int get_character(int pos); // Calls GetCharacterAndWidth(pos, NULL)

private:
    void emit_modify_attempt();
    void emit_save_point(bool atSavePoint);
    void emit_modified(int position, int modification_type, const QByteArray& text, int length,
	int linesAdded, int line, int foldLevelNow, int foldLevelPrev);
    void emit_style_needed(int pos);
    void emit_lexer_changed();
    void emit_error_occurred(int status);

signals:
    void modify_attempt();
    void save_point(bool atSavePoint);
    void modified(int position, int modification_type, const QByteArray& text, int length,
	int linesAdded, int line, int foldLevelNow, int foldLevelPrev);
    void style_needed(int pos);
    void lexer_changed();
    void error_occurred(int status);

    friend class ::WatcherHelper;

};

#ifdef SCI_NAMESPACE
}
#endif

#endif // SCINTILLADOCUMENT_H