|
1 /* |
|
2 * Copyright (c) 2008-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 : SipProfileAgentConfigRetriever.h |
|
16 * Part of : SIP / SIP Profile Server |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef SIPPROFILEAGENTCONFIGRETRIEVER_H_ |
|
23 #define SIPPROFILEAGENTCONFIGRETRIEVER_H_ |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include "sipprofiletypeinfo.h" |
|
28 #include <sipprofileagentextensionparams.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CRepository; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 *@internalComponent |
|
37 */ |
|
38 |
|
39 /** |
|
40 * This class reads configuration extension values from Central Repository, |
|
41 * and listens for their change in central repository. |
|
42 */ |
|
43 class CSipProfileAgentConfigRetriever : public CActive |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Creates a CSipProfileAgentConfigRetriever object. |
|
49 * |
|
50 * @return value New CSipProfileAgentConfigRetriever object, ownership is transferred. |
|
51 */ |
|
52 static CSipProfileAgentConfigRetriever* NewL(); |
|
53 |
|
54 ~CSipProfileAgentConfigRetriever(); |
|
55 |
|
56 public: // From CActive |
|
57 |
|
58 void DoCancel(); |
|
59 |
|
60 void RunL(); |
|
61 |
|
62 TInt RunError(TInt aError); |
|
63 |
|
64 public: //New functions |
|
65 /** |
|
66 * Returns the expiry value based on the profile type. |
|
67 */ |
|
68 TUint ExpiryValueL(TSIPProfileTypeInfo::TSIPProfileClass aClass, |
|
69 CSipProfileAgentConfigExtension::TProfileProperty aProperty); |
|
70 |
|
71 private: // New functions, for internal use |
|
72 |
|
73 CSipProfileAgentConfigRetriever(); |
|
74 |
|
75 void ConstructL(); |
|
76 |
|
77 /** |
|
78 * Reads the timer values from repository. If they are not found, function |
|
79 * leaves. |
|
80 */ |
|
81 void ReadValuesL(); |
|
82 |
|
83 /** |
|
84 * Listens for notifcations from central repository |
|
85 * leaves. |
|
86 */ |
|
87 void ListenForChangesL(); |
|
88 |
|
89 private: // Data |
|
90 |
|
91 // Provides access to Central Repository, owned. |
|
92 CRepository* iRepository; |
|
93 |
|
94 // Stores the keys for specific property againt a specific profile type |
|
95 TUint32 iProfilePropertyKeys[TSIPProfileTypeInfo::EMaxSIPProfileClass][CSipProfileAgentConfigExtension::EMaxProfileProperty]; |
|
96 |
|
97 // Stores the Default registation duration specific to a profile type |
|
98 TUint32 iDefaultRegistrationValue[TSIPProfileTypeInfo::EMaxSIPProfileClass]; |
|
99 |
|
100 // Stores the Default subscription duration specific to a profile type |
|
101 TUint32 iDefaultSubscriptionValue[TSIPProfileTypeInfo::EMaxSIPProfileClass]; |
|
102 |
|
103 private: // For testing purposes |
|
104 #ifdef CPPUNIT_TEST |
|
105 friend class CSipProfileAgentConfigRetriever_Test; |
|
106 #endif |
|
107 |
|
108 }; |
|
109 |
|
110 #endif /*SIPPROFILEAGENTCONFIGRETRIEVER_H_*/ |
|
111 // End of File |