Plasma
view.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2007 Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program 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 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_VIEW_H 00021 #define PLASMA_VIEW_H 00022 00023 #include <QtGui/QApplication> 00024 #include <QtGui/QGraphicsView> 00025 00026 #include <kconfiggroup.h> 00027 00028 #include <plasma/plasma_export.h> 00029 00030 namespace Plasma 00031 { 00032 00033 class Containment; 00034 class Corona; 00035 class ViewPrivate; 00036 00047 class PLASMA_EXPORT View : public QGraphicsView 00048 { 00049 Q_OBJECT 00050 00051 public: 00059 explicit View(Containment *containment, QWidget *parent = 0); 00060 00068 View(Containment *containment, int viewId, QWidget *parent = 0); 00069 00070 ~View(); 00071 00076 void setWallpaperEnabled(bool draw); 00077 00081 bool isWallpaperEnabled() const; 00082 00090 void setScreen(int screen, int desktop = -1); 00091 00097 int screen() const; 00098 00104 int desktop() const; 00105 00111 int effectiveDesktop() const; 00112 00116 Containment *containment() const; 00117 00126 Containment *swapContainment(Plasma::Containment *existing, 00127 const QString &name, 00128 const QVariantList &args = QVariantList()); 00129 00137 Containment *swapContainment(const QString &name, 00138 const QVariantList &args = QVariantList()); 00139 00146 void setTrackContainmentChanges(bool trackChanges); 00147 00151 bool trackContainmentChanges(); 00152 00157 static View * topLevelViewAt(const QPoint & pos); 00158 00162 int id() const; 00163 00164 Q_SIGNALS: 00171 void sceneRectAboutToChange(); 00172 00179 void sceneRectChanged(); 00180 00185 void lostContainment(); 00186 00187 public Q_SLOTS: 00194 virtual void setContainment(Plasma::Containment *containment); 00195 00196 protected: 00200 KConfigGroup config() const; 00201 00202 00206 void configNeedsSaving() const; 00207 00208 private: 00209 ViewPrivate * const d; 00210 00211 Q_PRIVATE_SLOT(d, void updateSceneRect()) 00212 Q_PRIVATE_SLOT(d, void containmentDestroyed()) 00213 Q_PRIVATE_SLOT(d, void containmentScreenChanged(int, int, Plasma::Containment *)) 00214 Q_PRIVATE_SLOT(d, void privateInit()) 00215 00216 friend class ViewPrivate; 00217 }; 00218 00219 } // namespace Plasma 00220 00221 #endif 00222
KDE 4.6 API Reference