• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

svgpanel.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2008 by Aaron Seigo <aseigo@kde.org>
00003  *   Copyright 2008 Marco Martin <notmart@gmail.com>
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU Library General Public License as
00007  *   published by the Free Software Foundation; either version 2, or
00008  *   (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details
00014  *
00015  *   You should have received a copy of the GNU Library General Public
00016  *   License along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.,
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef PLASMA_SVGPANEL_H
00022 #define PLASMA_SVGPANEL_H
00023 
00024 #include <QtCore/QObject>
00025 #include <QPixmap>
00026 
00027 #include <plasma/plasma_export.h>
00028 
00029 #include <plasma/plasma.h>
00030 #include <plasma/svg.h>
00031 
00032 class QPainter;
00033 class QPoint;
00034 class QPointF;
00035 class QRect;
00036 class QRectF;
00037 class QSize;
00038 class QSizeF;
00039 class QMatrix;
00040 
00041 namespace Plasma
00042 {
00043 
00044 class PLASMA_EXPORT SvgPanel : public QObject
00045 {
00046     Q_OBJECT
00047     public:
00051         enum BorderFlag { DrawTopBorder = 1,
00052                           DrawBottomBorder = 2,
00053                           DrawLeftBorder = 4,
00054                           DrawRightBorder = 8,
00055                           ContentAtOrigin = 16,
00056                           DrawAllBorders = DrawTopBorder | DrawBottomBorder |
00057                                            DrawLeftBorder | DrawRightBorder
00058                         };
00059         Q_DECLARE_FLAGS(BorderFlags, BorderFlag)
00060 
00061         
00073         explicit SvgPanel(const QString& imagePath = QString(), QObject* parent = 0);
00074         ~SvgPanel();
00075 
00080         void setFile(const QString& imagePath);
00081 
00086         QString file() const;
00087 
00092         void setBorderFlags(const BorderFlags flags);
00093 
00098         BorderFlags borderFlags() const;
00099 
00104         void resize(const QSizeF& size);
00105 
00111         qreal marginSize(const Plasma::MarginEdge edge) const;
00112 
00117         void setPos( const QPointF& pos );
00118 
00123         QPointF pos() const;
00124 
00130         Q_INVOKABLE void paint(QPainter* painter, const QRectF& rect);
00131 
00132     Q_SIGNALS:
00133         void repaintNeeded();
00134 
00135     private slots:
00136         //update sizes of the svg elements
00137         void updateSizes();
00138 
00139     private:
00140         class Private;
00141         Private * const d;
00142 };
00143 
00144 } // Plasma namespace
00145 
00146 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::SvgPanel::BorderFlags)
00147 
00148 #endif // multiple inclusion guard

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal