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.
 
 
 
 
 
 

162 lines
3.9 KiB

  1. /*
  2. KSysGuard, the KDE System Guard
  3. Copyright (c) 1999 - 2001 Chris Schlaeger <cs@kde.org>
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of version 2 of the GNU General Public
  6. License as published by the Free Software Foundation.
  7. This program 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 General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  14. KSysGuard is currently maintained by Chris Schlaeger <cs@kde.org>.
  15. Please do not commit any changes without consulting me first. Thanks!
  16. $Id: SignalPlotter.h,v 1.5 2004/01/04 13:43:48 waba Exp $
  17. */
  18. #ifndef KSG_SIGNALPLOTTER_H
  19. #define KSG_SIGNALPLOTTER_H
  20. #include <tqpoint.h>
  21. #include <tqdialog.h>
  22. #include <tqptrlist.h>
  23. #include <tqstring.h>
  24. #include <tqvaluelist.h>
  25. #define GRAPH_POLYGON 0
  26. #define GRAPH_ORIGINAL 1
  27. class TQColor;
  28. class SignalPlotter : public TQDialog
  29. {
  30. Q_OBJECT
  31. TQ_OBJECT
  32. public:
  33. SignalPlotter( TQWidget *parent = 0, const char *name = 0 );
  34. ~SignalPlotter();
  35. /**
  36. * Implemented to store position.
  37. */
  38. void hide();
  39. void show();
  40. bool addBeam( const TQColor &color );
  41. void addSample( const TQValueList<double> &samples );
  42. void removeBeam( uint pos );
  43. void changeRange( int beam, double min, double max );
  44. TQValueList<TQColor> &beamColors();
  45. void setTitle( const TQString &title );
  46. TQString title() const;
  47. void setUseAutoRange( bool value );
  48. bool useAutoRange() const;
  49. void setMinValue( double min );
  50. double minValue() const;
  51. void setMaxValue( double max );
  52. double maxValue() const;
  53. void setGraphStyle( uint style );
  54. uint graphStyle() const;
  55. void setHorizontalScale( uint scale );
  56. uint horizontalScale() const;
  57. void setShowVerticalLines( bool value );
  58. bool showVerticalLines() const;
  59. void setVerticalLinesColor( const TQColor &color );
  60. TQColor verticalLinesColor() const;
  61. void setVerticalLinesDistance( int distance );
  62. int verticalLinesDistance() const;
  63. void setVerticalLinesScroll( bool value );
  64. bool verticalLinesScroll() const;
  65. void setShowHorizontalLines( bool value );
  66. bool showHorizontalLines() const;
  67. void setHorizontalLinesColor( const TQColor &color );
  68. TQColor horizontalLinesColor() const;
  69. void setHorizontalLinesCount( int count );
  70. int horizontalLinesCount() const;
  71. void setShowLabels( bool value );
  72. bool showLabels() const;
  73. void setShowTopBar( bool value );
  74. bool showTopBar() const;
  75. void setFontSize( int size );
  76. int fontSize() const;
  77. void setBackgroundColor( const TQColor &color );
  78. TQColor backgroundColor() const;
  79. protected:
  80. void updateDataBuffers();
  81. virtual void resizeEvent( TQResizeEvent* );
  82. virtual void paintEvent( TQPaintEvent* );
  83. private:
  84. TQPoint mPos;
  85. bool mPosInitialized;
  86. double mMinValue;
  87. double mMaxValue;
  88. bool mUseAutoRange;
  89. uint mGraphStyle;
  90. bool mShowVerticalLines;
  91. TQColor mVerticalLinesColor;
  92. uint mVerticalLinesDistance;
  93. bool mVerticalLinesScroll;
  94. uint mVerticalLinesOffset;
  95. uint mHorizontalScale;
  96. bool mShowHorizontalLines;
  97. TQColor mHorizontalLinesColor;
  98. uint mHorizontalLinesCount;
  99. bool mShowLabels;
  100. bool mShowTopBar;
  101. uint mFontSize;
  102. TQColor mBackgroundColor;
  103. TQPtrList<double> mBeamData;
  104. TQValueList<TQColor> mBeamColor;
  105. int mSamples;
  106. /**
  107. * The name of the interface.
  108. * Needed to store the geometry of the plotter in the right
  109. * group of the config file.
  110. */
  111. TQString mName;
  112. TQString mTitle;
  113. };
  114. #endif