sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@publishedAll
|
sl@0
|
22 |
@released
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef __TCTTOKENHANDLE_H__
|
sl@0
|
26 |
#define __TCTTOKENHANDLE_H__
|
sl@0
|
27 |
|
sl@0
|
28 |
#include <e32std.h>
|
sl@0
|
29 |
|
sl@0
|
30 |
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
* Defines a handle to a subclass of the MCTToken class.
|
sl@0
|
33 |
*
|
sl@0
|
34 |
* The handle identifies the class, not a particular instance of that class.
|
sl@0
|
35 |
* It is guaranteed to be unique within the context of a specific device (e.g.
|
sl@0
|
36 |
* mobile phone, etc.).
|
sl@0
|
37 |
*
|
sl@0
|
38 |
* The handle is especially useful for communication across process boundaries.
|
sl@0
|
39 |
* For example: a process (A) can open a token (T), get a handle to it and then
|
sl@0
|
40 |
* give the handle to another process (B). This process (B) can then try to open
|
sl@0
|
41 |
* the token (T) using that handle.
|
sl@0
|
42 |
*
|
sl@0
|
43 |
* @since v7.0
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
class TCTTokenHandle
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
/**
|
sl@0
|
49 |
* Creates an invalid handle for the token.
|
sl@0
|
50 |
*
|
sl@0
|
51 |
* An invalid handle has a iTokenTypeUid and a iTokenId equal to 0.
|
sl@0
|
52 |
*/
|
sl@0
|
53 |
IMPORT_C TCTTokenHandle();
|
sl@0
|
54 |
|
sl@0
|
55 |
/**
|
sl@0
|
56 |
* Creates a handle for the token.
|
sl@0
|
57 |
*
|
sl@0
|
58 |
* @param aTokenTypeUid The value of the TokenType Uid.
|
sl@0
|
59 |
* @param aTokenId The identity of the Token.
|
sl@0
|
60 |
*/
|
sl@0
|
61 |
IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
|
sl@0
|
62 |
|
sl@0
|
63 |
/** The copy constructor.
|
sl@0
|
64 |
*
|
sl@0
|
65 |
* @param aTokenHandle The Token Handle object to copy
|
sl@0
|
66 |
*/
|
sl@0
|
67 |
IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
|
sl@0
|
68 |
|
sl@0
|
69 |
/**
|
sl@0
|
70 |
* Equality operator.
|
sl@0
|
71 |
*
|
sl@0
|
72 |
* Tests whether this Token Handle object is equal to the specified
|
sl@0
|
73 |
* Token Handle object.
|
sl@0
|
74 |
*
|
sl@0
|
75 |
* @param aTokenHandle The Token Handle object to be compared.
|
sl@0
|
76 |
* @return ETrue, if this Token Handle object is equal to
|
sl@0
|
77 |
* the specified Token Handle object; EFalse otherwise.
|
sl@0
|
78 |
*/
|
sl@0
|
79 |
IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
* Inequality operator.
|
sl@0
|
83 |
*
|
sl@0
|
84 |
* Tests whether this Token Handle object is not equal to the specified
|
sl@0
|
85 |
* Token Handle object.
|
sl@0
|
86 |
*
|
sl@0
|
87 |
* @param aTokenHandle The Token Handle object to be compared.
|
sl@0
|
88 |
* @return ETrue, if this Token Handle object is not equal to
|
sl@0
|
89 |
* the specified Token Handle object; EFalse, otherwise.
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
|
sl@0
|
92 |
|
sl@0
|
93 |
public:
|
sl@0
|
94 |
/**
|
sl@0
|
95 |
* The UID of the TokenType.
|
sl@0
|
96 |
*
|
sl@0
|
97 |
* This identifies to which TokenType the Token belongs.
|
sl@0
|
98 |
*/
|
sl@0
|
99 |
TUid iTokenTypeUid;
|
sl@0
|
100 |
|
sl@0
|
101 |
/**
|
sl@0
|
102 |
* The identity of the Token.
|
sl@0
|
103 |
*
|
sl@0
|
104 |
* This Id is unique within the context of a TokenType.
|
sl@0
|
105 |
*/
|
sl@0
|
106 |
TInt iTokenId;
|
sl@0
|
107 |
};
|
sl@0
|
108 |
|
sl@0
|
109 |
inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
|
sl@0
|
110 |
{
|
sl@0
|
111 |
return !(*this == aTokenHandle);
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
#endif
|