3 * \file DispatchResult.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
13 #ifndef DISPATCH_RESULT_H
14 #define DISPATCH_RESULT_H
16 #include "update_flags.h"
18 #include "support/docstring.h"
27 DispatchResult() = default;
29 DispatchResult(bool dispatched, Update::flags f) :
30 dispatched_(dispatched), update_(f) {}
32 bool dispatched() const { return dispatched_; }
34 void dispatched(bool disp) { dispatched_ = disp; }
36 bool error() const { return error_; }
38 void setError(bool e) { error_ = e; }
40 docstring message() const { return message_; }
42 void setMessage(docstring const & m) { message_ = m; }
44 void setMessage(std::string const & m) { message_ = from_utf8(m); }
46 Update::flags screenUpdate() const { return update_; }
48 void screenUpdate(Update::flags f) { update_ = f; }
49 /// Does the buffer need updating?
50 bool needBufferUpdate() const { return need_buf_update_; }
51 /// Force the buffer to be updated
52 void forceBufferUpdate() { need_buf_update_ = true; }
53 /// Clear the flag indicating we need an update
54 void clearBufferUpdate() { need_buf_update_ = false; }
55 /// Do we need to display a message in the status bar?
56 bool needMessageUpdate() const { return need_msg_update_; }
57 /// Force the message to be displayed
58 void forceMessageUpdate() { need_msg_update_ = true; }
59 /// Clear the flag indicating we need to display the message
60 void clearMessageUpdate() { need_msg_update_ = false; }
63 /// was the event fully dispatched?
64 bool dispatched_ = false;
65 /// was there an error?
67 /// do we need to redraw the screen afterwards?
68 Update::flags update_ = Update::None;
72 bool need_buf_update_ = false;
74 bool need_msg_update_ = true;
80 #endif // DISPATCH_RESULT_H