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

Plasma

framesvg.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_FRAMESVG_H
00022 #define PLASMA_FRAMESVG_H
00023 
00024 #include <QtCore/QObject>
00025 #include <QtGui/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 FrameSvgPrivate;
00045 
00076 class PLASMA_EXPORT FrameSvg : public Svg
00077 {
00078     Q_OBJECT
00079 
00080     friend class Applet;
00081 
00082     public:
00086         enum EnabledBorder {
00087             NoBorder = 0,
00088             TopBorder = 1,
00089             BottomBorder = 2,
00090             LeftBorder = 4,
00091             RightBorder = 8,
00092             AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder
00093         };
00094         Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder)
00095 
00096         
00105         explicit FrameSvg(QObject *parent = 0);
00106         ~FrameSvg();
00107 
00112         Q_INVOKABLE void setImagePath(const QString &path);
00113 
00118         Q_INVOKABLE void setEnabledBorders(const EnabledBorders borders);
00119 
00124         Q_INVOKABLE EnabledBorders enabledBorders() const;
00125 
00130         Q_INVOKABLE void resizeFrame(const QSizeF &size);
00131 
00135         Q_INVOKABLE QSizeF frameSize() const;
00136 
00142         Q_INVOKABLE qreal marginSize(const Plasma::MarginEdge edge) const;
00143 
00152         Q_INVOKABLE void getMargins(qreal &left, qreal &top, qreal &right, qreal &bottom) const;
00153 
00157         Q_INVOKABLE QRectF contentsRect() const;
00158 
00165         Q_INVOKABLE void setElementPrefix(Plasma::Location location);
00166 
00180         Q_INVOKABLE void setElementPrefix(const QString & prefix);
00181 
00187         Q_INVOKABLE bool hasElementPrefix(const QString & prefix) const;
00188 
00197         Q_INVOKABLE bool hasElementPrefix(Plasma::Location location) const;
00198 
00203         Q_INVOKABLE QString prefix();
00204 
00209         Q_INVOKABLE QRegion mask() const;
00210 
00214         QPixmap alphaMask() const;
00215 
00220         Q_INVOKABLE void setCacheAllRenderedFrames(bool cache);
00221 
00225         Q_INVOKABLE bool cacheAllRenderedFrames() const;
00226 
00232         Q_INVOKABLE void clearCache();
00233 
00241         Q_INVOKABLE QPixmap framePixmap();
00242 
00249         Q_INVOKABLE void paintFrame(QPainter *painter, const QRectF &target,
00250                                     const QRectF &source = QRectF());
00251 
00258         Q_INVOKABLE void paintFrame(QPainter *painter, const QPointF &pos = QPointF(0, 0));
00259 
00260     private:
00261         FrameSvgPrivate *const d;
00262 
00263         Q_PRIVATE_SLOT(d, void updateSizes())
00264         Q_PRIVATE_SLOT(d, void updateNeeded())
00265         Q_PRIVATE_SLOT(d, void scheduledCacheUpdate())
00266 };
00267 
00268 } // Plasma namespace
00269 
00270 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::FrameSvg::EnabledBorders)
00271 
00272 #endif // multiple inclusion guard

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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