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 /* Tooltips for xforms. xforms 0.89 supports them directly, but 0.88 needs
13 * a bit of jiggery pokery. This class wraps it all up in a neat interface.
14 * Based on code originally in Toolbar_pimpl.C that appears to have been
15 * written by Matthias Ettrich and Jean-Marc Lasgouttes.
24 #include <boost/utility.hpp>
25 #include <boost/signals/signal0.hpp>
26 #include <boost/signals/trackable.hpp>
28 #include "forms_fwd.h" // Can't forward-declare FL_OBJECT
32 class Tooltips : boost::noncopyable, public boost::signals::trackable {
37 /// Initialise a tooltip for this ob.
38 void init(FL_OBJECT * ob, string const & tip);
40 /// Are the tooltips on or off?
41 static bool enabled() { return enabled_; }
43 /** This method is connected to Dialogs::toggleTooltips and toggles
44 * the state of enabled_.
46 static void toggleEnabled();
50 /// This method is connected to the Tooltips::toggled signal.
53 /// Are the tooltips on or off?
56 /** Once enabled_ is changed, then this signal is emitted to update
59 static boost::signal0<void> toggled;
61 /// The tooltips are stored so that they can be turned on and off.
62 typedef std::map<FL_OBJECT *, string> TooltipsMap;
64 TooltipsMap tooltipsMap;