]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Tooltips.h
Stabilise the tooltips interface and use it successfully in the Bibtex,
[lyx.git] / src / frontends / xforms / Tooltips.h
1 // -*- C++ -*-
2 /*
3  * \file Tooltips.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Angus Leeming, a.leeming@ic.ac.uk
8  *
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.
13  */
14
15 #ifndef TOOLTIPS_H
16 #define TOOLTIPS_H
17
18 #include "LString.h"
19 #include <boost/utility.hpp>
20 #include <sigc++/signal_system.h>
21 #include FORMS_H_LOCATION // Can't forward-declare FL_OBJECT
22
23 #ifdef __GNUG__
24 #pragma interface
25 #endif
26
27 class Tooltips : boost::noncopyable {
28 public:
29         /// Activate tooltips for this ob
30         void activateTooltip(FL_OBJECT * ob);
31         /** Connect this signal to the function returning the tooltip for ob
32             Eg, string FormBase::getTooltip(FL_OBJECT const *)
33             Note that SigC is unable to create a Signal1 returning string const
34             or to connect it to a const method.
35          */
36         SigC::Signal1<string, FL_OBJECT const *> getTooltip;
37
38         // We use the old method because we want to change tooltips on the fly
39 //#if FL_REVISION < 89
40         ///
41         Tooltips() : tooltip_timer_(0) {}
42
43 private:
44
45         FL_OBJECT * tooltip_timer_;
46 //#endif
47 };
48
49 #endif // TOOLTIPS_H