Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of mhome. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #ifndef SWITCHERBUTTONVIEW_H 00021 #define SWITCHERBUTTONVIEW_H 00022 00023 #include <MButtonView> 00024 #include <QTimer> 00025 #include "switcherbuttonmodel.h" 00026 #include "switcherbuttonstyle.h" 00027 #include "x11wrapper.h" 00028 00029 class SwitcherButton; 00030 class XEventListener; 00031 00037 class SwitcherButtonView : public MButtonView 00038 { 00039 Q_OBJECT 00040 M_VIEW(SwitcherButtonModel, SwitcherButtonStyle) 00041 00042 public: 00048 SwitcherButtonView(SwitcherButton *controller); 00049 00053 virtual ~SwitcherButtonView(); 00054 00056 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 00057 virtual void drawBackground(QPainter *painter, const QStyleOptionGraphicsItem *option) const; 00058 virtual void drawContents(QPainter *painter, const QStyleOptionGraphicsItem *option) const; 00059 virtual void applyStyle(); 00061 00067 bool windowFullyObscured(Window window); 00068 00069 protected slots: 00071 virtual void updateData(const QList<const char *>& modifications); 00073 00077 virtual void damageEvent(Qt::HANDLE &damage, short &x, short &y, unsigned short &width, unsigned short &height); 00078 00082 void setOnDisplay(); 00083 00087 void unsetOnDisplay(); 00088 00089 private slots: 00093 void updateXWindowIconGeometry(); 00094 00098 void updateXWindowPixmap(); 00099 00100 protected: 00104 void createDamage(); 00105 00109 void destroyDamage(); 00110 00112 virtual QPoint thumbnailPosition() const; 00113 00115 virtual void setupModel(); 00117 00119 SwitcherButton *controller; 00120 00122 void updateXWindowIconGeometryIfNecessary() const; 00123 00125 void updateViewMode(); 00126 00127 #ifdef Q_WS_X11 00128 00129 static int handleXError(Display *display, XErrorEvent *event); 00130 00132 static unsigned char xErrorCode; 00133 #endif 00134 00136 Pixmap xWindowPixmap; 00137 00139 bool xWindowPixmapIsValid; 00140 00142 Damage xWindowPixmapDamage; 00143 00145 QPixmap qWindowPixmap; 00146 00148 QPointF dragStartPos; 00149 00151 bool onDisplay; 00152 00154 mutable QTimer updateXWindowIconGeometryTimer; 00155 00157 QRectF updatedXWindowIconGeometry; 00158 00160 static Atom iconGeometryAtom; 00161 00163 QSharedPointer<XEventListener> xEventListener; 00164 00165 #ifdef UNIT_TEST 00166 friend class Ut_SwitcherButtonView; 00167 #endif 00168 00169 Q_DISABLE_COPY(SwitcherButtonView); 00170 }; 00171 00172 #endif
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |