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

libplasma

panelsvg.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_PANELSVG_H
00022 #define PLASMA_PANELSVG_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 PanelSvgPrivate;
00045 
00046 class PLASMA_EXPORT PanelSvg : public Svg
00047 {
00048     Q_OBJECT
00049     public:
00053         enum EnabledBorder { NoBorder = 0,
00054                              TopBorder = 1,
00055                              BottomBorder = 2,
00056                              LeftBorder = 4,
00057                              RightBorder = 8,
00058                              AllBorders = TopBorder | BottomBorder |
00059                                               LeftBorder | RightBorder
00060                            };
00061         Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder)
00062 
00063         
00072         explicit PanelSvg(QObject* parent = 0);
00073         ~PanelSvg();
00074 
00079         void setImagePath(const QString& path);
00080 
00085         void setEnabledBorders(const EnabledBorders borders);
00086 
00091         EnabledBorders enabledBorders() const;
00092 
00097         void resizePanel(const QSizeF& size);
00098 
00102         QSizeF panelSize() const;
00103 
00109         qreal marginSize(const Plasma::MarginEdge edge) const;
00110 
00119         void getMargins(qreal &left, qreal &top, qreal &right, qreal &bottom) const;
00120 
00127         void setElementPrefix(Plasma::Location location);
00128 
00142         void setElementPrefix(const QString & prefix);
00143 
00149         bool hasElementPrefix(const QString & prefix) const;
00150 
00159         bool hasElementPrefix(Plasma::Location location) const;
00160 
00165         QString prefix();
00166 
00171         QBitmap mask() const;
00172 
00177        void setCacheAllRenderedPanels(bool cache);
00178 
00182        bool cacheAllRenderedPanels() const;
00183 
00189        void clearCache();
00190 
00196         Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& rect, const QPointF& pos = QPointF(0, 0));
00197 
00198     private:
00199         PanelSvgPrivate * const d;
00200 
00201         Q_PRIVATE_SLOT(d, void updateSizes())
00202         Q_PRIVATE_SLOT(d, void updateNeeded())
00203 };
00204 
00205 } // Plasma namespace
00206 
00207 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::PanelSvg::EnabledBorders)
00208 
00209 #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
  •   libsolidcontrol
  •   libtaskmanager
  • 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