]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlErrorList.h
the errorlist change
[lyx.git] / src / frontends / controllers / ControlErrorList.h
1 // -*- C++ -*-
2 /**
3  * \file ControlErrorList.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 CONTROLERRORLIST_H
13 #define CONTROLERRORLIST_H
14
15
16 #include "Dialog.h"
17 #include <vector>
18
19
20
21 /** A controller for the ErrorList dialog.
22  */
23
24
25 class ControlErrorList : public Dialog::Controller {
26 public:
27         /// A class to hold an error item
28         struct ErrorItem {
29                 std::string error;
30                 std::string description;
31                 int par_id;
32                 int pos_start;
33                 int pos_end;
34                 ErrorItem(string const &, string const &, int, int, int); 
35         };
36         ///
37         ControlErrorList(Dialog & parent);
38         ///
39         virtual bool isBufferDependent() const { return true; }
40         ///
41         virtual bool initialiseParams(const string & params);
42         ///
43         virtual void ControlErrorList::clearParams();
44         ///
45         virtual void ControlErrorList::dispatchParams() {}
46
47         /// get the current item
48         int currentItem() const;
49         /// goto this error in the parent bv
50         void goTo(int item);
51         /// return the parent document name
52         string const & docName();
53         /// rescan the log file and rebuild the error list
54         void fillErrors();
55         /// clear everything
56         void clearErrors();
57         ///
58         std::vector<ErrorItem> const & ErrorList() const;
59 private:
60         ///
61         std::vector<ErrorItem> ErrorList_;
62         ///
63         string logfilename_;
64         ///
65         int current_;
66 };
67
68 #endif // CONTROLERRORLIST_H