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.
21 #include <boost/signal.hpp>
22 #include <boost/signals/trackable.hpp>
24 #include "forms_fwd.h" // Can't forward-declare FL_OBJECT
31 class Tooltips : boost::noncopyable, public boost::signals::trackable {
36 /// Initialise a tooltip for this ob.
37 void init(FL_OBJECT * ob, std::string const & tip);
39 /// Are the tooltips on or off?
40 static bool enabled() { return enabled_; }
42 /** This method is connected to Dialogs::toggleTooltips and toggles
43 * the state of enabled_.
45 static void toggleEnabled();
49 /// This method is connected to the Tooltips::toggled signal.
52 /// Are the tooltips on or off?
55 /** Once enabled_ is changed, then this signal is emitted to update
58 static boost::signal<void()> toggled;
60 /// The tooltips are stored so that they can be turned on and off.
61 typedef std::map<FL_OBJECT *, std::string> TooltipsMap;
63 TooltipsMap tooltipsMap;
66 } // namespace frontend