Home · All Namespaces · All Classes · Main Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Karoliina T. Salminen <karoliina.t.salminen@nokia.com> 00006 ** 00007 ** This file is part of mcontrolpanel. 00008 ** 00009 ** 00010 ** This library is free software; you can redistribute it and/or 00011 ** modify it under the terms of the GNU Lesser General Public 00012 ** License version 2.1 as published by the Free Software Foundation 00013 ** and appearing in the file LICENSE.LGPL included in the packaging 00014 ** of this file. 00015 ** 00016 ****************************************************************************/ 00017 00018 /* -*- Mode: C; indent-tabs-mode: s; c-basic-offset: 4; tab-width: 4 -*- */ 00019 /* vim:set et ai sw=4 ts=4 sts=4: tw=80 cino="(0,W2s,i2s,t0,l1,:0" */ 00020 #ifndef DCPCONTENTITEM_H 00021 #define DCPCONTENTITEM_H 00022 00023 #include <MListItem> 00024 00025 class DcpAppletObject; 00026 class DcpAppletMetadata; 00027 class DcpContentItemPrivate; 00028 class MLayout; 00029 class MGridLayoutPolicy; 00030 class QGraphicsGridLayout; 00031 00047 class DcpContentItem: public MListItem 00048 { 00049 Q_OBJECT 00050 00051 // some readonly properties, can be used for tdriver tests 00052 Q_PROPERTY (QString title READ title) 00053 Q_PROPERTY (QString subtitle READ subtitle) 00054 Q_PROPERTY (bool checked READ isChecked) 00055 Q_PROPERTY (int widgetType READ widgetType) 00056 Q_PROPERTY (QString imageID READ imageID) 00057 00059 Q_PROPERTY (QString mattiID READ mattiID WRITE setMattiID) 00060 Q_PROPERTY (QString TDriverID READ TDriverID WRITE setTDriverID) 00062 00063 public: 00069 DcpContentItem ( 00070 DcpAppletObject *applet = 0, 00071 QGraphicsItem *parent = 0); 00072 00073 ~DcpContentItem (); 00074 00080 void setApplet (DcpAppletObject *applet); 00081 void setMetadata (DcpAppletMetadata *metadata); 00082 00084 DcpAppletObject *applet () const; 00085 DcpAppletMetadata *metadata () const; 00086 00087 void loadApplet(); 00088 00090 void setMattiID (const QString& mattid); 00091 QString mattiID () const; 00092 void setTDriverID (const QString& tdriverid); 00093 QString TDriverID () const; 00095 00096 protected slots: 00101 void updateContents (); 00102 00103 void onClicked (); 00104 void sliderChanged(int value); 00105 void onToggleChanged (bool toggle); 00106 00107 protected: 00108 virtual void retranslateUi (); 00109 virtual void showEvent (QShowEvent *event); 00110 virtual void hideEvent (QHideEvent *event); 00111 00114 virtual void constructRealWidget (); 00115 00117 void updateText (); 00118 00120 void updateImage (); 00121 00122 // image related things: 00123 void setImageFromFile (const QString& fileName); 00124 void setImageName (const QString& name); 00125 00126 // getters about applet properties: 00127 int widgetType() const; 00128 bool hasTwoTextLines() const; 00129 bool isChecked() const; 00130 QString title() const; 00131 QString subtitle() const; 00132 QString imageID() const; 00133 QString helpID() const; 00134 00135 private: 00136 // creating widgets, layouts: 00137 void ensureLayoutIsCreated(QGraphicsGridLayout*& layout); 00138 void ensureImageIsCreated(); 00139 void ensureToggleIsCreated(); 00140 void ensureTextsAreCreated(); 00141 void ensureWidgetsAreLayouted(); 00142 void ensureHelpIsCreated(); 00143 void ensureSliderIsCreated(); 00144 void clearAppletData(); 00145 00146 DcpContentItemPrivate* const d_ptr; 00147 00148 friend class Ut_DcpContentItem; 00149 00150 signals: 00151 void helpPageOpened(const QString& helpId); 00152 public slots: 00153 void helpClicked(); 00154 }; 00155 00156 00157 #endif 00158 00159
Copyright © 2009 Nokia Corporation | Generated on Tue Jul 5 2011 15:01:31 Doxygen 1.7.1 |
Meego control panel |