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"
30 update_(Update::None),
31 need_buf_update_(false),
32 need_msg_update_(true)
35 DispatchResult(bool dispatched, Update::flags f) :
36 dispatched_(dispatched),
39 need_buf_update_(false),
40 need_msg_update_(true)
43 bool dispatched() const { return dispatched_; }
45 void dispatched(bool disp) { dispatched_ = disp; }
47 bool error() const { return error_; }
49 void setError(bool e) { error_ = e; }
51 docstring message() { return message_; }
53 void setMessage(docstring const & m) { message_ = m; }
55 void setMessage(std::string const & m) { message_ = from_utf8(m); }
57 Update::flags screenUpdate() const { return update_; }
59 void screenUpdate(Update::flags f) { update_ = f; }
60 /// Does the buffer need updating?
61 bool needBufferUpdate() const { return need_buf_update_; }
62 /// Force the buffer to be updated
63 void forceBufferUpdate() { need_buf_update_ = true; }
64 /// Clear the flag indicating we need an update
65 void clearBufferUpdate() { need_buf_update_ = false; }
67 bool needMessageUpdate() const { return need_msg_update_; }
68 /// Force the buffer to be updated
69 void forceMessageUpdate() { need_msg_update_ = true; }
70 /// Clear the flag indicating we need an update
71 void suppressMessageUpdate() { need_msg_update_ = false; }
74 /// was the event fully dispatched?
76 /// was there an error?
78 /// do we need to redraw the screen afterwards?
79 Update::flags update_;
83 bool need_buf_update_;
85 bool need_msg_update_;
91 #endif // DISPATCH_RESULT_H