4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * \author André Pönitz
12 * Full author contact details are available in file CREDITS.
19 #include "KeySequence.h"
21 #include "support/docstring.h"
38 /** This class encapsulates all the LyX command operations.
39 This is the class of the LyX's "high level event handler".
40 Every user command is processed here, either invocated from
41 keyboard or from the GUI. All GUI objects, including buttons and
42 menus should use this class and never call kernel functions directly.
50 /// LyX dispatcher: executes lyx actions and returns result.
51 void dispatch(FuncRequest const &, DispatchResult &);
53 /// LyX dispatcher: executes lyx actions and does necessary
54 /// screen updates depending on results.
55 void dispatch(FuncRequest const &);
58 FuncStatus getStatus(FuncRequest const & action) const;
60 /// True if lyxfunc reports an error
61 bool errorStat() const { return errorstat; }
62 /// Buffer to store result messages
63 void setMessage(docstring const & m) const;
64 /// Buffer to store result messages
65 void setErrorMessage(docstring const &) const;
66 /// Buffer to store result messages
67 docstring const getMessage() const { return dispatch_buffer; }
69 /// openFile: whether or not open a file if the file is not opened
70 /// switchToBuffer: whether or not switch to buffer if the buffer is
71 /// not the current buffer
72 void gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer);
74 /// cursor x position before dispatch started
75 int cursorBeforeDispatchX() const { return cursorPosBeforeDispatchX_; }
76 /// cursor y position before dispatch started
77 int cursorBeforeDispatchY() const { return cursorPosBeforeDispatchY_; }
80 /// cursor position before dispatch started
81 int cursorPosBeforeDispatchX_;
82 int cursorPosBeforeDispatchY_;
84 /// Error status, only Dispatch can change this flag
85 mutable bool errorstat;
87 /** Buffer to store messages and result data. Is there a
88 good reason to have this one as static in Dispatch? (Ale)
90 mutable docstring dispatch_buffer;
93 /// Implementation is in LyX.cpp
94 extern LyXFunc & theLyXFunc();
96 /// Implementation is in LyX.cpp
97 extern FuncStatus getStatus(FuncRequest const & action);
99 /// Implementation is in LyX.cpp
100 extern void dispatch(FuncRequest const & action);
102 /// Implementation is in LyX.cpp
103 extern void dispatch(FuncRequest const & action, DispatchResult & dr);