logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp
changeset 17 90fe74753f71
parent 15 76d2cf7a585e
equal deleted inserted replaced
15:76d2cf7a585e 17:90fe74753f71
    31 QContactLocalId logsTestContactId = 0;
    31 QContactLocalId logsTestContactId = 0;
    32 QContactLocalId logsTestContactLocalId = 0;
    32 QContactLocalId logsTestContactLocalId = 0;
    33 QString logsTestAvatar = "";
    33 QString logsTestAvatar = "";
    34 QString logsFirstName = "";
    34 QString logsFirstName = "";
    35 QString logsLastName = "";
    35 QString logsLastName = "";
       
    36 int testContactIdsMethodCallCount = 0;
       
    37 
    36 Q_DECLARE_METATYPE(QContactAvatar *)
    38 Q_DECLARE_METATYPE(QContactAvatar *)
    37 
    39 
    38 void QtContactsStubsHelper::reset()
    40 void QtContactsStubsHelper::reset()
    39 {
    41 {
    40     logsTestNumber = "";
    42     logsTestNumber = "";
    41     logsTestContactId = 0;
    43     logsTestContactId = 0;
    42     logsTestContactLocalId = 0;
    44     logsTestContactLocalId = 0;
    43     logsFirstName = "";
    45     logsFirstName = "";
    44     logsLastName = "";
    46     logsLastName = "";
       
    47     testContactIdsMethodCallCount = 0;
    45 }
    48 }
    46         
    49         
    47 void QtContactsStubsHelper::setContactId(int id)
    50 void QtContactsStubsHelper::setContactId(int id)
    48 {
    51 {
    49     logsTestContactId = id;
    52     logsTestContactId = id;
    51 
    54 
    52 void QtContactsStubsHelper::setContactNames(const QString& first, const QString& last)
    55 void QtContactsStubsHelper::setContactNames(const QString& first, const QString& last)
    53 {
    56 {
    54     logsFirstName = first;
    57     logsFirstName = first;
    55     logsLastName = last;
    58     logsLastName = last;
       
    59 }
       
    60 
       
    61 int QtContactsStubsHelper::contactIdsMethodCallCount()
       
    62 {
       
    63     return testContactIdsMethodCallCount;
    56 }
    64 }
    57 
    65 
    58 // ----------------------------------------------------------------------------
    66 // ----------------------------------------------------------------------------
    59 // QContactData
    67 // QContactData
    60 // ----------------------------------------------------------------------------
    68 // ----------------------------------------------------------------------------
   109         matchNum.remove(0,4);
   117         matchNum.remove(0,4);
   110     }
   118     }
   111     if ( QString("11112222").endsWith(matchNum) ){
   119     if ( QString("11112222").endsWith(matchNum) ){
   112         list.append( logsTestContactId );
   120         list.append( logsTestContactId );
   113     }
   121     }
       
   122     testContactIdsMethodCallCount++;
   114     return list;
   123     return list;
   115 }
   124 }
   116 
   125 
   117 QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const
   126 QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const
   118 {
   127 {
   147 }
   156 }
   148 
   157 
   149 void QContactDetailFilter::setValue(const QVariant& value)
   158 void QContactDetailFilter::setValue(const QVariant& value)
   150 {
   159 {
   151     logsTestNumber = value.toString();
   160     logsTestNumber = value.toString();
       
   161 }
       
   162 
       
   163 QVariant QContactDetailFilter::value() const
       
   164 {
       
   165     return QVariant(logsTestNumber);
   152 }
   166 }
   153 
   167 
   154 // ----------------------------------------------------------------------------
   168 // ----------------------------------------------------------------------------
   155 // QContact
   169 // QContact
   156 // ----------------------------------------------------------------------------
   170 // ----------------------------------------------------------------------------
   214 QContactLocalId QContact::localId() const
   228 QContactLocalId QContact::localId() const
   215 {
   229 {
   216     return logsTestContactLocalId;
   230     return logsTestContactLocalId;
   217 }
   231 }
   218 
   232 
       
   233 QString QContact::type() const
       
   234 {
       
   235     if (logsTestContactLocalId == 99) {
       
   236         return QContactType::TypeGroup;
       
   237     } else {
       
   238         return QContactType::TypeContact;
       
   239     }
       
   240 }
   219 
   241 
   220 // ----------------------------------------------------------------------------
   242 // ----------------------------------------------------------------------------
   221 // QContactDetail
   243 // QContactDetail
   222 // ----------------------------------------------------------------------------
   244 // ----------------------------------------------------------------------------
   223 //
   245 //