kexi

reportwidgets.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXIREPORTWIDGETS_H
00021 #define KEXIREPORTWIDGETS_H
00022 
00023 #include <qlabel.h>
00024 #include <qscrollview.h>
00025 
00026 namespace KFormDesigner {
00027     class Form;
00028     class FormManager;
00029 }
00030 
00031 using KFormDesigner::Form;
00032 
00034 class KexiSubReport : public QScrollView
00035 {
00036     Q_OBJECT
00037     Q_PROPERTY(QString reportName READ reportName WRITE setReportName DESIGNABLE true);
00038 
00039     public:
00040         KexiSubReport(QWidget *parent, const char *name);
00041         ~KexiSubReport() {}
00042 
00044         QString reportName() const { return m_reportName; }
00045         void setReportName(const QString &name);
00046 
00047     private:
00048 //      KFormDesigner::FormManager *m_manager;
00049         Form   *m_form;
00050         QWidget  *m_widget;
00051         QString   m_reportName;
00052 };
00053 
00055 class Label : public QLabel
00056 {
00057     Q_OBJECT
00058 
00059     public:
00060         Label(const QString &text, QWidget *parent, const char *name);
00061         ~Label() {}
00062 };
00063 
00065 class PicLabel : public QLabel
00066 {
00067     Q_OBJECT
00068 
00069     public:
00070         PicLabel(const QPixmap &pix, QWidget *parent, const char *name);
00071         ~PicLabel() {}
00072 
00073         virtual bool setProperty(const char *name, const QVariant &value);
00074 };
00075 
00077 class ReportLine : public QWidget
00078 {
00079     Q_OBJECT
00080     Q_PROPERTY(ReportLineStyle lineStyle READ lineStyle WRITE setLineStyle)
00081     Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
00082     Q_PROPERTY(QColor color READ color WRITE setColor)
00083     Q_PROPERTY(CapStyle capStyle READ capStyle WRITE setCapStyle)
00084 
00085     public:
00086         enum ReportLineStyle { NoLine = Qt::NoPen, Solid = Qt::SolidLine, Dash = Qt::DashLine,  Dot = Qt::DotLine,
00087             DashDot = Qt::DashDotLine, DashDotDot =  Qt::DashDotDotLine };
00088         enum CapStyle { Flat = Qt::FlatCap, Square = Qt::SquareCap, Round = Qt::RoundCap };
00089 
00090         ReportLine(QWidget *parent, const char *name);
00091         ~ReportLine(){;}
00092 
00093         ReportLineStyle lineStyle() const;
00094         void setLineStyle(ReportLineStyle style);
00095 
00096         int lineWidth() const;
00097         void setLineWidth(int width);
00098 
00099         QColor color() const;
00100         void setColor(const QColor &color);
00101 
00102         CapStyle capStyle() const;
00103         void setCapStyle(CapStyle capStyle);
00104 
00105     protected:
00106         virtual void paintEvent (QPaintEvent *ev);
00107 
00108     private:
00109         ReportLineStyle m_lineStyle;
00110         int m_lineWidth;
00111         CapStyle m_capStyle;
00112         QColor  m_color;
00113 };
00114 
00115 
00116 #endif
00117 
KDE Home | KDE Accessibility Home | Description of Access Keys