sysstatemgmt/systemstatereferenceplugins/custcmd/inc/cmdpublishsimownedandchanged.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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  @internalComponent
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef __CMDPUBLISHSIMOWNEDANDCHANGED_H__
       
    23 #define __CMDPUBLISHSIMOWNEDANDCHANGED_H__
       
    24 
       
    25 #include <etelmm.h>
       
    26 #include <ssm/ssmcustomcommand.h>
       
    27 #include <ssm/ssmadaptationcli.h>
       
    28 
       
    29 NONSHARABLE_CLASS (CCustomCmdPublishSimOwnedAndChanged) : public CActive, public MSsmCustomCommand
       
    30 	{
       
    31 public:
       
    32 	static CCustomCmdPublishSimOwnedAndChanged* NewL();
       
    33 
       
    34 	// from MSsmcustomCommand
       
    35 	TInt Initialize(CSsmCustomCommandEnv* aCmdEnv);
       
    36 	void Execute(const TDesC8& aParams, TRequestStatus& aStatus);
       
    37 	void Close();
       
    38 	void Release();
       
    39 	void ExecuteCancel();
       
    40 
       
    41 protected:
       
    42 	// from CActive
       
    43 	void RunL();
       
    44 	void DoCancel();
       
    45 	TInt RunError(TInt aError);
       
    46 
       
    47 private:
       
    48 	CCustomCmdPublishSimOwnedAndChanged();
       
    49 	~CCustomCmdPublishSimOwnedAndChanged();
       
    50 	void ConstructL();
       
    51 	void CompleteClientRequest(TInt aReason);
       
    52 
       
    53 	void SimOwned();
       
    54 	void SimChanged();
       
    55 	
       
    56 	void ReadAndUpdateStoredImsiL(RMobilePhone::TMobilePhoneSubscriberId& aReadValue,
       
    57 	    const RMobilePhone::TMobilePhoneSubscriberId aUpdateValue);
       
    58 	TInt CompareToLastStoredImsi(const RMobilePhone::TMobilePhoneSubscriberId aNewValue);
       
    59 #ifdef TEST_CUSTCMD_MACRO
       
    60     friend class CCustomCmdTestPublishSimOwnedAndChanged;
       
    61 #endif
       
    62 private:
       
    63 	enum TPublishSimOwnedAndChangedState
       
    64 		{
       
    65 		EPublishSimOwnedAndChangedIdle = 0,
       
    66 		EPublishSimOwned,
       
    67 		EPublishSimChanged,
       
    68 		};
       
    69 
       
    70 	RSsmSimAdaptation iSsmSimAdaptation;
       
    71 	TPublishSimOwnedAndChangedState iState;
       
    72 	TRequestStatus* iExecuteRequest;
       
    73 	TPckgBuf<TBool> iBooleanPckg;
       
    74 
       
    75 	// Session with telephony server
       
    76     RTelServer iServer;
       
    77 
       
    78     // Phone sub-session handle
       
    79     RMobilePhone iPhone;
       
    80 
       
    81     //Value received from Etel will be stored here
       
    82     RMobilePhone::TMobilePhoneSubscriberId iSubscriberId;
       
    83     HBufC* iTsyModuleName;
       
    84 
       
    85 	};
       
    86 
       
    87 #endif // __CMDPUBLISHSIMOWNEDANDCHANGED_H__