qwt_legend_itemmanager.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * Qwt Widget Library
  3. * Copyright (C) 1997 Josef Wilgen
  4. * Copyright (C) 2002 Uwe Rathmann
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Qwt License, Version 1.0
  8. *****************************************************************************/
  9. #ifndef QWT_LEGEND_ITEM_MANAGER_H
  10. #define QWT_LEGEND_ITEM_MANAGER_H
  11. #include "qwt_global.h"
  12. class QwtLegend;
  13. class QWidget;
  14. class QRectF;
  15. class QPainter;
  16. /*!
  17. \brief Abstract API to bind plot items to the legend
  18. */
  19. class QWT_EXPORT QwtLegendItemManager
  20. {
  21. public:
  22. //! Constructor
  23. QwtLegendItemManager()
  24. {
  25. }
  26. //! Destructor
  27. virtual ~QwtLegendItemManager()
  28. {
  29. }
  30. /*!
  31. Update the widget that represents the item on the legend
  32. \param legend Legend
  33. \sa legendItem()
  34. */
  35. virtual void updateLegend( QwtLegend *legend ) const = 0;
  36. /*!
  37. Allocate the widget that represents the item on the legend
  38. \return Allocated widget
  39. \sa updateLegend() QwtLegend()
  40. */
  41. virtual QWidget *legendItem() const = 0;
  42. /*!
  43. QwtLegendItem can display an icon-identifier followed
  44. by a text. The icon helps to identify a plot item on
  45. the plot canvas and depends on the type of information,
  46. that is displayed.
  47. The default implementation paints nothing.
  48. */
  49. virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const
  50. {
  51. }
  52. };
  53. #endif