|
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: Array of attribute retrieval errors |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_GLXFETCHERROR_H |
|
22 #define C_GLXFETCHERROR_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "glxfetcherror.h" |
|
26 |
|
27 /** |
|
28 * CGlxFetchErrorArray |
|
29 * |
|
30 * Ordered array of attribute retrieval errors |
|
31 * @see TGlxFetchError |
|
32 * |
|
33 * @lib glxmedialists.lib |
|
34 */ |
|
35 NONSHARABLE_CLASS(CGlxFetchErrorArray) : public CBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Constructor |
|
40 */ |
|
41 CGlxFetchErrorArray(); |
|
42 |
|
43 /** |
|
44 * Two-phase copy constructor |
|
45 * @param aErrorArray The existing CGlxFetchErrorArray to copy |
|
46 */ |
|
47 static CGlxFetchErrorArray* NewL(const CGlxFetchErrorArray* aErrorArray); |
|
48 |
|
49 /** |
|
50 * Two-phase copy constructor |
|
51 * @param aErrorArray The existing CGlxFetchErrorArray to copy |
|
52 */ |
|
53 static CGlxFetchErrorArray* NewLC(const CGlxFetchErrorArray* aErrorArray); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~CGlxFetchErrorArray(); |
|
59 |
|
60 /** |
|
61 * Number of errors stored in array |
|
62 * @return Number of errors stored in array |
|
63 */ |
|
64 TInt ErrorCount() const; |
|
65 |
|
66 /** |
|
67 * The error at a particular index |
|
68 * @param aIndex The index for the error |
|
69 * @return The error |
|
70 */ |
|
71 TGlxFetchError Error(TInt aIndex) const; |
|
72 |
|
73 /** |
|
74 * Add an error to the array |
|
75 * @param aError Error to add |
|
76 */ |
|
77 void AddErrorL(TGlxFetchError aError); |
|
78 |
|
79 /** |
|
80 * Remove an error from the array |
|
81 * @param aIndex index of the error to remove |
|
82 */ |
|
83 void Remove( TInt aIndex ); |
|
84 |
|
85 /** |
|
86 * Find an error given the attribute |
|
87 * @param aAttr The attribute to look for |
|
88 * @return The error code, or KErrNone if none |
|
89 */ |
|
90 TInt FindError(TMPXAttribute aAttr) const; |
|
91 |
|
92 /** |
|
93 * Find an error given the content id |
|
94 * @param aContentId The content id to look for |
|
95 * @return The error code, or KErrNone if none |
|
96 */ |
|
97 TInt FindError(TInt aContentId) const; |
|
98 |
|
99 private: |
|
100 /** |
|
101 * Second-phase copy constructor |
|
102 * @param aErrorArray The existing CGlxFetchErrorArray to copy |
|
103 */ |
|
104 void CopyConstructL(const CGlxFetchErrorArray* aErrorArray); |
|
105 |
|
106 /** |
|
107 * Ordering function for array |
|
108 * @see TLinearOrder |
|
109 */ |
|
110 static TInt ErrorOrderByKey(const TMPXAttribute* aAttr, const TGlxFetchError& aItem2); |
|
111 |
|
112 /** |
|
113 * Ordering function for array |
|
114 * @see TLinearOrder |
|
115 */ |
|
116 static TInt ErrorOrderById(const TGlxFetchError& aItem1, const TGlxFetchError& aItem2); |
|
117 |
|
118 private: |
|
119 /// Ordered array of errors |
|
120 RArray<TGlxFetchError> iFetchErrors; |
|
121 }; |
|
122 |
|
123 #endif // C_GLXFETCHERROR_H |