omads/omadsextensions/dsutils/contactsdatastoreextension/inc/nsmlcontactsdatastoreextension_p.h
branchRCL_3
changeset 52 4f0867e42d62
parent 51 8e7494275d3a
child 56 3e6957da2ff8
equal deleted inserted replaced
51:8e7494275d3a 52:4f0867e42d62
     1 /*
       
     2 * Copyright (c) 2005 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:  Private header file for extended Contacts API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_
       
    20 #define NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_
       
    21 
       
    22 #include <QObject>
       
    23 #include <qmobilityglobal.h>
       
    24 
       
    25 QTM_BEGIN_NAMESPACE
       
    26 class QVersitWriter;
       
    27 class QVersitReader;
       
    28 class QVersitContactExporter;
       
    29 class QVersitContactImporter;
       
    30 class QContactManager;
       
    31 QTM_END_NAMESPACE
       
    32 class QBuffer;
       
    33 class QDateTime;
       
    34 class QTime;
       
    35 class CNsmlContactsStoreUtil;
       
    36 class CNsmlContactItem;
       
    37 class RDesReadStream;
       
    38 
       
    39 QTM_USE_NAMESPACE
       
    40 class CNsmlContactsDataStoreExtensionPrivate: public CBase
       
    41 {
       
    42 public:
       
    43     /**
       
    44     * C++ constructor.
       
    45     */
       
    46     CNsmlContactsDataStoreExtensionPrivate( const TDesC &manager );
       
    47     
       
    48     /**
       
    49     * Destructor.
       
    50     */
       
    51     ~CNsmlContactsDataStoreExtensionPrivate();
       
    52     
       
    53 public: // Methods
       
    54     /**
       
    55     * Fetch the Contact Item from the DB 
       
    56     * @param uid UID of the desired item to be fetched
       
    57     * @param contactbufbase on return will have the fetched Contact details
       
    58     */
       
    59     TInt ExportContactsL( const TUid &uid, CBufBase &contactbufbase );
       
    60     
       
    61     /**
       
    62     * Store the Contact Item to the DB
       
    63     * @param contactbufbase Contact item to be saved to the DB
       
    64     * @return A pointer to list of newly saved Contact UIDs'
       
    65     */
       
    66     CArrayFixFlat<TUid>* ImportContactsL( const TDesC8 &contactbufbase );
       
    67     
       
    68     /**
       
    69     * Fetch Contact details
       
    70     * @param uid UID of the desired Contact item
       
    71     * @param contactitem on return will have pointer class containing contact details
       
    72     */
       
    73     TInt ReadContactL( const TUid &uid, CNsmlContactItem *contactitem );
       
    74     
       
    75     /**
       
    76     * Delete a Contact
       
    77     * @param uid UID of the desired Contact item
       
    78     * @return status of the operation
       
    79     */
       
    80     TBool DeleteContactL( const TUid &uid );
       
    81     
       
    82     /**
       
    83     * Delete List of Contacts
       
    84     * @param arrDelete List of Contact UIDs' to be deleted
       
    85     * @return status of the operation
       
    86     */
       
    87     TBool DeleteContactsL( CArrayFixFlat<TUid> *arrDelete );
       
    88     
       
    89     /**
       
    90     * Delete All Contacts
       
    91     * @return status of the operation
       
    92     */
       
    93     TBool DeleteAllContactsL();
       
    94     
       
    95     /**
       
    96     * List Supported Stores
       
    97     * @param contactuidlist on return will have list of stores
       
    98     */
       
    99     void ListStoresL( CDesCArray *contactuidlist );
       
   100     
       
   101     /**
       
   102     * Unique ID for a Store
       
   103     * @return unique id represented as integer  
       
   104     */
       
   105     TInt64 MachineIdL();
       
   106     
       
   107     /**
       
   108     * Fetch all available Contacts from the DB
       
   109     * @param contactuidlist on return will have list of all Contact UIDs'
       
   110     */
       
   111     void ListContactsL( CArrayFixFlat<TUid> *contactuidlist );
       
   112 private:
       
   113     /**
       
   114     * Convert the given QDateTime to S60 TTime
       
   115     * @param datetime variable to be converted
       
   116     */
       
   117     TTime qTimeToS60TTime(const QDateTime &datetime);
       
   118     
       
   119    
       
   120 private: // Data
       
   121     QString mManagerName;
       
   122 	QContactManager *mContactManager;
       
   123  	QVersitWriter *mWriter;
       
   124  	QVersitReader *mReader;
       
   125 	QVersitContactExporter *mExporter;
       
   126 	QVersitContactImporter *mImporter;
       
   127 };
       
   128 
       
   129 #endif /* NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_*/