uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkStoreContactStub.cpp
branchRCL_3
changeset 23 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
22:3104fc151679 23:9a48e301e94b
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 :                
       
    16 *
       
    17 */
       
    18 
       
    19 #include "CVPbkStoreContactStub.h"
       
    20 #include "s_cVPbkBaseContactFieldCollection.h"
       
    21 #include <MVPbkBaseContactFieldCollection.h>
       
    22 #include "s_MVPbkContactLinkstub.h"
       
    23 
       
    24 CVPbkBaseContactFieldCollectionStub gFeildCollection;
       
    25 
       
    26 CVPbkStoreContactStub::CVPbkStoreContactStub()
       
    27 {
       
    28 	
       
    29 }
       
    30 
       
    31 
       
    32 MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields()
       
    33 	{
       
    34 	return gFeildCollection;	
       
    35 	}
       
    36 /**
       
    37  * Returns this contact's fields (read only).
       
    38  * @return This contact's fields in read only mode.
       
    39  */
       
    40 const MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields() const 
       
    41 	{
       
    42 	return gFeildCollection;	
       
    43 	}
       
    44 
       
    45 /**
       
    46  * Returns true if this a representation of the same contact.
       
    47  *
       
    48  * @param aOtherContact a contact this contact is compared against.
       
    49  * @return ETrue if this and aOtherContact represent the same contact.
       
    50  */
       
    51 TBool CVPbkStoreContactStub::IsSame(const MVPbkBaseContact& /*aOtherContact*/) const {return ETrue;}
       
    52 
       
    53 /**
       
    54  * Returns true if this a representation of the same contact.
       
    55  *
       
    56  * @param aOtherContact a contact this contact is compared against.
       
    57  * @return ETrue if this and aOtherContact represent the same contact.
       
    58  */
       
    59 TBool CVPbkStoreContactStub::IsSame(const MVPbkStoreContact& /*aOtherContact*/) const { return ETrue; }
       
    60 
       
    61 /**
       
    62  * Returns true if this a representation of the same contact.
       
    63  *
       
    64  * @param aOtherContact a contact this contact is compared against.
       
    65  * @return ETrue if this and aOtherContact represent the same contact.
       
    66  */
       
    67 TBool CVPbkStoreContactStub::IsSame(const MVPbkViewContact& /*aOtherContact*/) const { return ETrue; }
       
    68 
       
    69 /**
       
    70  * Creates link representing this contact.
       
    71  *
       
    72  * @return A link or NULL if the contact doesn't exist in the store, 
       
    73  *         e.g. a folding contact in the view could be that kind or
       
    74  *         a new contact that hasn't been committed to the store.
       
    75  *         NULL is not put into the CleanupStack.
       
    76  */
       
    77 MVPbkContactLink* CVPbkStoreContactStub::CreateLinkLC() const 
       
    78 	{
       
    79 	CVPbkContactLinkStub* contactLink = new (ELeave) CVPbkContactLinkStub();
       
    80 	CleanupStack::PushL(contactLink);
       
    81 
       
    82 	return contactLink;
       
    83 
       
    84 	}
       
    85 
       
    86 /**
       
    87  * Deletes this contact from store asynchronously.
       
    88  *
       
    89  * @param aObserver The observer to call back when this operation 
       
    90  *                  completes. The observer will not be called 
       
    91  *                  if this function leaves.
       
    92  * @exception KErrInUse If another asynchronous operation is already 
       
    93  *                      in progress.
       
    94  * @exception KErrAccessDenied if the contact can not be modified.
       
    95  */
       
    96 void CVPbkStoreContactStub::DeleteL(MVPbkContactObserver& /*aObserver*/) const {}
       
    97 
       
    98 /**
       
    99  * Returns ETrue if this view contact is from given store
       
   100  *
       
   101  * @param aContactStoreUri the URI of the store to compare
       
   102  * @return ETrue if the view contact was from the given store
       
   103  */
       
   104 TBool CVPbkStoreContactStub::MatchContactStore(
       
   105         const TDesC& /*aContactStoreUri*/) const { return EFalse; }
       
   106 
       
   107 /**
       
   108  * Returns ETrue if this contact is from the same store 
       
   109  * domain as the given one.
       
   110  *
       
   111  * @param aContactStoreDomain the the store domain
       
   112  * @return ETrue if the contact was from the same store domain.
       
   113  */
       
   114 TBool CVPbkStoreContactStub::MatchContactStoreDomain(
       
   115         const TDesC& /*aContactStoreDomain*/) const { return EFalse; }
       
   116 
       
   117 /**
       
   118  * Creates and returns a bookmark that points to the contact.
       
   119  * Bookmark can be used to retrieve an index of the contact in 
       
   120  * the view.
       
   121  *
       
   122  * @return A new bookmark to the contact
       
   123  */
       
   124 MVPbkContactBookmark* CVPbkStoreContactStub::CreateBookmarkLC() const { return NULL; }
       
   125 
       
   126 /**
       
   127  * Returns the parent object of this object. For the root of the 
       
   128  * hierarchy returns self.
       
   129  * @return The parent object.
       
   130  */
       
   131 MVPbkObjectHierarchy& CVPbkStoreContactStub::ParentObject() const 
       
   132 {
       
   133 MVPbkObjectHierarchy* ret = NULL;
       
   134 
       
   135 return *ret;	
       
   136 }
       
   137 
       
   138 /**
       
   139  * Returns the parent view of the contact.
       
   140  *
       
   141  * @return The parent view of the contact.
       
   142  */
       
   143 MVPbkContactViewBase& CVPbkStoreContactStub::ParentView() const 
       
   144 {
       
   145 MVPbkContactViewBase* ret=NULL;
       
   146 return *ret;	
       
   147 }
       
   148 
       
   149 /**
       
   150  * Reads the whole contact from the store asynchronously.
       
   151  *
       
   152  * A client can use this if it has a reference of the view contact but
       
   153  * it needs all the data fields instead of only those that are included
       
   154  * in the view contact.
       
   155  *
       
   156  * The contact is returned in a call back.
       
   157  *
       
   158  * @param aObserver An observer to call back when this operation 
       
   159  *                  completes. The observer will not be called if this
       
   160  *                  function leaves.
       
   161  * @exception KErrInUse If another asynchronous operation is already 
       
   162  *                      in progress.
       
   163  */
       
   164 void CVPbkStoreContactStub::ReadL( MVPbkContactObserver& /*aObserver*/ ) const 
       
   165 {
       
   166 	
       
   167 }
       
   168 
       
   169 /**
       
   170  * Reads the whole contact and locks it for modification 
       
   171  * asynchronously.
       
   172  *
       
   173  * A client can use this if it has a reference of the view contact and
       
   174  * it needs to modify the contact.
       
   175  *
       
   176  * The contact is returned in a call back.
       
   177  *
       
   178  * @param aObserver An observer to call back when this operation 
       
   179  *                  completes. The observer will not be called if this
       
   180  *                  function leaves.
       
   181  * @exception KErrInUse If another asynchronous operation is already 
       
   182  *                      in progress.
       
   183  * @exception KErrAccessDenied if contact is read-only
       
   184  */
       
   185 void CVPbkStoreContactStub::ReadAndLockL( MVPbkContactObserver& /*aObserver*/ ) const 
       
   186 {
       
   187 	
       
   188 }
       
   189 
       
   190 /**
       
   191  * Returns expandable interface for this object or NULL if expanding is 
       
   192  * not supported.
       
   193  *
       
   194  * Examples are a contact group that can be expanded to its members view
       
   195  * or a folding view that can be extended to its internals. Client can
       
   196  * get the type of the view from MVPbkContactViewBase::Type which is useful
       
   197  * for knowing the type of expansion.
       
   198  *
       
   199  * @return An expansion or NULL.
       
   200  */
       
   201 MVPbkExpandable* CVPbkStoreContactStub::Expandable() const 
       
   202 {
       
   203 return NULL;	
       
   204 };
       
   205 
       
   206 /**
       
   207  * Returns ETrue if two contacts are same.
       
   208  *
       
   209  * @param aOtherContact A contact to be compared.
       
   210  * @param aContactStore The store of the aOtherContact.
       
   211  * @return ETrue if two contacts are same.
       
   212  */
       
   213 TBool CVPbkStoreContactStub::IsSame( const MVPbkViewContact& /*aOtherContact*/, 
       
   214                       const MVPbkContactStore* /*aContactStore*/ ) const 
       
   215                       {
       
   216                       return EFalse;	
       
   217                       }
       
   218 
       
   219 /**
       
   220  * Returns ETrue if two contacts are same.
       
   221  *
       
   222  * @param aOtherContact A contact to be compared.
       
   223  * @param aContactStore The store of the aOtherContact.
       
   224  * @return ETrue if two contacts are same.
       
   225  */                    
       
   226 TBool CVPbkStoreContactStub::IsSame( const MVPbkStoreContact& /*aOtherContact*/, 
       
   227                       const MVPbkContactStore* /*aContactStore*/ ) const 
       
   228                       {
       
   229                       	return EFalse;
       
   230                       }