logsui/logscntfinder/tsrc/stubs/qtcontacts_stubs.cpp
changeset 4 e52d42f9500c
parent 2 7119b73b84d6
child 6 41c0a814d878
equal deleted inserted replaced
2:7119b73b84d6 4:e52d42f9500c
   153 
   153 
   154 }
   154 }
   155 
   155 
   156 
   156 
   157 QList<QContactLocalId> QContactManager::contactIds(
   157 QList<QContactLocalId> QContactManager::contactIds(
   158         const QContactFilter& filter, 
   158         const QContactFilter& /*filter*/, 
   159         const QList<QContactSortOrder>& /*sortOrders*/) const
   159         const QList<QContactSortOrder>& /*sortOrders*/) const
   160 {
   160 {
   161     const QContactDetailFilter& df = 
       
   162         static_cast<const QContactDetailFilter&>( filter );
       
   163         
   161         
   164     QList<QContactLocalId> list;
   162     QList<QContactLocalId> list;
   165     ContactQueryResults* resultSet = ContactQueryResults::instance();
   163     ContactQueryResults* resultSet = ContactQueryResults::instance();
   166     
   164     
   167     for( int i=0;i<resultSet->contacts();i++) {
   165     for( int i=0;i<resultSet->contacts();i++) {
   172     return list;
   170     return list;
   173 }
   171 }
   174 
   172 
   175 QContact QContactManager::contact( 
   173 QContact QContactManager::contact( 
   176     const QContactLocalId& contactId, 
   174     const QContactLocalId& contactId, 
   177     const QStringList& definitionRestrictions ) const
   175     const QStringList& /*definitionRestrictions*/ ) const
   178 {
   176 {
   179     QContact contact;
   177     QContact contact;
   180     QContactId id;
   178     QContactId id;
   181     id.setLocalId(contactId  );
   179     id.setLocalId(contactId  );
   182 
   180 
   230 {
   228 {
   231 
   229 
   232 }
   230 }
   233 
   231 
   234 
   232 
   235 QContact& QContact::operator=(const QContact& other)
   233 QContact& QContact::operator=(const QContact& /*other*/)
   236 {
   234 {
   237 
   235     return *this;
   238 }
   236 }
   239 
   237 
   240 QContactDetail QContact::detail(const QString& definitionId) const
   238 QContactDetail QContact::detail(const QString& definitionId) const
   241 {
   239 {
   242     ContactQueryResults* results = ContactQueryResults::instance();
   240     ContactQueryResults* results = ContactQueryResults::instance();
   243     
   241     
   244     if ( definitionId == QContactName::DefinitionName ){
   242     if ( definitionId == QContactName::DefinitionName ){
   245         QContactName name;
   243         QContactName name;
   246         QContactLocalId id = localId();
   244         QContactLocalId id = localId();
   247         name.setValue(QContactName::FieldFirst, results->firstNameAt( (int) id-1 ) );
   245         name.setValue(QContactName::FieldFirstName, results->firstNameAt( (int) id-1 ) );
   248         name.setValue(QContactName::FieldLast, results->lastNameAt( (int) id-1 ) );
   246         name.setValue(QContactName::FieldLastName, results->lastNameAt( (int) id-1 ) );
   249         return name;
   247         return name;
   250     }
   248     }
   251     if ( definitionId == QContactPhoneNumber::DefinitionName ){
   249     if ( definitionId == QContactPhoneNumber::DefinitionName ){
   252         QContactPhoneNumber number;
   250         QContactPhoneNumber number;
   253         QString n( "555789987" );
   251         QString n( "555789987" );
   254         number.setValue(QContactPhoneNumber::FieldNumber, n );
   252         number.setValue(QContactPhoneNumber::FieldNumber, n );
   255         return number;
   253         return number;
   256     }
   254     }
   257     if ( definitionId == QContactAvatar::DefinitionName){
   255     if ( definitionId == QContactAvatar::DefinitionName){
   258         QContactAvatar avatar;
   256         QContactAvatar avatar;
   259         avatar.setSubType(QContactAvatar::SubTypeImage);
   257         avatar.setValue(QContactAvatar::FieldSubType, QContactAvatar::SubTypeImage );
   260         avatar.setAvatar("c:\\data\\images\\logstest1.jpg");
   258         avatar.setValue(QContactAvatar::FieldAvatar, "c:\\data\\images\\logstest1.jpg" );
   261         QString a( "Avatar" );
       
   262         avatar.setValue( QContactAvatar::FieldAvatar, a );
       
   263         return avatar;
   259         return avatar;
   264     }
   260     }
   265     QContactDetail detail;
   261     QContactDetail detail;
   266     return detail;
   262     return detail;
   267 }
   263 }
   273 //
   269 //
   274 QContactDetail::QContactDetail()
   270 QContactDetail::QContactDetail()
   275 {
   271 {
   276 
   272 
   277 }
   273 }
   278 QContactDetail::QContactDetail(const QString& definitionName) : d(new QContactDetailPrivate)
   274 
   279 {
   275 QContactDetail::QContactDetail(const QString& /*definitionName*/) : d(new QContactDetailPrivate)
   280 
   276 {
   281 }
   277 
       
   278 }
       
   279 
   282 QContactDetail::~QContactDetail()
   280 QContactDetail::~QContactDetail()
   283 {
   281 {
   284 
   282 
   285 }
   283 }
   286 
   284 
   287 
   285 
   288 QContactDetail& QContactDetail::operator=(const QContactDetail& other)
   286 QContactDetail& QContactDetail::operator=(const QContactDetail& /*other*/)
   289 {
   287 {
   290 
   288     return *this;
   291 }
   289 }
   292 
   290 
   293 QString QContactDetail::definitionName() const
   291 QString QContactDetail::definitionName() const
   294 {
   292 {
   295     return QString("");
   293     return QString("");