linklayercontrol/networkinterfacemgr/inc/CStateMachineAgentBase.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 /**
       
     2 * Copyright (c) 2003-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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file CStateMachineAgentBase.H
       
    22 */
       
    23 
       
    24 #if !defined(__CSTATEMACHINEAGENT_H__)
       
    25 #define __CSTATEMACHINEAGENT_H__
       
    26 
       
    27 #include <comms-infras/cagentbase.h>
       
    28 #include <comms-infras/cagentsmbase.h>
       
    29 #include <comms-infras/ni_log.h>
       
    30 
       
    31 class CStateMachineAgentBase : public CAgentBase, public MAgentNotify
       
    32 /**
       
    33  * An agent that owns a state machine
       
    34  * @note This class is part of a compatibility layer for porting agent extensions (.agx) from v6.1
       
    35  *
       
    36  * @publishedPartner
       
    37  * @deprecated since v9.5. Use MCPRs/CPRs/SCPRs instead of agents.
       
    38  */
       
    39 	{
       
    40 public:
       
    41 	IMPORT_C virtual ~CStateMachineAgentBase();
       
    42 protected:
       
    43 	IMPORT_C void ConstructL();
       
    44 	IMPORT_C CStateMachineAgentBase();
       
    45 public:
       
    46 	// implementation of the CNifAgentBase interface
       
    47 	IMPORT_C virtual void Connect(TAgentConnectType aType);
       
    48 	IMPORT_C virtual void Connect(TAgentConnectType aType, CStoreableOverrideSettings* aOverrideSettings);
       
    49 	IMPORT_C virtual void CancelConnect();
       
    50 	IMPORT_C virtual void Disconnect(TInt aReason);
       
    51 	IMPORT_C virtual TInt GetExcessData(TDes8& aBuffer);
       
    52 	IMPORT_C virtual TInt Notification(TNifToAgentEventType aEvent, TAny* aInfo);
       
    53 	IMPORT_C virtual void GetLastError(TInt& aError);
       
    54 
       
    55 	// implementation of the MAgentNotify interface
       
    56 	IMPORT_C virtual void PreventConnectionRetries();
       
    57 	IMPORT_C virtual void ServiceStarted();
       
    58 	IMPORT_C virtual void ConnectionComplete(TInt aProgress, TInt aError);
       
    59 	IMPORT_C virtual void ConnectionComplete(TInt aError);
       
    60 	IMPORT_C virtual void DisconnectComplete();
       
    61 	IMPORT_C virtual void UpdateProgress(TInt aProgress, TInt aError);
       
    62 	IMPORT_C virtual TInt Notification(TAgentToNifEventType aEvent, TAny* aInfo);
       
    63 	IMPORT_C virtual TInt IncomingConnectionReceived();
       
    64 	IMPORT_C virtual TBool IsReconnect() const;
       
    65 	
       
    66 protected:
       
    67 	enum TNotifyOperation
       
    68 		{
       
    69 		EUndefined,
       
    70 		EServiceStarted,
       
    71 		EConnectComplete,
       
    72 		EDisconnectComplete
       
    73 		};
       
    74 
       
    75 protected:
       
    76 	virtual CAgentSMBase* CreateAgentSML(MAgentNotify& aObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDb, TCommDbConnectionDirection aDir) = 0;
       
    77 	void CreateAndStartStateMachineL();
       
    78 
       
    79 	void CallNotifyCb(TNotifyOperation aOperation, TInt aError);
       
    80 	static TInt NotifyCbComplete(TAny* aThisPtr);
       
    81 	void DoNotify();
       
    82 
       
    83 protected:
       
    84 	CAgentSMBase* iStateMachine;
       
    85 	CAsyncCallBack* iNotifyCb;
       
    86 	TNotifyOperation iNotifyCbOp;
       
    87 	TInt iNotifyCbError;
       
    88 	TInt iDisconnectReason;
       
    89 	};
       
    90 
       
    91 #endif
       
    92