|
1 /* |
|
2 * Copyright (c) 2007-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: Interface definition for MR policy resolver ECom interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMRPOLICYRESOURCEITERATOR_H |
|
20 #define CMRPOLICYRESOURCEITERATOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <barsc.h> |
|
24 |
|
25 class CESMRPolicy; |
|
26 |
|
27 /** |
|
28 * CMRPolicyResolver defines ECom plugin interface for policy resolving . |
|
29 * @see MESMRTaskFactory |
|
30 * |
|
31 * @lib esmrtasks.lib |
|
32 */ |
|
33 NONSHARABLE_CLASS( CMRPolicyResourceIterator ) : public CBase |
|
34 { |
|
35 public: // Construction and destruction |
|
36 /** |
|
37 * Creates and initialzes new ES MR task factory. |
|
38 * @param aCalDbMgr Reference to cal db manager. |
|
39 */ |
|
40 IMPORT_C static CMRPolicyResourceIterator* NewL( const TDesC& aResourceFile, |
|
41 TInt aResourceId ); |
|
42 |
|
43 /** |
|
44 * C++ destructor. |
|
45 */ |
|
46 IMPORT_C ~CMRPolicyResourceIterator(); |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Tests if iterator has more policies available. |
|
52 * |
|
53 * @return ETrue if iterator has policy |
|
54 */ |
|
55 IMPORT_C TBool HasNext() const; |
|
56 |
|
57 /** |
|
58 * Loads and instantiates next policy from resource. |
|
59 * Ownership of policy is transferred to caller. |
|
60 * |
|
61 * @return next policy |
|
62 */ |
|
63 IMPORT_C CESMRPolicy* NextPolicyL(); |
|
64 |
|
65 /** |
|
66 * Loads and instantiates next policy from resource. |
|
67 * Policy is left into CleanupStack. |
|
68 * |
|
69 * @return next policy |
|
70 */ |
|
71 IMPORT_C CESMRPolicy* NextPolicyLC(); |
|
72 |
|
73 /** |
|
74 * Resets iterator. |
|
75 */ |
|
76 IMPORT_C void Reset(); |
|
77 |
|
78 private: // Implementation |
|
79 |
|
80 CMRPolicyResourceIterator(); |
|
81 |
|
82 void ConstructL( |
|
83 const TDesC& aResourceFile, |
|
84 TInt aResourceId ); |
|
85 |
|
86 void ReadPolicyFromResourceL( |
|
87 const TDesC& aPolicyFile, |
|
88 TInt aPolicyArrayResourceId ); |
|
89 |
|
90 CESMRPolicy* ReadPolicyLC( TInt aResourceId ); |
|
91 |
|
92 private: // Data |
|
93 |
|
94 /** |
|
95 * Policy resource file. |
|
96 * Own. |
|
97 */ |
|
98 RResourceFile iPolicyResourceFile; |
|
99 |
|
100 /** |
|
101 * Array of policy resource ids |
|
102 * Own. |
|
103 */ |
|
104 RArray< TInt > iPolicyResourceIds; |
|
105 |
|
106 /** |
|
107 * Array index (iterator) |
|
108 */ |
|
109 TInt iArrayIndex; |
|
110 |
|
111 }; |
|
112 |
|
113 #endif // CMRPOLICYRESOURCEITERATOR_H |