4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Angus Leeming, a.leeming@ic.ac.uk
9 * Tooltips for xforms. xforms 0.89 supports them directly, but 0.88 needs
10 * a bit of jiggery pokery. This class wraps it all up in a neat interface.
11 * Based on code originally in Toolbar_pimpl.C that appears to have been
12 * written by Matthias Ettrich and Jean-Marc Lasgouttes.
19 #include <boost/utility.hpp>
20 #include <sigc++/signal_system.h>
21 #include FORMS_H_LOCATION // Can't forward-declare FL_OBJECT
28 class Tooltips : boost::noncopyable, public SigC::Object {
32 /// Initialise a tooltip for this ob
33 void initTooltip(FL_OBJECT * ob, string const & tip);
35 /// Are the tooltips on or off?
36 static bool enabled() { return enabled_; }
40 /// Return the tooltip associated with this object
41 string const getTooltip(FL_OBJECT *) const;
47 /// Are the tooltips on or off?
50 /** This method is connected to Dialogs::toggleTooltips and toggles
51 * the state of enabled_
53 static void toggleEnabled();
55 /** Once enabled_ is changed, then this signal is emitted to update
58 static SigC::Signal0<void> tooltipsToggled;
60 /// This method is connected to the tooltipsToggled signal.
61 void toggleTooltips();
63 /// The tooltips are stored so that they can be turned on and off
64 typedef std::map<FL_OBJECT *, string> TooltipsMap;
66 TooltipsMap tooltipsMap;
70 FL_OBJECT * tooltip_timer_;
72 #endif // FL_REVISION >= 89