2003-10-29 10:47:21 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
* \file DispatchResult.h
|
2003-10-29 10:47:21 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author none
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2003-10-29 10:47:21 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DISPATCH_RESULT_H
|
|
|
|
#define DISPATCH_RESULT_H
|
|
|
|
|
2007-04-28 20:44:46 +00:00
|
|
|
#include "update_flags.h"
|
2006-10-22 11:46:36 +00:00
|
|
|
|
2009-04-06 12:12:06 +00:00
|
|
|
#include "support/docstring.h"
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2004-03-18 12:53:43 +00:00
|
|
|
/// Maybe this can go entirely
|
2003-10-29 10:47:21 +00:00
|
|
|
class DispatchResult {
|
|
|
|
public:
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2010-01-18 11:50:12 +00:00
|
|
|
DispatchResult() : dispatched_(false), error_(false),
|
2010-07-09 14:37:00 +00:00
|
|
|
update_(Update::None), need_buf_update_(false) {}
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2010-01-18 11:50:12 +00:00
|
|
|
DispatchResult(bool disp, Update::flags f)
|
|
|
|
: dispatched_(disp), error_(false), update_(f) {}
|
2009-04-06 12:12:06 +00:00
|
|
|
///
|
2004-03-18 12:53:43 +00:00
|
|
|
bool dispatched() const { return dispatched_; }
|
|
|
|
///
|
|
|
|
void dispatched(bool disp) { dispatched_ = disp; }
|
|
|
|
///
|
2009-04-06 12:12:06 +00:00
|
|
|
bool error() const { return error_; }
|
|
|
|
///
|
|
|
|
void setError(bool e) { error_ = e; }
|
|
|
|
///
|
|
|
|
docstring message() { return message_; }
|
|
|
|
///
|
|
|
|
void setMessage(docstring m) { message_ = m; }
|
|
|
|
///
|
2010-10-13 17:28:55 +00:00
|
|
|
Update::flags screenUpdate() const { return update_; }
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2010-10-13 17:28:55 +00:00
|
|
|
void screenUpdate(Update::flags f) { update_ = f; }
|
2010-07-09 14:37:00 +00:00
|
|
|
/// Does the buffer need updating?
|
|
|
|
bool needBufferUpdate() const { return need_buf_update_; }
|
|
|
|
/// Force the buffer to be updated
|
|
|
|
void forceBufferUpdate() { need_buf_update_ = true; }
|
|
|
|
/// Clear the flag indicating we need an update
|
|
|
|
void clearBufferUpdate() { need_buf_update_ = false; }
|
2003-10-29 13:24:57 +00:00
|
|
|
private:
|
2004-03-18 12:53:43 +00:00
|
|
|
/// was the event fully dispatched?
|
2003-11-01 15:45:19 +00:00
|
|
|
bool dispatched_;
|
2009-04-06 12:12:06 +00:00
|
|
|
/// was there an error?
|
|
|
|
bool error_;
|
2004-03-18 12:53:43 +00:00
|
|
|
/// do we need to redraw the screen afterwards?
|
2006-10-22 11:46:36 +00:00
|
|
|
Update::flags update_;
|
2009-04-06 12:12:06 +00:00
|
|
|
///
|
|
|
|
docstring message_;
|
2010-07-09 14:37:00 +00:00
|
|
|
///
|
|
|
|
bool need_buf_update_;
|
2003-10-29 10:47:21 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-10-29 10:47:21 +00:00
|
|
|
#endif // DISPATCH_RESULT_H
|