Home · All Namespaces · All Classes
Public Member Functions | Protected Member Functions | Protected Attributes | Properties

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.

                                                      :
    MWidgetController(new StatusIndicatorModel, parent),
    animateIfPossible(false),
    modelUpdatesEnabled(true),
    currentValue(QVariant())
{
}

StatusIndicator::~StatusIndicator (  )  [virtual]

Destructor.

Definition at line 58 of file statusindicator.cpp.

{
    foreach(ContextItem* item, contextItems) {
        delete item;
    }
}


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.

{
    ContextItem *item = context.createContextItem(key);
    contextItems.append(item);
    return item;
}

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.

{
    currentValue = v;
    if (modelUpdatesEnabled) {
        model()->setValue(v);
    }
}

void StatusIndicator::updateAnimationStatus (  )  [protected]

Updates the animation status of the views.

Definition at line 108 of file statusindicator.cpp.

{
    if (modelUpdatesEnabled) {
        model()->setAnimate(animateIfPossible);
    } else {
        model()->setAnimate(false);
    }
}

void StatusIndicator::updateGeometry (  )  [virtual]

REIMPLEMENTATION

Definition at line 65 of file statusindicator.cpp.

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 Thu Nov 4 2010 18:19:35
Doxygen 1.7.1
MeeGo Touch