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
|
|
|
///
|
2010-10-17 10:44:53 +00:00
|
|
|
DispatchResult() :
|
|
|
|
dispatched_(false),
|
|
|
|
error_(false),
|
|
|
|
update_(Update::None),
|
|
|
|
need_buf_update_(false),
|
2016-01-30 23:14:36 +00:00
|
|
|
need_msg_update_(true),
|
|
|
|
need_changes_update_(false)
|
2010-10-17 10:44:53 +00:00
|
|
|
{}
|
2004-03-18 12:53:43 +00:00
|
|
|
///
|
2010-10-17 10:44:53 +00:00
|
|
|
DispatchResult(bool dispatched, Update::flags f) :
|
|
|
|
dispatched_(dispatched),
|
|
|
|
error_(false),
|
|
|
|
update_(f),
|
|
|
|
need_buf_update_(false),
|
2016-01-30 23:14:36 +00:00
|
|
|
need_msg_update_(true),
|
|
|
|
need_changes_update_(false)
|
2010-10-17 10:44:53 +00:00
|
|
|
{}
|
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_; }
|
|
|
|
///
|
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; }
|
2016-01-30 23:14:36 +00:00
|
|
|
|
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; }
|
2016-01-30 23:14:36 +00:00
|
|
|
|
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
|
|
|
|
2016-01-30 23:14:36 +00:00
|
|
|
/// Do we need to update the change tracking presence flag?
|
|
|
|
bool needChangesUpdate() { return need_changes_update_; }
|
|
|
|
/// Force the change tracking presence flag to be updated
|
|
|
|
void forceChangesUpdate() { need_changes_update_ = true; }
|
|
|
|
/// Clear the flag indicating that we need to update the change tracking
|
|
|
|
/// presence flag
|
|
|
|
void clearChangesUpdate() { need_changes_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_;
|
2017-07-03 17:45:58 +00:00
|
|
|
///
|
2010-07-09 14:37:00 +00:00
|
|
|
bool need_buf_update_;
|
2010-10-17 10:44:53 +00:00
|
|
|
///
|
|
|
|
bool need_msg_update_;
|
2016-01-30 23:14:36 +00:00
|
|
|
///
|
|
|
|
bool need_changes_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
|