1 /* |
|
2 * Copyright (c) 2002 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 the License "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: This header file contains the declaration of TPushInitiator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef PUSHINITIATOR_H |
|
21 #define PUSHINITIATOR_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <e32def.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 const TUint32 ENullInitiatorEntryId = 0; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * This class represents a push initiator's address. |
|
36 */ |
|
37 class CPushInitiator : public CBase |
|
38 { |
|
39 public: // Data type |
|
40 |
|
41 enum TAddrType ///< Address type |
|
42 { |
|
43 ETypeIpv4, ///< IPv4 |
|
44 ETypeIpv6, ///< IPv6 |
|
45 ETypeE164, ///< MSISDN |
|
46 ETypeAlpha, ///< Alphanumeric |
|
47 ETypeAny ///< Any |
|
48 }; |
|
49 |
|
50 public: // Constructors |
|
51 |
|
52 IMPORT_C CPushInitiator(); |
|
53 IMPORT_C ~CPushInitiator(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 IMPORT_C void SetAddressL( const TDesC& aAddr, |
|
58 TAddrType aType ); |
|
59 |
|
60 inline const TDesC& Addr() const; |
|
61 inline TAddrType Type() const; |
|
62 |
|
63 inline void SetEntryID( TUint32 aEntryID ); |
|
64 inline TUint32 EntryID() const; |
|
65 |
|
66 inline CPushInitiator* AllocL() const; |
|
67 inline CPushInitiator* AllocLC() const; |
|
68 |
|
69 /** |
|
70 * Compares two initiators for equality. It compares the address and |
|
71 * type. Note that ETypeAny matches any! |
|
72 * @param aPushInitiator The other push initiator. |
|
73 * @return ETrue if they are equal. |
|
74 */ |
|
75 inline TBool operator==( const CPushInitiator& aOther ) const; |
|
76 inline TBool operator!=( const CPushInitiator& aOther ) const; |
|
77 |
|
78 private: // Data members |
|
79 |
|
80 HBufC* iAddress; ///< Address string. Owned. |
|
81 TAddrType iType; ///< Address type. |
|
82 TUint32 iEntryID; ///< Unique ID of the entry. |
|
83 }; |
|
84 |
|
85 #include "PushInitiator.inl" |
|
86 |
|
87 #endif // PUSHINITIATOR_H |
|
88 |
|
89 // End of File |
|