KNemo – network interfaces monitor for systray
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.3 KiB

  1. /* This file is part of KNemo
  2. Copyright (C) 2004 Percy Leonhardt <percy@eris23.de>
  3. KNemo is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of
  6. the License, or (at your option) any later version.
  7. KNemo is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef INTERFACETOOLTIP_H
  17. #define INTERFACETOOLTIP_H
  18. #include <tqpair.h>
  19. #include <tqtooltip.h>
  20. class Interface;
  21. /**
  22. * This call is responsible for displaying the tooltip of an
  23. * interface icon. It is derived from TQToolTip and overwrites
  24. * the function maybeTip(const TQPoint & p) to update the tooltip
  25. * text just before it is going to be displayed.
  26. *
  27. * @short Display tooltip according to user settings
  28. * @author Percy Leonhardt <percy@eris23.de>
  29. */
  30. class InterfaceToolTip : public TQToolTip
  31. {
  32. public:
  33. /**
  34. * Default Constructor
  35. */
  36. InterfaceToolTip( Interface* interface, TQWidget* parent = 0L );
  37. /**
  38. * Default Destructor
  39. */
  40. virtual ~InterfaceToolTip();
  41. /**
  42. * From the TQt documentation:
  43. * It is called when there is a possibility that a tool tip should
  44. * be shown and must decide whether there is a tool tip for the point p
  45. * in the widget that this TQToolTip object relates to. If so, maybeTip()
  46. * must call tip() with the rectangle the tip applies to, the tip's text
  47. * and optionally the TQToolTipGroup details and the tqgeometry in screen
  48. * coordinates.
  49. */
  50. void maybeTip( const TQPoint& );
  51. private:
  52. void setupText( TQString& text );
  53. void setupToolTipArray();
  54. // the interface this tooltip belongs to
  55. Interface* mInterface;
  56. // the tooltip text for each information
  57. TQPair<TQString, int> mToolTips[25];
  58. };
  59. #endif // INTERFACETOOLTIP_H