Qwt Polar User's Guide  1.0.1
qwt_polar_layout.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * QwtPolar Widget Library
00003  * Copyright (C) 2008   Uwe Rathmann
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the Qwt License, Version 1.0
00007  *****************************************************************************/
00008 
00009 #ifndef QWT_POLAR_LAYOUT_H
00010 #define QWT_POLAR_LAYOUT_H
00011 
00012 #include "qwt_polar_global.h"
00013 #include "qwt_polar_plot.h"
00014 
00024 class QWT_POLAR_EXPORT QwtPolarLayout
00025 {
00026 public:
00027 
00029     enum Option
00030     {
00032         IgnoreScrollbars = 0x01,
00033 
00035         IgnoreFrames     = 0x02,
00036 
00038         IgnoreTitle      = 0x04,
00039 
00041         IgnoreLegend     = 0x08
00042     };
00043 
00045     typedef QFlags<Option> Options;
00046 
00047     explicit QwtPolarLayout();
00048     virtual ~QwtPolarLayout();
00049 
00050     void setLegendPosition( QwtPolarPlot::LegendPosition pos, double ratio );
00051     void setLegendPosition( QwtPolarPlot::LegendPosition pos );
00052     QwtPolarPlot::LegendPosition legendPosition() const;
00053 
00054     void setLegendRatio( double ratio );
00055     double legendRatio() const;
00056 
00057     virtual void activate( const QwtPolarPlot *,
00058         const QRectF &rect, Options options = 0 );
00059 
00060     virtual void invalidate();
00061 
00062     const QRectF &titleRect() const;
00063     const QRectF &legendRect() const;
00064     const QRectF &canvasRect() const;
00065 
00066     class LayoutData;
00067 
00068 protected:
00069     QRectF layoutLegend( Options options, QRectF & ) const;
00070 
00071 private:
00072     class PrivateData;
00073     PrivateData *d_data;
00074 };
00075 
00076 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options )
00077 
00078 #endif