![]() |
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 systemui. 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 STATUSINDICATORANIMATIONVIEW_H 00021 #define STATUSINDICATORANIMATIONVIEW_H 00022 00023 #include "statusindicator.h" 00024 #include "statusindicatormodel.h" 00025 #include "statusindicatoriconstyle.h" 00026 #include <MWidgetView> 00027 00028 class QPixmap; 00029 class QTimeLine; 00030 00035 class StatusIndicatorAnimationView : public MWidgetView 00036 { 00037 Q_OBJECT 00038 M_VIEW(StatusIndicatorModel, StatusIndicatorAnimationStyle) 00039 00040 public: 00046 StatusIndicatorAnimationView(StatusIndicator *controller); 00047 00051 virtual ~StatusIndicatorAnimationView(); 00052 00054 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; 00056 00057 protected slots: 00059 virtual void updateData(const QList<const char *>& modifications); 00061 00065 virtual void startAnimation(); 00066 00070 virtual void stopAnimation(); 00071 00077 void setAnimationFrame(int frame); 00078 00079 protected: 00081 virtual void drawContents(QPainter *painter, const QStyleOptionGraphicsItem *option) const; 00082 virtual void setupModel(); 00083 virtual void applyStyle(); 00085 00089 void setupAnimationTimeline(); 00090 00095 void setFirstAnimationFrame(int frame); 00096 00100 void clearImageList(); 00101 00107 void setupImageList(const QString &iconIDs); 00108 00109 00111 StatusIndicator *controller; 00112 00114 QStringList imageList; 00115 00117 mutable QVector<const QPixmap *> images; 00118 00120 int animationFrame; 00121 00123 int firstAnimationFrame; 00124 00126 QTimeLine *animationTimeline; 00127 00128 private: 00129 00131 void loadCurrentFrame(); 00133 void resizeToCurrentFrameIfNeeded(); 00134 00135 #ifdef UNIT_TEST 00136 friend class Ut_StatusIndicatorAnimationView; 00137 #endif 00138 }; 00139 00140 #endif
Copyright © 2011 Nokia Corporation | Generated on Tue Aug 30 2011 16:38:12 Doxygen 1.7.1 |
MeeGo Touch |