|
1 /* |
|
2 * Copyright (c) 2003-2009 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 "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: |
|
15 * Name : sipprofileitem.h |
|
16 * Part of : SIP Profile Client |
|
17 * Interface : private |
|
18 * The class providing profile caching for client |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 #ifndef CSIPPROFILEITEM_H |
|
31 #define CSIPPROFILEITEM_H |
|
32 |
|
33 // INCLUDES |
|
34 |
|
35 #include <e32base.h> |
|
36 |
|
37 #include "sipconcreteprofile.h" |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 class CSIPProfile; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * The class provides profile caching and reference counting |
|
47 * |
|
48 * @lib sipprofilecli.lib |
|
49 */ |
|
50 class CSIPProfileItem: public CBase |
|
51 { |
|
52 public : |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @return new instance |
|
57 */ |
|
58 static CSIPProfileItem* NewL(); |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 * @return new instance |
|
63 */ |
|
64 static CSIPProfileItem* NewLC(); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 ~CSIPProfileItem(); |
|
70 |
|
71 /** |
|
72 * Set profile id |
|
73 * @param aProfileId profile id |
|
74 */ |
|
75 void SetProfileId(TUint aProfileId); |
|
76 |
|
77 /** |
|
78 * Set proxy profile |
|
79 * @param aProfile profile accessed by application |
|
80 */ |
|
81 void SetProfile(CSIPProfile& aProfile); |
|
82 |
|
83 /** |
|
84 * Set concrete profile |
|
85 * @param aProfile profile to be cached |
|
86 */ |
|
87 void SetConcreteProfile(CSIPConcreteProfile* aProfile); |
|
88 |
|
89 /** |
|
90 * Get proxy profile |
|
91 * @return proxy profile accessed by application |
|
92 */ |
|
93 CSIPProfile* Profile() const; |
|
94 |
|
95 /** |
|
96 * Get concrete profile |
|
97 * @return concrete profile holding profile data |
|
98 */ |
|
99 const CSIPConcreteProfile& ConcreteProfile() const; |
|
100 |
|
101 /** |
|
102 * Get concrete profile |
|
103 * @return concrete profile holding profile data |
|
104 */ |
|
105 CSIPConcreteProfile& ConcreteProfile(); |
|
106 |
|
107 /** |
|
108 * Enables and disables profile |
|
109 * @param aEnabled, ETrue if enabled |
|
110 */ |
|
111 void SetEnabled(TBool aEnabled); |
|
112 |
|
113 /** |
|
114 * Check if enabled |
|
115 * @return ETrue if enabled |
|
116 */ |
|
117 TBool IsEnabled() const; |
|
118 |
|
119 /** |
|
120 * Increment concrete profile reference count |
|
121 * @param aProfile instance of proxy profile pointing concrete profile |
|
122 */ |
|
123 void IncrementReferenceCountL(CSIPProfile& aProfile); |
|
124 |
|
125 /** |
|
126 * Decrement concrete profile reference count |
|
127 * @param aProfile instance of proxy profile that is deleted |
|
128 */ |
|
129 void DecrementReferenceCount(CSIPProfile& aProfile); |
|
130 |
|
131 /** |
|
132 * Get count of proxy profiles pontinc concrete profile |
|
133 * @return count of proxy profiles |
|
134 */ |
|
135 TUint ReferenceCount() const; |
|
136 |
|
137 /** |
|
138 * Stores last occurred registration error |
|
139 * @param aStatus status indicating if error occurred |
|
140 * during registering (EURegistrationInProgress) |
|
141 * or deregistering (EUnregistrationInProgress) |
|
142 * @param aError occurred error code |
|
143 */ |
|
144 void ErrorOccurred(CSIPConcreteProfile::TStatus aStatus, TInt aError); |
|
145 |
|
146 /** |
|
147 * Compare two items |
|
148 * @return ETrue, if profile id equals |
|
149 */ |
|
150 static TBool Compare(const CSIPProfileItem& aItem, |
|
151 const CSIPProfileItem& aItem2); |
|
152 |
|
153 private: |
|
154 |
|
155 /** |
|
156 * Default constructor |
|
157 */ |
|
158 CSIPProfileItem(); |
|
159 |
|
160 /** |
|
161 * Symbian 2nd phase constructor |
|
162 */ |
|
163 void ConstructL(); |
|
164 |
|
165 private: |
|
166 TUint iProfileId; |
|
167 TBool iEnabled; |
|
168 |
|
169 CSIPConcreteProfile* iConcreteProfile; |
|
170 RPointerArray<CSIPProfile> iProfiles; |
|
171 }; |
|
172 |
|
173 #endif |