|
1 /* |
|
2 * Copyright (c) 2005 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: Tools for handling presence attribute models in arrays. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PENGATTRMODELHELPER_H__ |
|
19 #define PENGATTRMODELHELPER_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATION |
|
26 class MPEngPresenceAttrModel2; |
|
27 |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Tools for handling presence attribute models in arrays. |
|
34 * |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS( PEngAttrModelHelper ) |
|
38 { |
|
39 public: //Attribute model handling |
|
40 |
|
41 |
|
42 /** |
|
43 * Adds the given model to destination array. |
|
44 * If destination array has already a model with |
|
45 * same type and presence id, delets the original one |
|
46 * replaces the original one with given one. |
|
47 * |
|
48 * @since 3.0 |
|
49 * @param aModels The model array where to add the given model. |
|
50 * @param aModels The model to add. |
|
51 */ |
|
52 static void AddOrReplaceModelL( RPointerArray< MPEngPresenceAttrModel2 >& aModels, |
|
53 MPEngPresenceAttrModel2& aModel ); |
|
54 |
|
55 |
|
56 /** |
|
57 * Moves models from given source array to |
|
58 * destination array. |
|
59 * |
|
60 * @since 3.0 |
|
61 * @param aFrom The model array where from to move models. |
|
62 * @param aTo The destination array to move. |
|
63 */ |
|
64 static void MoveModelsL( RPointerArray< MPEngPresenceAttrModel2 >& aFrom, |
|
65 RPointerArray< MPEngPresenceAttrModel2 >& aTo ); |
|
66 |
|
67 |
|
68 /** |
|
69 * Checks that the given model array doesn't contain |
|
70 * duplicate attribute types. If it contains, returns ETrue. |
|
71 * Else returns EFalse. |
|
72 * |
|
73 * @since 3.0 |
|
74 * @param aModels The model array to check. |
|
75 * @retrun ETrue if model array contains duplicates. |
|
76 * Else EFalse. |
|
77 */ |
|
78 static TBool HasDuplicateTypes( |
|
79 RPointerArray< MPEngPresenceAttrModel2 >& aModels ); |
|
80 |
|
81 |
|
82 |
|
83 private: //Prohibited constructor and destructor |
|
84 |
|
85 PEngAttrModelHelper(); |
|
86 ~PEngAttrModelHelper(); |
|
87 }; |
|
88 |
|
89 #endif // PENGATTRMODELHELPER_H__ |
|
90 |
|
91 |
|
92 |
|
93 // End of File |
|
94 |