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.
 
 
 
 
 
 

74 lines
2.1 KiB

  1. /* This file is part of KNemo
  2. Copyright (C) 2004, 2006 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 INTERFACEMONITOR_H
  17. #define INTERFACEMONITOR_H
  18. #include <tqobject.h>
  19. #include "data.h"
  20. class Interface;
  21. /**
  22. * This class monitors the interface for possible state changes and
  23. * for incoming and outgong traffic. If the state changed or traffic
  24. * was transmitted it sends an according signal.
  25. *
  26. * @short Monitor changes of the interface
  27. * @author Percy Leonhardt <percy@eris23.de>
  28. */
  29. class InterfaceMonitor : public TQObject
  30. {
  31. Q_OBJECT
  32. TQ_OBJECT
  33. public:
  34. /**
  35. * Default Constructor
  36. */
  37. InterfaceMonitor(TQObject* parent = 0L, const char* name = 0L);
  38. /**
  39. * Default Destructor
  40. */
  41. virtual ~InterfaceMonitor();
  42. /**
  43. * Tell the monitor to check the status of the interface
  44. */
  45. void checkStatus( Interface* interface );
  46. signals:
  47. // the interface is now connected
  48. void available( int );
  49. // the interface is now disconnected
  50. void notAvailable( int );
  51. // the interface no longer exists
  52. void notExisting( int );
  53. // there was incoming and/or outgoing traffic
  54. void statusChanged( int );
  55. // the amount of incoming traffic (for statistics)
  56. void incomingData( unsigned long );
  57. // the amount of outgoing traffic (for statistics)
  58. void outgoingData( unsigned long );
  59. };
  60. #endif // INTERFACEMONITOR_H