|
1 /* |
|
2 * Copyright (c) 2007-2008 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: FreestyleEmailUi message details model and model item |
|
15 * classes definitions |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __FREESTYLEEMAILUI_MESSAGEDETAILSMODEL_H__ |
|
22 #define __FREESTYLEEMAILUI_MESSAGEDETAILSMODEL_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 //<cmail> |
|
27 #include "fstreelistconstants.h" |
|
28 //</cmail> |
|
29 |
|
30 class CFSMailAddress; |
|
31 |
|
32 // LIST ITEM MODEL DEFINITION |
|
33 class CFSEmailUiMsgDetailsItem : public CBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** Two-phased constructor */ |
|
38 static CFSEmailUiMsgDetailsItem* NewLC( TFsTreeItemId aListId ); |
|
39 |
|
40 /** Destructor. */ |
|
41 ~CFSEmailUiMsgDetailsItem(); |
|
42 |
|
43 private: |
|
44 |
|
45 CFSEmailUiMsgDetailsItem( TFsTreeItemId aListId ); |
|
46 |
|
47 public: |
|
48 TFsTreeItemId iListId; |
|
49 |
|
50 // Not owned |
|
51 CFSMailAddress* iMailAddress; |
|
52 |
|
53 // Not owned |
|
54 TDesC* iText; |
|
55 }; |
|
56 |
|
57 /** |
|
58 * An interface for a message details model. |
|
59 */ |
|
60 class CFSEmailUiMsgDetailsModel : public CBase |
|
61 { |
|
62 public: |
|
63 /** |
|
64 * Constructor. |
|
65 */ |
|
66 CFSEmailUiMsgDetailsModel(); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 ~CFSEmailUiMsgDetailsModel(); |
|
72 |
|
73 /** |
|
74 * Add an item to the end of the list. |
|
75 */ |
|
76 void AppendL( TFsTreeItemId aListId, CFSMailAddress* aMailAddress ); |
|
77 |
|
78 /** |
|
79 * Add an item to the end of the list. |
|
80 */ |
|
81 void AppendL( TFsTreeItemId aListId, TDesC* aText ); |
|
82 |
|
83 /** |
|
84 * Remove item by list item id. |
|
85 */ |
|
86 void Remove(TFsTreeItemId aListId); |
|
87 |
|
88 /** |
|
89 * Remove all items. |
|
90 */ |
|
91 void RemoveAll(); |
|
92 |
|
93 /** |
|
94 * Get an item by list item id. |
|
95 * |
|
96 * @return Model item or NULL if not found. Ownership not transferred. |
|
97 */ |
|
98 CFSEmailUiMsgDetailsItem* ItemByListId( TFsTreeItemId aListId ) const; |
|
99 |
|
100 /** |
|
101 * Get an item by list index. |
|
102 * |
|
103 * @return Model item or NULL if not found. Ownership not trnasferred. |
|
104 */ |
|
105 CFSEmailUiMsgDetailsItem* ItemByIndex( TInt aModelIndex ) const; |
|
106 |
|
107 /** |
|
108 * Get number of items in list. |
|
109 * |
|
110 * @return Number of items. |
|
111 */ |
|
112 TInt Count() const; |
|
113 |
|
114 private: |
|
115 /** |
|
116 * Get the array index of the spcified item. |
|
117 * |
|
118 * @return Array index of the item. |
|
119 */ |
|
120 TInt Index( TFsTreeItemId aListId ) const; |
|
121 |
|
122 private: |
|
123 RPointerArray<CFSEmailUiMsgDetailsItem> iItemArray; |
|
124 |
|
125 }; |
|
126 |
|
127 #endif //__FREESTYLEEMAILUI_MESSAGEDETAILSMODEL_H__ |