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"
22 /// Maybe this can go entirely
23 class DispatchResult {
26 DispatchResult() : dispatched_(false), error_(false),
27 update_(Update::None), need_buf_update_(false) {}
29 DispatchResult(bool disp, Update::flags f)
30 : dispatched_(disp), error_(false), 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() { return message_; }
42 void setMessage(docstring m) { message_ = m; }
44 Update::flags update() const { return update_; }
46 void update(Update::flags f) { update_ = f; }
47 /// Does the buffer need updating?
48 bool needBufferUpdate() const { return need_buf_update_; }
49 /// Force the buffer to be updated
50 void forceBufferUpdate() { need_buf_update_ = true; }
51 /// Clear the flag indicating we need an update
52 void clearBufferUpdate() { need_buf_update_ = false; }
54 /// was the event fully dispatched?
56 /// was there an error?
58 /// do we need to redraw the screen afterwards?
59 Update::flags update_;
63 bool need_buf_update_;
69 #endif // DISPATCH_RESULT_H