qwt_polar_layout.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * QwtPolar Widget Library
  3. * Copyright (C) 2008 Uwe Rathmann
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the Qwt License, Version 1.0
  7. *****************************************************************************/
  8. #ifndef QWT_POLAR_LAYOUT_H
  9. #define QWT_POLAR_LAYOUT_H
  10. #include "qwt_polar_global.h"
  11. #include "qwt_polar_plot.h"
  12. /*!
  13. \brief Layout class for QwtPolarPlot.
  14. Organizes the geometry for the different QwtPolarPlot components.
  15. It is used by the QwtPolar widget to organize its internal widgets
  16. or by QwtPolarRnderer to render its content to a QPaintDevice like
  17. a QPrinter, QPixmap/QImage or QSvgRenderer.
  18. */
  19. class QWT_POLAR_EXPORT QwtPolarLayout
  20. {
  21. public:
  22. //! \brief Options to configure the plot layout engine
  23. enum Option
  24. {
  25. //! Ignore the dimension of the scrollbars.
  26. IgnoreScrollbars = 0x01,
  27. //! Ignore all frames.
  28. IgnoreFrames = 0x02,
  29. //! Ignore the title.
  30. IgnoreTitle = 0x04,
  31. //! Ignore the legend.
  32. IgnoreLegend = 0x08
  33. };
  34. //! Options to configure the plot layout engine
  35. typedef QFlags<Option> Options;
  36. explicit QwtPolarLayout();
  37. virtual ~QwtPolarLayout();
  38. void setLegendPosition( QwtPolarPlot::LegendPosition pos, double ratio );
  39. void setLegendPosition( QwtPolarPlot::LegendPosition pos );
  40. QwtPolarPlot::LegendPosition legendPosition() const;
  41. void setLegendRatio( double ratio );
  42. double legendRatio() const;
  43. virtual void activate( const QwtPolarPlot *,
  44. const QRectF &rect, Options options = 0 );
  45. virtual void invalidate();
  46. const QRectF &titleRect() const;
  47. const QRectF &legendRect() const;
  48. const QRectF &canvasRect() const;
  49. class LayoutData;
  50. protected:
  51. QRectF layoutLegend( Options options, QRectF & ) const;
  52. private:
  53. class PrivateData;
  54. PrivateData *d_data;
  55. };
  56. Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options )
  57. #endif