contentctrl_plat/ds_contactsdatastoreextension_api/inc/nsmlcontactsdatastoreextension.h
branchRCL_3
changeset 24 8e7494275d3a
equal deleted inserted replaced
23:2bb96f4ecad8 24:8e7494275d3a
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Contacts DataStore Extension API
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NSMLCONTACTSDATASTOREEXTENSION_H_
       
    19 #define NSMLCONTACTSDATASTOREEXTENSION_H_
       
    20 
       
    21 class CNsmlContactsDataStoreExtensionPrivate;
       
    22 class CNsmlContactItem;
       
    23 class RDesReadStream;
       
    24 
       
    25 class CNsmlContactsDataStoreExtension: public CBase
       
    26 {
       
    27 public:
       
    28     /**
       
    29     * Two-phased constructor.
       
    30     */
       
    31     IMPORT_C static CNsmlContactsDataStoreExtension* NewL( const TDesC& aManager );
       
    32 
       
    33     /**
       
    34     * Destructor.
       
    35     */
       
    36     IMPORT_C virtual ~CNsmlContactsDataStoreExtension();
       
    37     
       
    38 protected:
       
    39     /**
       
    40     * C++ constructor.
       
    41     */
       
    42     IMPORT_C CNsmlContactsDataStoreExtension();
       
    43     
       
    44     /**
       
    45     * Two-phased constructor.
       
    46     */
       
    47     IMPORT_C static CNsmlContactsDataStoreExtension* NewLC( const TDesC& aManager );
       
    48     /**
       
    49     * 2nd phase constructor.
       
    50     */
       
    51     IMPORT_C void ConstructL( const TDesC& aManager );
       
    52     
       
    53 public: // Methods
       
    54     /**
       
    55     * Fetch the Contact Item from the DB 
       
    56     * @param aUid UID of the desired item to be fetched
       
    57     * @param aContactbufbase on return will have the fetched Contact details
       
    58     */
       
    59     IMPORT_C TInt ExportContactsL( const TUid& aUid, CBufBase& aContactbufbase );
       
    60     
       
    61     /**
       
    62     * Store the Contact Item to the DB
       
    63     * @param aContactbufbase Contact item to be saved to the DB
       
    64     * @return A pointer to list of newly saved Contact UIDs'
       
    65     */
       
    66     IMPORT_C CArrayFixFlat<TUid>* ImportContactsL( const TDesC8& aContactbufbase );
       
    67     
       
    68     /**
       
    69     * Fetch Contact details
       
    70     * @param aUid UID of the desired Contact item
       
    71     * @param aContactitem on return will have pointer class containing contact details
       
    72     */
       
    73     IMPORT_C TInt ReadContactL( const TUid& aUid, CNsmlContactItem* aContactitem );
       
    74     
       
    75     /**
       
    76     * Delete a Contact
       
    77     * @param aUid UID of the desired Contact item
       
    78     * @return status of the operation
       
    79     */
       
    80     IMPORT_C TBool DeleteContactL( const TUid& aUid );
       
    81     
       
    82     /**
       
    83     * Delete List of Contacts
       
    84     * @param aArrDelete List of Contact UIDs' to be deleted
       
    85     * @return status of the operation
       
    86     */
       
    87     IMPORT_C TBool DeleteContactsL( CArrayFixFlat<TUid>* aArrDelete );
       
    88     
       
    89     /**
       
    90     * Delete All Contacts
       
    91     * @return status of the operation
       
    92     */
       
    93     IMPORT_C TBool DeleteAllContactsL();
       
    94     
       
    95     /**
       
    96     * List Supported Stores
       
    97     * @param aCntstores on return will have list of stores
       
    98     */
       
    99     IMPORT_C void ListStoresL( CDesCArray* aCntstores );
       
   100     
       
   101     /**
       
   102     * Unique ID for a Store
       
   103     * @return unique id represented as integer  
       
   104     */
       
   105     IMPORT_C TInt64 MachineIdL();
       
   106     
       
   107     /**
       
   108     * Fetch all available Contacts from the DB
       
   109     * @param aContactuidlist on return will have list of all Contact UIDs'
       
   110     */
       
   111     IMPORT_C void ListContactsL( CArrayFixFlat<TUid>* aContactuidlist );
       
   112 	
       
   113 private: // Data
       
   114 	CNsmlContactsDataStoreExtensionPrivate* d_ptr;
       
   115 };
       
   116 
       
   117 class CNsmlContactItem: public CBase
       
   118 {
       
   119 public:
       
   120     /**
       
   121     * Two-phased constructor.
       
   122     */
       
   123     IMPORT_C static CNsmlContactItem* NewL();
       
   124 
       
   125     /**
       
   126     * Destructor.
       
   127     */
       
   128     IMPORT_C virtual ~CNsmlContactItem();
       
   129     
       
   130 protected:
       
   131     /**
       
   132     * C++ constructor.
       
   133     */
       
   134     IMPORT_C CNsmlContactItem();
       
   135     
       
   136     /**
       
   137     * Two-phased constructor.
       
   138     */
       
   139     IMPORT_C static CNsmlContactItem* NewLC();
       
   140  
       
   141 public: // Data
       
   142     TTime iLastModified;
       
   143     HBufC8* iGuid;
       
   144     TUid iUid;
       
   145 };
       
   146 
       
   147 #endif /* NSMLCONTACTSDATASTOREEXTENSION_H_*/