3 * \file FeedbackController.h
4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Angus Leeming, a.leeming@ic.ac.uk
10 /* A common interface for posting feedback messages to a message widget in
12 * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
13 * either can interface tooltips in the same way.
16 #ifndef FEEDBACKCONTROLLER_H
17 #define FEEDBACKCONTROLLER_H
19 #include "forms_fwd.h"
26 class FeedbackController
32 virtual ~FeedbackController();
34 /** Input callback function, invoked only by the xforms callback
35 interface. Is defined by FormBase, FormBaseDeprecated. */
36 virtual void InputCB(FL_OBJECT *, long) = 0;
38 /** Message callback function, invoked only by the xforms callback
40 void MessageCB(FL_OBJECT *, int event);
42 /** Prehandler callback function, invoked only by the xforms callback
44 void PrehandlerCB(FL_OBJECT * ob, int event, int key);
47 /** Pass the class a pointer to the message_widget so that it can
49 void setMessageWidget(FL_OBJECT * message_widget);
51 /** Send the warning message from the daughter class to the
52 message_widget direct. The message will persist till the mouse
53 movesto a new object. */
54 void postWarning(string const & warning);
55 /// Reset the message_widget_
59 /** Get the feedback message for ob.
60 Called if warning_posted_ == false. */
61 virtual string const getFeedback(FL_OBJECT * /* ob */)
64 /// Post the feedback message for ob to message_widget_
65 void postMessage(string const & message);
67 /** Variable used to decide whether to remove the existing feedback
68 message or not (if it is in fact a warning) */
71 /// The widget to display the feedback
72 FL_OBJECT * message_widget_;
75 #endif // FEEDBACKCONTROLLER_H