Home · All Namespaces · All Classes
Public Types | Public Member Functions | Friends

Notification Class Reference

A class for storing notification information. More...

#include <notification.h>

Collaboration diagram for Notification:
Collaboration graph
[legend]

List of all members.

Public Types

enum  NotificationType { ApplicationEvent, SystemEvent }

Public Member Functions

 Notification ()
 Notification (uint notificationId, uint groupId, uint userId, const NotificationParameters &parameters, NotificationType type, int timeout)
 ~Notification ()
uint notificationId () const
uint userId () const
uint groupId () const
const NotificationParametersparameters () const
void setParameters (const NotificationParameters &parameters)
void updateParameters (const NotificationParameters &parameters)
NotificationType type () const
int timeout () const

Friends

QDataStream & operator<< (QDataStream &, const Notification &)
QDataStream & operator>> (QDataStream &, Notification &)
QDBusArgument & operator<< (QDBusArgument &, const Notification &notification)
const QDBusArgument & operator>> (const QDBusArgument &, Notification &)

Detailed Description

A class for storing notification information.

The information can also be serialized in and out of a QDataStream.

Definition at line 35 of file notification.h.


Member Enumeration Documentation

Notification types.

Enumerator:
ApplicationEvent 
SystemEvent 

Definition at line 41 of file notification.h.

                          {
        ApplicationEvent,
        SystemEvent
    };


Constructor & Destructor Documentation

Notification::Notification (  ) 

Empty constructor. Initializes the values to defaults.

Definition at line 25 of file notification.cpp.

                           :
    notificationId_(0),
    groupId_(0),
    userId_(0),
    parameters_(),
    type_(ApplicationEvent),
    timeout_(0)
{
}

Notification::Notification ( uint  notificationId,
uint  groupId,
uint  userId,
const NotificationParameters parameters,
NotificationType  type,
int  timeout 
)

Constructor.

Parameters:
notificationId the ID of this notification
groupId the group ID of this notification
userId the user ID associated to this notification
parameters parameters for the notification to be presented
type the type of the notification to be presented.
See also:
NotificationType.
Parameters:
timeout The number of milliseconds to present the notification for

Definition at line 35 of file notification.cpp.

                                                                                                                                                       :
    notificationId_(notificationId),
    groupId_(groupId),
    userId_(userId),
    parameters_(parameters),
    type_(type),
    timeout_(timeout)
{
}

Notification::~Notification (  ) 

Destructor.

Definition at line 45 of file notification.cpp.

{
}


Member Function Documentation

uint Notification::groupId (  )  const

Returns the group ID of this notification.

Returns:
group ID of this notification

Definition at line 54 of file notification.cpp.

{
    return groupId_;
}

uint Notification::notificationId (  )  const

Returns the ID of this notification.

Returns:
ID of this notification

Definition at line 49 of file notification.cpp.

{
    return notificationId_;
}

const NotificationParameters & Notification::parameters (  )  const

Returns the parameters list for this notification.

Returns:
parameters list for this notification

Definition at line 64 of file notification.cpp.

{
    return parameters_;
}

void Notification::setParameters ( const NotificationParameters parameters  ) 

Sets the parameters list for this notification.

Parameters:
parameters parameters for this notification
See also:
updateParameters

Definition at line 69 of file notification.cpp.

{
    parameters_ = parameters;
}

int Notification::timeout (  )  const

Returns the timeout of this notification.

Returns:
timeout of this notification

Definition at line 84 of file notification.cpp.

{
    return timeout_;
}

Notification::NotificationType Notification::type (  )  const

Returns the type of this notification.

Returns:
type of this notification

Definition at line 79 of file notification.cpp.

{
    return type_;
}

void Notification::updateParameters ( const NotificationParameters parameters  ) 

Updates the parameters of this notification. The existing parameters in the notification remain as they are. Only new values from the argument are appended/updated.

Parameters:
parameters the parameters that will be updated
See also:
setParameters

Definition at line 74 of file notification.cpp.

{
    parameters_.update(parameters);
}

Here is the call graph for this function:

uint Notification::userId (  )  const

Returns the user ID associated with this notification.

Returns:
user ID associated with this notification

Definition at line 59 of file notification.cpp.

{
    return userId_;
}


Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  ,
const Notification  
) [friend]

Serializes the given Notification to a QDataStream

Parameters:
datastream QDataStream to write to
notification Notification object to serialize

Definition at line 90 of file notification.cpp.

{
    datastream << notification.notificationId_;
    datastream << qint32(notification.type_);
    datastream << notification.groupId_;
    datastream << notification.userId_;
    datastream << notification.timeout_;
    datastream << notification.parameters_;
    return datastream;
}

QDBusArgument& operator<< ( QDBusArgument &  argument,
const Notification notification 
) [friend]

Definition at line 116 of file notification.cpp.

{
    argument.beginStructure();
    argument << notification.notificationId_;
    argument << qint32(notification.type_);
    argument << notification.groupId_;
    argument << notification.userId_;
    argument << notification.timeout_;
    argument << notification.parameters_;
    argument.endStructure();

    return argument;
}

const QDBusArgument& operator>> ( const QDBusArgument &  argument,
Notification notification 
) [friend]

Definition at line 130 of file notification.cpp.

{
    argument.beginStructure();
    argument >> notification.notificationId_;

    qint32 s;
    argument >> s;
    notification.type_ = static_cast<Notification::NotificationType>(s);

    argument >> notification.groupId_;
    argument >> notification.userId_;
    argument >> notification.timeout_;
    argument >> notification.parameters_;
    argument.endStructure();

    return argument;
}

QDataStream& operator>> ( QDataStream &  ,
Notification  
) [friend]

Deserializes a Notification from a QDataStream

Parameters:
datastream QDataStream to read from
notification the target Notification object, its previous state will be reset

Definition at line 101 of file notification.cpp.

{
    datastream >> notification.notificationId_;

    qint32 s;
    datastream >> s;
    notification.type_ = static_cast<Notification::NotificationType>(s);

    datastream >> notification.groupId_;
    datastream >> notification.userId_;
    datastream >> notification.timeout_;
    datastream >> notification.parameters_;
    return datastream;
}


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