htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiSimDirHandler.h
branchRCL_3
changeset 18 48060abbbeaf
parent 17 d40e813b23c0
child 19 b3cee849fa46
equal deleted inserted replaced
17:d40e813b23c0 18:48060abbbeaf
     1 /*
       
     2 * Copyright (c) 2009 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:  Class that handles SIM card contacts creation and deletion
       
    15 *                using the new Virtual Phonebook API
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef HTISIMDIRHANDLER_H
       
    21 #define HTISIMDIRHANDLER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <HtiServicePluginInterface.h>
       
    27 #include <etelmm.h>
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Class that handles SIM card contacts creation and deletion using the
       
    43 *  new Virtual Phonebook API.
       
    44 */
       
    45 class CHtiSimDirHandler : public CBase
       
    46     {
       
    47     public:
       
    48 
       
    49     enum TContactFieldType
       
    50         {
       
    51         ENameField        = 0x01,
       
    52         ESecondNameField  = 0x02,
       
    53         EPhoneNumberField = 0x03,
       
    54         EEMailField       = 0x04,
       
    55         EAdditNumberField = 0x05
       
    56         };
       
    57 
       
    58     public:
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         */
       
    63         static CHtiSimDirHandler* NewL();
       
    64 
       
    65         /**
       
    66         * Called when there is a message to be processed by this service.
       
    67         * @param aMessage message body destinated to the servive
       
    68         * @param aPriority message priority
       
    69         */
       
    70         void ProcessMessageL( const TDesC8& aMessage,
       
    71             THtiMessagePriority aPriority );
       
    72 
       
    73         /**
       
    74         * Indicates whether this handler is ready to receive
       
    75         * a new message or if it's busy processing previous message.
       
    76         * @return ETrue if processing, EFalse if ready for new request
       
    77         */
       
    78         TBool IsBusy();
       
    79 
       
    80         /**
       
    81         * Destructor.
       
    82         */
       
    83         virtual ~CHtiSimDirHandler();
       
    84 
       
    85         /**
       
    86         * Sets the dispatcher to send outgoing messages to.
       
    87         * @param aDispatcher pointer to dispatcher instance
       
    88         */
       
    89         void SetDispatcher( MHtiDispatcher* aDispatcher );
       
    90 
       
    91     private: // constructors
       
    92 
       
    93         /**
       
    94         * C++ default constructor.
       
    95         */
       
    96         CHtiSimDirHandler();
       
    97 
       
    98         /**
       
    99         * 2nd phase constructor.
       
   100         */
       
   101         void ConstructL();
       
   102 
       
   103     private: // helpers
       
   104 
       
   105         void HandleSimCardInfoL(const TDesC8& aData);
       
   106         void HandleSimContactImportL(const TDesC8& aData);
       
   107         void HandleSimContactDeleteL(const TDesC8& aData);
       
   108 
       
   109         TBool CheckImportMsg(const TDesC8& aData);
       
   110 
       
   111         void SendOkMsgL( const TDesC8& aData );
       
   112         void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
       
   113 
       
   114     private: // data
       
   115 
       
   116         // Pointer to the dispatcher (referenced)
       
   117         MHtiDispatcher* iDispatcher;
       
   118 
       
   119         // Flag indicating if service is busy processing a request
       
   120         TBool iIsBusy;
       
   121         
       
   122         RTelServer iEtelServer;
       
   123         RMobilePhone iEtelPhone;
       
   124         RMobilePhoneBookStore iEtelStore;
       
   125 
       
   126         TBool iStoreIsOpen;
       
   127     };
       
   128 
       
   129 #endif // HTISIMDIRHANDLER_H