Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QSMSReader Class Reference
[QtTelephonyModule]

The QSMSReader class provides access to the incoming SMS message store on the modem device. More...

    #include <QSMSReader>

Inherits QCommInterface.

Inherited by QModemSMSReader.

Public Functions

Public Slots

  • 1 public slot inherited from QObject

Signals

Protected Functions

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QSMSReader class provides access to the incoming SMS message store on the modem device.

The modem scans for new messages at start up and whenever a new message indication is received from the modem. It will then update unreadCount(), unreadList(), usedMessages(), and totalMessages() to indicate the current state of the incoming SMS message store.

The messageCount() signal is emitted when these values change, especially for new messages. The unreadCountChanged() signal will be emitted whenever the number of unread messages changes, which could be when a new message arrives, or when the count is reset with setUnreadCount().

SMS reading applications, such as qtmail, access the message store by calling check(). The QSMSReader class will respond with a messageCount() signal once the store is ready to be read. The SMS reading application then calls firstMessage() to fetch the first message in the store. The QSMSReader class will respond with a fetched() signal containing the message. If the id parameter of fetched() is empty, then the list has terminated. Otherwise, the SMS reading application can call nextMessage() to read the next message; and so on.

The deleteMessage() function can be used to delete a message from the incoming SMS message store.

The setUnreadCount() function is used by the qpe server to reset unreadCount() after power up to the state it had before shutdown. It is also used by SMS reading applications like qtmail to reset the count to zero once all new messages have been processed.

Some special SMS messages are not delivered via QSMSReader. These are WAP push messages and SMS datagrams that are dispatched as soon as they arrive. See QSMSMessage::destinationPort() for more information on how these types of messages are dispatched.

See also QSMSMessage.


Member Function Documentation

QSMSReader::QSMSReader ( const QString & service = QString(), QObject * parent = 0, QCommInterface::Mode mode = Client )

Construct a new SMS request object for service and attach it to parent. The object will be created in client mode if mode is Client, or server mode otherwise.

If service is empty, this class will use the first available service that supports SMS requests. If there is more than one service that supports network registration, the caller should enumerate them with QCommServiceManager::supports() and create separate QSMSReader objects for each.

See also QCommServiceManager::supports().

QSMSReader::~QSMSReader ()

Destroy this SMS request object.

void QSMSReader::check ()   [virtual slot]

Fetch the total number of messages in the incoming SMS buffer. The number is returned via the messageCount() signal.

See also messageCount() and firstMessage().

void QSMSReader::deleteMessage ( const QString & id )   [virtual slot]

Delete the message with the identifier id from the incoming SMS buffer.

void QSMSReader::fetched ( const QString & id, const QSMSMessage & m )   [signal]

Signal that is emitted when a message in the incoming SMS buffer of is fetched. id will be zero-length if there are no remaining messages in the buffer to be fetched. Otherwise, the message content is in m.

See also firstMessage() and nextMessage().

void QSMSReader::firstMessage ()   [virtual slot]

Fetch the first message in the incoming SMS buffer. Note: only one application (usually the mail application) should ever call this method and nextMessage().

See also nextMessage().

void QSMSReader::messageCount ( int total )   [signal]

Signal that is emitted when either a new SMS message arrives, the total count is explicitly fetched using check(), or a message is deleted using deleteMessage().

See also check() and deleteMessage().

void QSMSReader::nextMessage ()   [virtual slot]

Fetch the next message in the incoming SMS buffer.

See also firstMessage().

bool QSMSReader::ready () const

Returns true if the SMS reader is ready to access the SIM; otherwise returns false.

See also setReady() and readyChanged().

void QSMSReader::readyChanged ()   [signal]

Signal that is emitted whenever ready() changes state.

See also ready() and setReady().

void QSMSReader::setReady ( bool value )   [protected]

Sets the ready() state to value and emit the readyChanged() signal.

See also ready() and readyChanged().

void QSMSReader::setUnreadCount ( int value )   [virtual slot]

Sets the number of unread messages to value.

See also unreadCount(), unreadList(), and unreadCountChanged().

int QSMSReader::totalMessages () const

Returns the total number of messages that could be stored on the SIM if all slots were in use. If usedMessages() and totalMessages() are the same, then the SIM is full. Returns -1 if the value is not currently known because the incoming message store has not yet been scanned.

See also usedMessages() and messageCount().

int QSMSReader::unreadCount () const

Returns the number of messages that have not yet been read by the user. This value will gradually increase as new messages arrive until reset by a call to setUnreadCount().

See also unreadList(), setUnreadCount(), and unreadCountChanged().

void QSMSReader::unreadCountChanged ()   [signal]

Signal that is emitted when unreadCount() changes.

See also unreadCount(), unreadList(), and setUnreadCount().

QStringList QSMSReader::unreadList () const

Returns a list of message identifiers for messages that are new and unread since the last time firstMessage() was called. This list will reset to empty when firstMessage() is called. The list will be ordered roughly in the order in which the messages arrived.

See also unreadCount(), setUnreadCount(), and unreadCountChanged().

int QSMSReader::usedMessages () const

Returns the number of messages that are currently stored on the SIM. Note that this may be greater than the value returned by the messageCount() signal. The messageCount() signal reports the value after multi-part messages have been combined. The unreadMessages() function returns the value before multi-part messages have been combined. Returns -1 if the value is not currently known because the incoming message store has not yet been scanned.

See also totalMessages() and messageCount().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 85
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 19
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le Qt Quarterly au hasard

Logo

Requête de données génériques avec QtXmlPatterns et XQuery

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web