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. public:
  33. /**
  34. * Default Constructor
  35. */
  36. InterfaceMonitor(TQObject* parent = 0L, const char* name = 0L);
  37. /**
  38. * Default Destructor
  39. */
  40. virtual ~InterfaceMonitor();
  41. /**
  42. * Tell the monitor to check the status of the interface
  43. */
  44. void checkStatus( Interface* interface );
  45. signals:
  46. // the interface is now connected
  47. void available( int );
  48. // the interface is now disconnected
  49. void notAvailable( int );
  50. // the interface no longer exists
  51. void notExisting( int );
  52. // there was incoming and/or outgoing traffic
  53. void statusChanged( int );
  54. // the amount of incoming traffic (for statistics)
  55. void incomingData( unsigned long );
  56. // the amount of outgoing traffic (for statistics)
  57. void outgoingData( unsigned long );
  58. };
  59. #endif // INTERFACEMONITOR_H