telephonyserverplugins/ctsydispatchlayer/inc/cphonebookondispatcher.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalAll 
       
    19 */
       
    20 
       
    21 #ifndef __CPHONEBOOKONDISPATCHER_H_
       
    22 #define __CPHONEBOOKONDISPATCHER_H_
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <e32def.h>
       
    28 #include <etelmm.h>
       
    29 
       
    30 #include <ctsy/ltsy/mltsydispatchfactory.h>
       
    31 #include <ctsy/serviceapi/cmmgsmphonestorageutility.h>
       
    32 
       
    33 #include "requestqueueoneshot.h"
       
    34 #include <ctsy/ltsy/ltsylogger.h>
       
    35 #include "mdispatchercallback.h"
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CMmDataPackage;
       
    39 class MmMessageManagerCallback;
       
    40 class TDispatcherHolder;
       
    41 
       
    42 class MLtsyDispatchPhonebookOnStoreRead;
       
    43 class MLtsyDispatchPhonebookOnStoreDeleteAll;
       
    44 class MLtsyDispatchPhonebookOnStoreReadEntry;
       
    45 class MLtsyDispatchPhonebookOnStoreGetInfo;
       
    46 class MLtsyDispatchPhonebookOnStoreGetReadStoreSize;
       
    47 class MLtsyDispatchPhonebookOnStoreDeleteEntry;
       
    48 class MLtsyDispatchPhonebookOnStoreWriteEntry;
       
    49 class MLtsyDispatchPhonebookOnStoreWrite;
       
    50 class MLtsyDispatchPhonebookOnStoreGetStoreSize;
       
    51 
       
    52 
       
    53 
       
    54 // CLASS DECLARATION
       
    55 
       
    56 /**
       
    57  * This class is responsible for packing and unpacking data belonging
       
    58  * to PhonebookOn related requests to the Licensee LTSY.
       
    59  */
       
    60 class CPhonebookOnDispatcher : public CBase, public MDispatcherCallback
       
    61 	{
       
    62 public:
       
    63 
       
    64 	virtual ~CPhonebookOnDispatcher();
       
    65 	
       
    66 	static CPhonebookOnDispatcher* NewL(
       
    67 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    68 			MmMessageManagerCallback& aMessageManagerCallback,
       
    69 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    70 	
       
    71 	static CPhonebookOnDispatcher* NewLC(
       
    72 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    73 			MmMessageManagerCallback& aMessageManagerCallback,
       
    74 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    75 	
       
    76 	// Dispatcher functions for dispatching requests DOWN to the Licensee LTSY
       
    77 	
       
    78 	TInt DispatchStoreReadL(const CMmDataPackage* aDataPackage);
       
    79 	TInt DispatchStoreDeleteAllL();
       
    80 	TInt DispatchStoreReadEntryL(const CMmDataPackage* aDataPackage);
       
    81 	TInt DispatchStoreGetInfoL();
       
    82 	TInt DispatchStoreGetReadStoreSizeL();
       
    83 	TInt DispatchStoreDeleteEntryL(const CMmDataPackage* aDataPackage);
       
    84 	TInt DispatchStoreWriteEntryL(const CMmDataPackage* aDataPackage);
       
    85 	TInt DispatchStoreWriteL(const CMmDataPackage* aDataPackage);
       
    86 	TInt DispatchStoreGetStoreSizeL();
       
    87 	
       
    88 	
       
    89 	// Complete functions for receiving completions UP from the Licensee LTSY
       
    90 	// via the CCtsyDispatcherCallback object.
       
    91 	
       
    92 	void CallbackStoreReadAll(TInt aError);
       
    93 	void CallbackStoreRead(TInt aError, TInt aIndex, const TDesC& aName, const TDesC& aNumber);
       
    94 	void CallbackStoreDeleteAll(TInt aError);
       
    95 	void CallbackStoreReadEntry(TInt aError, TInt aIndex, const TDesC& aName, const TDesC& aNumber);
       
    96 	void CallbackStoreGetInfo(TInt aError, TInt aNumOfEntries, TInt aUsedEntries, TInt aNameLen, TInt aNumLen);
       
    97 	void CallbackStoreGetReadStoreSize(TInt aError, TInt aSize);
       
    98 	void CallbackStoreDeleteEntry(TInt aError);
       
    99 	void CallbackStoreWriteEntry(TInt aError);
       
   100 	void CallbackStoreWrite(TInt aError, TInt aLocation);
       
   101 	void CallbackStoreGetStoreSize(TInt aError, TInt aSize);
       
   102 	
       
   103 	
       
   104 	// From MDispatcherCallback
       
   105 	void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage);
       
   106 	
       
   107 	// Other public functions
       
   108 	void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder);
       
   109 	
       
   110 private:
       
   111 
       
   112 	CPhonebookOnDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory,
       
   113 	   			  	 MmMessageManagerCallback& aMessageManagerCallback,
       
   114 	   			  	 CRequestQueueOneShot& aRequestAsyncOneShot);		
       
   115 	
       
   116 	void ConstructL();
       
   117 	
       
   118 private:	// Not owned
       
   119 
       
   120 	MLtsyDispatchFactoryV1& iLtsyFactoryV1;
       
   121 	MmMessageManagerCallback& iMessageManagerCallback;
       
   122 	CRequestQueueOneShot& iRequestAsyncOneShot;
       
   123 	TDispatcherHolder* iDispatcherHolder;
       
   124 	
       
   125 	// Interfaces in the Licensee LTSY, not owned by this object
       
   126 	
       
   127     MLtsyDispatchPhonebookOnStoreRead* iLtsyDispatchPhonebookOnStoreRead;
       
   128     MLtsyDispatchPhonebookOnStoreDeleteAll* iLtsyDispatchPhonebookOnStoreDeleteAll;
       
   129     MLtsyDispatchPhonebookOnStoreReadEntry* iLtsyDispatchPhonebookOnStoreReadEntry;
       
   130     MLtsyDispatchPhonebookOnStoreGetInfo* iLtsyDispatchPhonebookOnStoreGetInfo;
       
   131     MLtsyDispatchPhonebookOnStoreGetReadStoreSize* iLtsyDispatchPhonebookOnStoreGetReadStoreSize;
       
   132     MLtsyDispatchPhonebookOnStoreDeleteEntry* iLtsyDispatchPhonebookOnStoreDeleteEntry;
       
   133     MLtsyDispatchPhonebookOnStoreWriteEntry* iLtsyDispatchPhonebookOnStoreWriteEntry;
       
   134     MLtsyDispatchPhonebookOnStoreWrite* iLtsyDispatchPhonebookOnStoreWrite;
       
   135     MLtsyDispatchPhonebookOnStoreGetStoreSize* iLtsyDispatchPhonebookOnStoreGetStoreSize;
       
   136     
       
   137 	}; // class CPhonebookOnDispatcher
       
   138 
       
   139 #endif // __CPHONEBOOKONDISPATCHER_H_
       
   140