3 * \file FeedbackController.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS
12 /* A common interface for posting feedback messages to a message widget in
14 * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
15 * either can interface tooltips in the same way.
18 #ifndef FEEDBACKCONTROLLER_H
19 #define FEEDBACKCONTROLLER_H
25 #include "forms_fwd.h"
28 class FeedbackController
34 virtual ~FeedbackController();
36 /** Input callback function, invoked only by the xforms callback
37 interface. Is defined by FormBase, FormBaseDeprecated. */
38 virtual void InputCB(FL_OBJECT *, long) = 0;
40 /** Message callback function, invoked only by the xforms callback
42 void MessageCB(FL_OBJECT *, int event);
44 /** Prehandler callback function, invoked only by the xforms callback
46 void PrehandlerCB(FL_OBJECT * ob, int event, int key);
49 /** Pass the class a pointer to the message_widget so that it can
51 void setMessageWidget(FL_OBJECT * message_widget);
53 /** Send the warning message from the daughter class to the
54 message_widget direct. The message will persist till the mouse
55 movesto a new object. */
56 void postWarning(string const & warning);
57 /// Reset the message_widget_
61 /** Get the feedback message for ob.
62 Called if warning_posted_ == false. */
63 virtual string const getFeedback(FL_OBJECT * /* ob */)
66 /// Post the feedback message for ob to message_widget_
67 void postMessage(string const & message);
69 /** Variable used to decide whether to remove the existing feedback
70 message or not (if it is in fact a warning) */
73 /// The widget to display the feedback
74 FL_OBJECT * message_widget_;
77 #endif // FEEDBACKCONTROLLER_H