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.
 
 
 
 
 
 

112 lines
2.8 KiB

  1. /* This file is part of KNemo
  2. Copyright (C) 2004, 2005 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 INTERFACEICON_H
  17. #define INTERFACEICON_H
  18. #include <tqobject.h>
  19. #include <tqstring.h>
  20. class Interface;
  21. class InterfaceTray;
  22. /**
  23. * This is the logical representation of the systemtray icon. It handles
  24. * creation and deletion of the real icon, setting the tooltip, setting
  25. * the correct icon image and displaying of the settings dialog.
  26. *
  27. * @short Logical representation of the systemtray icon
  28. * @author Percy Leonhardt <percy@eris23.de>
  29. */
  30. class InterfaceIcon : public TQObject
  31. {
  32. Q_OBJECT
  33. TQ_OBJECT
  34. public:
  35. /**
  36. * Default Constructor
  37. */
  38. InterfaceIcon( Interface* interface );
  39. /**
  40. * Default Destructor
  41. */
  42. virtual ~InterfaceIcon();
  43. /*
  44. * Change the tooltip according to the alias of the interface
  45. */
  46. void updateToolTip();
  47. /*
  48. * Fill the context menu with entries if the user configured
  49. * start and stop command
  50. */
  51. void updateMenu();
  52. signals:
  53. void statisticsSelected();
  54. public slots:
  55. /*
  56. * Changes the icon image displayed in the tray
  57. */
  58. void updateStatus( int status );
  59. /*
  60. * Creates or deletes the tray icon
  61. */
  62. void updateTrayStatus( int previousState );
  63. /*
  64. * Resizes the tray icon
  65. */
  66. void resizeIcon();
  67. private slots:
  68. /*
  69. * Called when the user selects 'Configure KNemo' from the context menu
  70. */
  71. void showConfigDialog();
  72. /*
  73. * Called when the user setup custom commands and selects one
  74. * in the context menu
  75. */
  76. void menuActivated( int id );
  77. private:
  78. // the interface this icon belongs to
  79. Interface* mInterface;
  80. // the real tray icon
  81. InterfaceTray* mTray;
  82. static const TQString ICON_DISCONNECTED;
  83. static const TQString ICON_CONNECTED;
  84. static const TQString ICON_INCOMING;
  85. static const TQString ICON_OUTGOING;
  86. static const TQString ICON_TRAFFIC;
  87. static const TQString SUFFIX_PPP;
  88. static const TQString SUFFIX_LAN;
  89. static const TQString SUFFIX_WLAN;
  90. };
  91. #endif // INTERFACEICON_H