datacommsserver/networkingdialogapi/agentnotifier/inc/agentshellnotifier.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-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 #ifndef AGENTSHELLNOTIFIER_H
       
    17 #define AGENTSHELLNOTIFIER_H
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <e32base.h>
       
    21 #include <twintnotifier.h>
       
    22 #include "agentnotifierdefs.h"
       
    23 #include <comms-infras/commsdebugutility.h>
       
    24 
       
    25 
       
    26 const TInt KMaxDeviceRows=6;
       
    27 
       
    28 IMPORT_C CArrayPtr<MNotifierBase2>* NotifierArray();
       
    29 
       
    30 class CAgentDialogUpdate : public CActive
       
    31 	{
       
    32 public:
       
    33 	//	Construction
       
    34 	static CAgentDialogUpdate* NewL(const RMessagePtr2& aMessage);
       
    35 	~CAgentDialogUpdate();
       
    36 	
       
    37 	void Update(const RMessagePtr2& aMessage);
       
    38 	
       
    39 	//From CActive
       
    40 	void DoCancel();
       
    41 	void RunL();
       
    42 
       
    43 private:
       
    44 	//	Construction
       
    45 	void ConstructL(const RMessagePtr2& aMessage);
       
    46 	CAgentDialogUpdate(const RMessagePtr2& aMessage);
       
    47 
       
    48 	TUid iServiceUid;
       
    49 	CConsoleBase* iConsole;
       
    50 	RMessagePtr2 iMessagePtr;
       
    51 	__FLOG_DECLARATION_MEMBER;
       
    52 	};
       
    53 
       
    54 class CAgentShellNotifier : public MNotifierBase2, public CBase
       
    55 	{
       
    56 public:
       
    57 
       
    58 	//	Construction
       
    59 	static CAgentShellNotifier* NewL();
       
    60 	~CAgentShellNotifier();
       
    61 
       
    62 	//	From MNotifierBase
       
    63 	/**
       
    64 	 * Called when all resources allocated by notifiers should be freed.
       
    65 	 */
       
    66 	virtual void Release();
       
    67 	/**
       
    68 	 * Called when a notifier is first loaded to allow any initial construction that is required.
       
    69 	 */
       
    70 	virtual TNotifierInfo RegisterL();
       
    71 	/**
       
    72 	 * Return the priority a notifier takes and the channels it acts on.  The return value may be varied 
       
    73 	 * at run-time.
       
    74 	 */
       
    75 	virtual TNotifierInfo Info() const;
       
    76 	/**
       
    77 	 * Start the notifier with data aBuffer and return an initial response.
       
    78 	 */
       
    79 	virtual TPtrC8 StartL(const TDesC8& aBuffer);
       
    80 	/**
       
    81 	 * Start the notifier with data aBuffer.  aMessage should be completed when the notifier is deactivated.
       
    82 	 * May be called multiple times if more than one client starts the notifier.  The notifier is immediately
       
    83 	 * responsible for completing aMessage.
       
    84 	 */
       
    85 	virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
       
    86 	/**
       
    87 	 * The notifier has been deactivated so resources can be freed and outstanding messages completed.
       
    88 	 */
       
    89 	virtual void Cancel();
       
    90 	/**
       
    91 	 * Update a currently active notifier with data aBuffer.
       
    92 	 */
       
    93 	virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
       
    94 	
       
    95 
       
    96 private:
       
    97 	void ConstructL();
       
    98 	
       
    99 	TNotifierInfo iInfo;
       
   100 	CAgentDialogUpdate* iAgentShellDialog;
       
   101 	};
       
   102 
       
   103 #endif
       
   104 
       
   105