sdkcreationmw/sdkruntimes/loggingapi/inc/EcmtClient.h
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
#ifndef ECMTCLIENT_H
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
#define ECMTCLIENT_H
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
//  INCLUDES
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#include <e32base.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
// FORWARD DECLARATIONS
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
class CEcmtServerListener;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
class MEcmtServerObserver;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
// CONSTANTS
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
* Formatted message maximum length
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
const TInt KFormatMaxSize = 256;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
*  A handle to a session with Ecmt server.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
*  This class provides methods for sending textual data to the 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
*  System Output Diagnostic view on the connected PC.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
*  @ingroup EcmtClient
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
class REcmt : public RSessionBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
    public: // New functions
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
    	* Constructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
    	IMPORT_C REcmt();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
    	* Destructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
    	IMPORT_C ~REcmt();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
    	* Connects the client process to the Ecmt server. To end the session, 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
    	* use the Close() method.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
    	* @return KErrNone if succesfull otherwise one of the system-wide error codes.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
    	IMPORT_C TInt Connect( );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
    	* Closes the session and frees any allocated resources.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
    	IMPORT_C void Close( );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
		/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
		* This member is internal and not intended for use.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
      * This member leaves immediately with KErrNotSupported.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
      * @deprecated 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
		*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
      IMPORT_C void SetServerObserverL( MEcmtServerObserver* aObserver );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
    	* Writes text data to the System Output Diagnostic view on the connected PC.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
    	* @param aText Text to be written.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
    	IMPORT_C void Write( const TDesC16& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
    	* Writes text data to the System Output Diagnostic view on the connected PC.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
    	* The text can include formatting directives (\%d, \%c, ...) which are then filled
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
    	* with the following parameters. The maximum length of the message after formatting
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
    	* is defined by KFormatMazSize.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
    	* @param aText Text to be written.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
    	* @param ... Values used for formatting.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
		IMPORT_C void WriteFormat(TRefByValue<const TDesC16> aFmt,...);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
		* This member is internal and not intended for use.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
      *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
      * Sends a binary message to the specified UID (plugin, core).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
    	IMPORT_C void Send( const TUint uid, const TDesC8& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
		/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
		* This member is internal and not intended for use.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
      *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
      * Sets this client as a recipient for messages.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
		*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
      IMPORT_C void SetServerObserverL( TUid aUid, MEcmtServerObserver* aObserver );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
    	* Writes text data to the System Output Diagnostic view on the connected PC.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
	* Unlike Write(), doesn't require Connect() before or Close() after calling this.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
    	* @param aText Text to be written.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
    	IMPORT_C static void SWrite( const TDesC16& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
    	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
    	* Writes text data to the System Output Diagnostic view on the connected PC.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
    	* The text can include formatting directives (\%d, \%c, ...) which are then filled
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
    	* with the following parameters. The maximum length of the message after formatting
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
    	* is defined by KFormatMazSize.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
	* Unlike WriteFormat(), doesn't require Connect() before or Close() after calling this.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
    	* @param aText Text to be written.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
    	* @param ... Values used for formatting.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
    	*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
	IMPORT_C static void SWriteFormat(TRefByValue<const TDesC16> aFmt,...);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
	 * Closes the REcmt session used by SWrite() and
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
	 * SWriteFormat(). If those funcions are called, also SClose()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
	 * must be called in order to avoid memory allocation errors.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
	 */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
	IMPORT_C static void SClose();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
	private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
	static REcmt* GetServer();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
      /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
       * Requests a message.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
       */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
    	void RequestServerNotification( TDes8& aDes, TRequestStatus& aStatus );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
      /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
       * Cancels the message request.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
       */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
    	void CancelRequestServerNotification( );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
   	private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
		MEcmtServerObserver*	iObserver;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
		CEcmtServerListener* 	iServerListener;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
		friend class CEcmtServerListener;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
    };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
#endif
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
// End of File