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.
|
|
|
|
*
|
2010-10-17 10:44:53 +00:00
|
|
|
* \author Peter Kümmel
|
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 {
|
|
|
|
|
2010-10-17 10:44:53 +00:00
|
|
|
|
|
|
|
class DispatchResult
|
|
|
|
{
|
2003-10-29 10:47:21 +00:00
|
|
|
public:
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2020-10-27 12:16:07 +00:00
|
|
|
DispatchResult() = default;
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2010-10-17 10:44:53 +00:00
|
|
|
DispatchResult(bool dispatched, Update::flags f) :
|
2020-10-27 12:16:07 +00:00
|
|
|
dispatched_(dispatched), 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; }
|
|
|
|
///
|
2020-10-21 08:35:40 +00:00
|
|
|
docstring message() const { return message_; }
|
2009-04-06 12:12:06 +00:00
|
|
|
///
|
2010-10-17 10:44:53 +00:00
|
|
|
void setMessage(docstring const & m) { message_ = m; }
|
|
|
|
///
|
|
|
|
void setMessage(std::string const & m) { message_ = from_utf8(m); }
|
2009-04-06 12:12:06 +00:00
|
|
|
///
|
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; }
|
2014-02-17 20:47:22 +00:00
|
|
|
/// Do we need to display a message in the status bar?
|
2010-10-17 10:44:53 +00:00
|
|
|
bool needMessageUpdate() const { return need_msg_update_; }
|
2014-02-17 20:47:22 +00:00
|
|
|
/// Force the message to be displayed
|
2010-10-17 10:44:53 +00:00
|
|
|
void forceMessageUpdate() { need_msg_update_ = true; }
|
2014-02-17 20:47:22 +00:00
|
|
|
/// Clear the flag indicating we need to display the message
|
|
|
|
void clearMessageUpdate() { need_msg_update_ = false; }
|
2010-10-17 10:44:53 +00:00
|
|
|
|
2003-10-29 13:24:57 +00:00
|
|
|
private:
|
2004-03-18 12:53:43 +00:00
|
|
|
/// was the event fully dispatched?
|
2020-10-27 12:16:07 +00:00
|
|
|
bool dispatched_ = false;
|
2009-04-06 12:12:06 +00:00
|
|
|
/// was there an error?
|
2020-10-27 12:16:07 +00:00
|
|
|
bool error_ = false;
|
2004-03-18 12:53:43 +00:00
|
|
|
/// do we need to redraw the screen afterwards?
|
2020-10-27 12:16:07 +00:00
|
|
|
Update::flags update_ = Update::None;
|
2009-04-06 12:12:06 +00:00
|
|
|
///
|
|
|
|
docstring message_;
|
2017-07-03 17:45:58 +00:00
|
|
|
///
|
2020-10-27 12:16:07 +00:00
|
|
|
bool need_buf_update_ = false;
|
2010-10-17 10:44:53 +00:00
|
|
|
///
|
2020-10-27 12:16:07 +00:00
|
|
|
bool need_msg_update_ = true;
|
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
|