Home · All Namespaces · All Classes

StatusIndicator Class Reference

#include <statusindicator.h>

Inheritance diagram for StatusIndicator:
Inheritance graph
[legend]
Collaboration diagram for StatusIndicator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StatusIndicator (QGraphicsItem *parent=NULL)
virtual ~StatusIndicator ()
 Destructor.
virtual void updateGeometry ()
 REIMPLEMENTATION

Protected Member Functions

void setValue (QVariant v)
 
QVariant value () const
void updateAnimationStatus ()
 Updates the animation status of the views.
ContextItemcreateContextItem (ApplicationContext &context, const QString &key)

Protected Attributes

bool animateIfPossible
 Whether or not the view should animate if possible.

Properties

QVariant value

Detailed Description

StatusIndicator is a widget for displaying either image or text based status indicators in the status indicator area of the home screen.

Definition at line 39 of file statusindicator.h.


Constructor & Destructor Documentation

StatusIndicator::StatusIndicator ( QGraphicsItem *  parent = NULL  )  [explicit]

Constructs a StatusIndicator.

Parameters:
parent parent MWidget

Definition at line 50 of file statusindicator.cpp.

00050                                                       :
00051     MWidgetController(new StatusIndicatorModel, parent),
00052     animateIfPossible(false),
00053     modelUpdatesEnabled(true),
00054     currentValue(QVariant())
00055 {
00056 }

StatusIndicator::~StatusIndicator (  )  [virtual]

Destructor.

Definition at line 58 of file statusindicator.cpp.

00059 {
00060     foreach(ContextItem* item, contextItems) {
00061         delete item;
00062     }
00063 }


Member Function Documentation

ContextItem * StatusIndicator::createContextItem ( ApplicationContext context,
const QString &  key 
) [protected]

Returns a context item with the specified key newly allocated from the specified application context.

Parameters:
context Context framework application context for the context item to be allocated from.
key Unique intifier of the context item in the application context that is to be monitored.
Returns:
New ContextItem object tracking the particular context item in the system. The created ContextItem is owned by the StatusIdicator class and shall not be deleted by the caller.

Definition at line 117 of file statusindicator.cpp.

00118 {
00119     ContextItem *item = context.createContextItem(key);
00120     contextItems.append(item);
00121     return item;
00122 }

Here is the call graph for this function:

void StatusIndicator::setValue ( QVariant  v  )  [protected]

Sets the value of the indicator. This will be used by the dynamic indicators to change their appearance based on some value. The type of the value is determined by the indicator type. For indicators that display an image from a list of images, the value is a float 0 to 1 which is used to determine the used image. For indicators that display text, the value is the string to display.

Definition at line 70 of file statusindicator.cpp.

00071 {
00072     currentValue = v;
00073     if (modelUpdatesEnabled) {
00074         model()->setValue(v);
00075     }
00076 }

void StatusIndicator::updateAnimationStatus (  )  [protected]

Updates the animation status of the views.

Definition at line 108 of file statusindicator.cpp.

00109 {
00110     if (modelUpdatesEnabled) {
00111         model()->setAnimate(animateIfPossible);
00112     } else {
00113         model()->setAnimate(false);
00114     }
00115 }

void StatusIndicator::updateGeometry (  )  [virtual]

REIMPLEMENTATION

Definition at line 65 of file statusindicator.cpp.

00066 {
00067     MWidgetController::updateGeometry();
00068 }

QVariant StatusIndicator::value (  )  const [protected]

Gets the value of the indicator.

See also:
setValue

Member Data Documentation

Whether or not the view should animate if possible.

Definition at line 84 of file statusindicator.h.


Property Documentation

QVariant StatusIndicator::value [read, write]

Definition at line 44 of file statusindicator.h.


The documentation for this class was generated from the following files:

Copyright © 2010 Nokia Corporation Generated on Wed Nov 10 16:05:12 2010
Doxygen 1.6.1
MeeGo Touch