remotecontrol/remotecontrolfw/targetselectorplugin/public/clientinfo.h
changeset 51 20ac952a623c
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
       
     1 // Copyright (c) 2004-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  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef CLIENTINFO_H
       
    23 #define CLIENTINFO_H
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 /**
       
    28 Contains information (of interest to the TSP) about a client of RemCon.
       
    29 Includes the client's process ID and the client's current send message 
       
    30 (RMessage2) which is triggering a request (AddressOutgoingCommand or 
       
    31 PermitOutgoingCommand) on the TSP. Via the RMessage2, the TSP can access the 
       
    32 client's secure ID and also do capability checks on the client.
       
    33 The process ID is also used by the server to police creation of target 
       
    34 sessions (only 1 is allowed per client process).
       
    35 */
       
    36 class TClientInfo
       
    37 	{
       
    38 public:
       
    39 	/** Link between elements of this type in a TSglQue. If this member 
       
    40 	changes offset, remconserver must be rebuilt. */
       
    41 	TSglQueLink iLink;
       
    42 	TSglQueLink iLink2;
       
    43 
       
    44 public:
       
    45 	/** Constructor. */
       
    46 	IMPORT_C TClientInfo();
       
    47 
       
    48 	/** Destructor. */
       
    49 	IMPORT_C ~TClientInfo();
       
    50 
       
    51 public:
       
    52 	/** 
       
    53 	Accessor for process ID.
       
    54 	@return The process ID.
       
    55 	*/
       
    56 	IMPORT_C TProcessId& ProcessId();
       
    57 
       
    58 	/** 
       
    59 	Accessor for process ID.
       
    60 	@return The process ID.
       
    61 	*/
       
    62 	IMPORT_C TProcessId ProcessId() const;
       
    63 
       
    64 	/**
       
    65 	Accessor for message.
       
    66 	@return The message.
       
    67 	*/
       
    68 	IMPORT_C RMessage2& Message();
       
    69 
       
    70 	/**
       
    71 	Accessor for the client's current Send message. 
       
    72 	This is provided for the TSP to access the client's current Send message 
       
    73 	for capability checks only. The TSP must not Complete this message. Note 
       
    74 	that this message is only valid if AddressOutgoingCommand or 
       
    75 	PermitOutgoingCommand are being used (i.e. the client currently has a Send 
       
    76 	outstanding). 
       
    77 	For AddressIncomingCommand, the message returned will be invalid and must 
       
    78 	not be used by the TSP.
       
    79 	@return The message.
       
    80 	*/
       
    81 	IMPORT_C const RMessage2& Message() const;
       
    82 
       
    83 	/**
       
    84 	Accessor for the secure ID.
       
    85 	@return The secure ID.
       
    86 	*/
       
    87 	IMPORT_C TSecureId SecureId() const;
       
    88 
       
    89 	/**
       
    90 	Accessor for the secure ID.
       
    91 	@return The secure ID.
       
    92 	*/
       
    93 	IMPORT_C TSecureId& SecureId();
       
    94 
       
    95 private:
       
    96 	/** The process ID. */
       
    97 	TProcessId iProcessId;
       
    98 
       
    99 	/** The client's current send message. */
       
   100 	RMessage2 iMessage;
       
   101 
       
   102 	/** The secure ID. */
       
   103 	TSecureId iSecureId;
       
   104 	
       
   105 	// The previous BC pad has been used for iLink2. Further extensions will need to be implemented by moving data out
       
   106 	// into an extension class
       
   107 	
       
   108 	};
       
   109 
       
   110 class TClientInfoConstIter: TSglQueIter<TClientInfo>
       
   111 	{
       
   112 public:
       
   113 	inline TClientInfoConstIter(TSglQue<TClientInfo>& aQue);
       
   114 	inline void SetToFirst();
       
   115 	inline void Set(TClientInfo& aLink);
       
   116 	inline operator const TClientInfo*();	
       
   117 	inline const TClientInfo* operator++(TInt);
       
   118 	};
       
   119 
       
   120 inline TClientInfoConstIter::TClientInfoConstIter(TSglQue<TClientInfo>& aQue): TSglQueIter<TClientInfo>(aQue)
       
   121 	{ }
       
   122 
       
   123 inline void TClientInfoConstIter::SetToFirst()
       
   124 	{
       
   125 	TSglQueIter<TClientInfo>::SetToFirst();
       
   126 	}
       
   127 
       
   128 inline void TClientInfoConstIter::Set(TClientInfo& aLink)
       
   129 	{ DoSet(&aLink); }
       
   130 
       
   131 inline TClientInfoConstIter::operator const TClientInfo*()
       
   132 	{ return((const TClientInfo*)DoCurrent()); }
       
   133 
       
   134 inline const TClientInfo* TClientInfoConstIter::operator ++(TInt)
       
   135 	{ return((const TClientInfo *)DoPostInc()); }
       
   136 
       
   137 #endif // CLIENTINFO_H