]> git.lyx.org Git - lyx.git/blob - src/ErrorList.h
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / ErrorList.h
1 // -*- C++ -*-
2 /**
3  * \file ErrorList.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alfredo Braunstein
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ERRORLIST_H
13 #define ERRORLIST_H
14
15 #include "TexRow.h"
16
17 #include "support/strfwd.h"
18
19 #include <vector>
20
21
22 namespace lyx {
23
24 class Buffer;
25
26 /// A class to hold an error item
27 class ErrorItem {
28 public:
29         typedef TexRow::TextEntry TextEntry;
30         docstring error;
31         docstring description;
32         // To generalise into RowEntries
33         TextEntry start;
34         TextEntry end;
35         Buffer const * buffer;
36         // With a start position and an end position
37         ErrorItem(docstring const & error, docstring const & description,
38                   TextEntry start, TextEntry end, Buffer const * buf = 0);
39         // Error outside the document body
40         ErrorItem(docstring const & error, docstring const & description,
41                   Buffer const * buf = 0);
42         ErrorItem();
43 };
44
45
46 class ErrorList : private std::vector<ErrorItem>
47 {
48 public:
49         ErrorList() : std::vector<ErrorItem> () {}
50
51         using std::vector<ErrorItem>::push_back;
52         using std::vector<ErrorItem>::end;
53         using std::vector<ErrorItem>::begin;
54         using std::vector<ErrorItem>::operator[];
55         using std::vector<ErrorItem>::size;
56         using std::vector<ErrorItem>::clear;
57         using std::vector<ErrorItem>::empty;
58         using std::vector<ErrorItem>::const_iterator;
59 };
60
61
62 } // namespace lyx
63
64 #endif