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  · 

QContactFetchHint Class Reference

The QContactFetchHint class provides hints to the manager about which contact information needs to be retrieved in an asynchronous fetch request or a synchronous function call. More...

 #include <QContactFetchHint>

This class was introduced in Qt Mobility 1.0.

Public Types

enum OptimizationHint { AllRequired, NoRelationships, NoActionPreferences, NoBinaryBlobs }
flags OptimizationHints

Public Functions

QContactFetchHint ()
QContactFetchHint ( const QContactFetchHint & other )
~QContactFetchHint ()
QStringList detailDefinitionsHint () const
int maxCountHint () const
OptimizationHints optimizationHints () const
QSize preferredImageSize () const
QStringList relationshipTypesHint () const
void setDetailDefinitionsHint ( const QStringList & definitionNames )
void setMaxCountHint ( int count )
void setOptimizationHints ( OptimizationHints hints )
void setPreferredImageSize ( const QSize & size )
void setRelationshipTypesHint ( const QStringList & relationshipTypes )
QContactFetchHint & operator= ( const QContactFetchHint & other )

Detailed Description

The QContactFetchHint class provides hints to the manager about which contact information needs to be retrieved in an asynchronous fetch request or a synchronous function call.

All of the hints may be ignored at the discretion of the manager, however if a manager is able to optimize retrieval of contacts due to hints, it may do so. If a manager ignores a hint, it must retrieve the full set of data that the hint refers to.

The fetch hint contains:

  • a list of detail definition names which the client is interested in (empty if interested in all detail definitions)
  • a list of relationship types which the client is interested in (empty if interested in all relationships)
  • some optimization flags which allow the client to tell the backend if they are not interested in any relationships, any action preferences, or any binary blobs (images etc).
  • a preferred size for any images, if the backend supports multiple sizes or scaling

Important note: a client should not make changes to a contact which has been retrieved using a fetch hint other than the default fetch hint. Doing so can result in information loss when saving the contact back to the manager (as the "new" restricted contact will replace the previously saved contact in the backend).

Member Type Documentation

enum QContactFetchHint::OptimizationHint
flags QContactFetchHint::OptimizationHints

This enum defines flags which may be set to inform the backend that the client does not require certain information. The backend may safely ignore the hint, but then must return the full set of information relating to the optimization hint.

ConstantValueDescription
QContactFetchHint::AllRequired0x0Tells the backend that all information is required
QContactFetchHint::NoRelationships0x1Tells the backend that the client does not require retrieved contacts to include a cache of relationships
QContactFetchHint::NoActionPreferences0x2Tells the backend that the client does not require retrieved contacts to include a cache of action preferences
QContactFetchHint::NoBinaryBlobs0x4Tells the backend that the client does not require retrieved contacts to include binary blobs such as thumbnail images

The OptimizationHints type is a typedef for QFlags<OptimizationHint>. It stores an OR combination of OptimizationHint values.

Member Function Documentation

QContactFetchHint::QContactFetchHint ()

Constructs a new contact fetch hint which requests that the backend fetch all information

QContactFetchHint::QContactFetchHint ( const QContactFetchHint & other )

Constructs a new contact fetch hint as a copy of other

QContactFetchHint::~QContactFetchHint ()

Frees any memory in use by the fetch hint

QStringList QContactFetchHint::detailDefinitionsHint () const

Returns the list of definition names that identify detail definitions of which details the manager should (at a minimum) retrieve when fetching contacts. This hint may be ignored by the backend, in which case it will return the full set of details for each contact retrieved.

This function was introduced in Qt Mobility 1.0.

See also setDetailDefinitionsHint().

int QContactFetchHint::maxCountHint () const

Returns the number of results which the client considers to be the maximum number of useful results. The client is only interested in this number of results, so returning any more results would be superfluous to the client's requirements. Note that this fetch hint only affects operations where the backend would return a list of contacts; this hint specifies the maximum number of contacts in the list which would be useful to the client. The backend may ignore this hint, in which case it must return all contacts which would otherwise have been returned as a result of the operation.

A negative value for count denotes that the client wishes to retrieve all results. The default value is -1.

See also setMaxCountHint().

OptimizationHints QContactFetchHint::optimizationHints () const

Returns the optimization hint flags specified by the client. These hints may be ignored by the backend, in which case it will return the full set of information accessible in a contact, including relationships, action preferences, and binary blobs.

This function was introduced in Qt Mobility 1.0.

See also setOptimizationHints().

QSize QContactFetchHint::preferredImageSize () const

Returns the preferred pixel dimensions for any images returned by the manager for a given request. This hint may be ignored by the manager.

This is useful when the backend supports multiple sizes of an image (or the image is natively scaleable) in order to get an image that will look good at the indicated dimensions.

The caller should be prepared for images of any dimensions, in any case.

See also setPreferredImageSize().

QStringList QContactFetchHint::relationshipTypesHint () const

Returns the list of relationship types that the manager should (at a minimum) retrieve when fetching contacts. This hint may be ignored by the backend, in which case it will return the full set of relationships for each contact retrieved.

This function was introduced in Qt Mobility 1.0.

See also setRelationshipTypesHint() and QContact::relationships().

void QContactFetchHint::setDetailDefinitionsHint ( const QStringList & definitionNames )

Sets the list of definition names that identify detail definitions of which details the manager should (at a minimum) retrieve when fetching contacts to definitionNames. This hint may be ignored by the backend, in which case it will return the full set of details for each contact retrieved.

This function was introduced in Qt Mobility 1.0.

See also detailDefinitionsHint().

void QContactFetchHint::setMaxCountHint ( int count )

Sets the maximum number of results which the client is interested in to count. The client is only interested in this number of results, so returning any more results would be superfluous to the client's requirements. Note that this fetch hint only affects operations where the backend would return a list of contacts; this hint specifies the maximum number of contacts in the list which would be useful to the client. The backend may ignore this hint, in which case it must return all contacts which would otherwise have been returned as a result of the operation.

A negative value for count denotes that the client wishes to retrieve all results. The default value is -1.

See also maxCountHint().

void QContactFetchHint::setOptimizationHints ( OptimizationHints hints )

Sets the optimization hint flags specified by the client to hints. These hints may be ignored by the backend, in which case it will return the full set of information accessible in a contact, including relationships, action preferences, and binary blobs.

This function was introduced in Qt Mobility 1.0.

See also optimizationHints().

void QContactFetchHint::setPreferredImageSize ( const QSize & size )

Sets the preferred pixel dimensions for any images returned by the manager for the given request to size. This hint may be ignored by the manager.

This is useful when the backend supports multiple sizes of an image (or the image is natively scaleable) in order to get an image that will look good at the indicated dimensions.

The caller should be prepared for images of any dimensions, in any case.

See also preferredImageSize().

void QContactFetchHint::setRelationshipTypesHint ( const QStringList & relationshipTypes )

Sets the list of relationship types that the manager should (at a minimum) retrieve when fetching contacts to relationshipTypes. This hint may be ignored by the backend, in which case it will return the full set of relationships for each contact retrieved.

This function was introduced in Qt Mobility 1.0.

See also relationshipTypesHint() and QContact::relationships().

QContactFetchHint & QContactFetchHint::operator= ( const QContactFetchHint & other )

Assigns this fetch hint to be equal to the other fetch hint

This function was introduced in Qt Mobility 1.0.

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 102
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 53
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 73
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 28
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 229
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
  7. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. 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 qtmobility-1.2
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