libusermetrics
|
Presentation API for user metrics. More...
#include <libusermetricsoutput/UserMetrics.h>
Public Slots | |
virtual void | nextDataSourceSlot ()=0 |
Synchronous version of nextDataSource. | |
virtual void | readyForDataChangeSlot ()=0 |
Synchronous version of readyForDataChange. | |
Signals | |
void | labelChanged (const QString &label) |
The label has changed. | |
void | usernameChanged (const QString &username) |
The username has changed. | |
void | firstColorChanged (ColorTheme *color) |
The first month's ColorTheme has changed. | |
void | firstMonthChanged (QAbstractItemModel *firstMonth) |
The first month's data has changed. | |
void | currentDayChanged (int currentDay) |
The current day of the month has changed. | |
void | secondColorChanged (ColorTheme *color) |
The second month's ColorTheme has changed. | |
void | secondMonthChanged (QAbstractItemModel *secondMonth) |
The second month's data has changed. | |
void | nextDataSource () |
Request the current user's next data source. | |
void | readyForDataChange () |
Inform the UserMetrics that you are ready for data change. | |
void | dataAboutToAppear () |
Data is about to appear. | |
void | dataAppeared () |
Data has finished loading. | |
void | dataAboutToChange () |
Data is about to change from one set to another. | |
void | dataChanged () |
Insert documentation here. | |
void | dataAboutToDisappear () |
About to change to a user with no data. | |
void | dataDisappeared () |
The empty data has now been loaded. | |
Public Member Functions | |
virtual | ~UserMetrics () |
Destructor. | |
virtual QString | label () const =0 |
Represents a textual version of the current metric. | |
virtual QString | username () const =0 |
The current username selected. | |
virtual void | setUsername (const QString &username)=0 |
Change the current username. | |
virtual ColorTheme * | firstColor () const =0 |
The ColorTheme for the first month. | |
virtual QAbstractItemModel * | firstMonth () const =0 |
The data for the first month. | |
virtual int | currentDay () const =0 |
The current day of the calendar month. | |
virtual ColorTheme * | secondColor () const =0 |
The ColorTheme for the second month. | |
virtual QAbstractItemModel * | secondMonth () const =0 |
The data for the second month. | |
Static Public Member Functions | |
static UserMetrics * | getInstance () |
Get a new instance of UserMetrics. | |
Protected Member Functions | |
UserMetrics (QObject *parent=0) | |
Unusable constructor - this class is pure-virtual. | |
Properties | |
QString | label |
Represents a textual version of the current metric. | |
QString | username |
The current username selected. | |
UserMetricsOutput::ColorTheme * | firstColor |
The ColorTheme for the first month. | |
UserMetricsOutput::ColorTheme * | secondColor |
The ColorTheme for the second month. | |
QAbstractItemModel * | firstMonth |
The data for the first month. | |
QAbstractItemModel * | secondMonth |
The data for the second month. | |
int | currentDay |
The current day of the calendar month. | |
Presentation API for user metrics.
This class breaks down the various user metric sources registered against different users into a presentable format.
The data is split into two "months" - "first" and "second". The months always have a length equal to the size of the month they represent - unset values are padded with null data.
The property currentDay indicates the current day's value in the "first month" data.
Given a username, the class then provides an API to cycle through that user's data. The signal nextDataSource should be used for this.
|
virtual |
Destructor.
|
explicitprotected |
Unusable constructor - this class is pure-virtual.
parent |
|
pure virtual |
The current day of the calendar month.
Zero-indexed.
|
signal |
The current day of the month has changed.
currentDay |
Note: Zero-indexed.
|
signal |
Data is about to appear.
To continue, fire the readyForDataChange signal.
|
signal |
Data is about to change from one set to another.
To continue, fire the readyForDataChange signal.
|
signal |
About to change to a user with no data.
To continue, fire the readyForDataChange signal.
|
signal |
Data has finished loading.
|
signal |
Insert documentation here.
|
signal |
The empty data has now been loaded.
|
pure virtual |
The ColorTheme for the first month.
|
signal |
The first month's ColorTheme has changed.
color |
|
pure virtual |
The data for the first month.
|
signal |
The first month's data has changed.
firstMonth |
More fine-grained changed notification also occurs using the QAbstractItemModel signals.
|
static |
Get a new instance of UserMetrics.
|
pure virtual |
Represents a textual version of the current metric.
e.g. "3 messages received today"
|
signal |
The label has changed.
label |
|
signal |
Request the current user's next data source.
|
pure virtualslot |
Synchronous version of nextDataSource.
|
signal |
Inform the UserMetrics that you are ready for data change.
|
pure virtualslot |
Synchronous version of readyForDataChange.
|
pure virtual |
The ColorTheme for the second month.
|
signal |
The second month's ColorTheme has changed.
color |
|
pure virtual |
The data for the second month.
|
signal |
The second month's data has changed.
secondMonth |
More fine-grained changed notification also occurs using the QAbstractItemModel signals.
|
pure virtual |
Change the current username.
username |
The data source will change to the first one available for the given username.
|
pure virtual |
The current username selected.
|
signal |
The username has changed.
username |
|
read |
The current day of the calendar month.
Zero-indexed.
|
read |
The ColorTheme for the first month.
|
read |
The data for the first month.
|
read |
Represents a textual version of the current metric.
e.g. "3 messages received today"
|
read |
The ColorTheme for the second month.
|
read |
The data for the second month.
|
readwrite |
The current username selected.