|
1 /* |
|
2 * Copyright (c) 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: a message class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIMIMCACHEMESSAGEBASE_H |
|
20 #define CIMIMCACHEMESSAGEBASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <badesca.h> |
|
24 #include <imcachedefs.h> |
|
25 |
|
26 // FORWARD CLASS DECLERATIONS |
|
27 // CLASS DECLARATION |
|
28 // Definitions |
|
29 |
|
30 /** |
|
31 * Message Base class |
|
32 */ |
|
33 class CIMCacheMessageBase : public CBase |
|
34 { |
|
35 |
|
36 public: // Construction |
|
37 |
|
38 |
|
39 /** |
|
40 * Construction |
|
41 * @param aData, text message |
|
42 * @return Pointer to new created instance of CIMCacheMessageBase |
|
43 */ |
|
44 static CIMCacheMessageBase* NewL( |
|
45 const TDesC& aData ); |
|
46 |
|
47 |
|
48 /** |
|
49 * Destruction |
|
50 */ |
|
51 ~CIMCacheMessageBase(); |
|
52 |
|
53 private : // Construction |
|
54 |
|
55 /** |
|
56 * Constructor |
|
57 */ |
|
58 CIMCacheMessageBase(); |
|
59 |
|
60 /** |
|
61 * Remember to call this one as last line of child ConstructL |
|
62 * @param aSender, data |
|
63 */ |
|
64 void ConstructL( const TDesC& aData ); |
|
65 |
|
66 |
|
67 public: |
|
68 /** |
|
69 * @see TimeStamp |
|
70 * @return a time stamp |
|
71 */ |
|
72 const TTime& TimeStamp() const; |
|
73 |
|
74 /** |
|
75 * @see MessageType |
|
76 * @return a message type |
|
77 */ |
|
78 TIMCacheMessageType MessageType() const; |
|
79 |
|
80 /** |
|
81 * @see MessagerType |
|
82 * @return a messager type |
|
83 */ |
|
84 TIMCacheMessagerType MessagerType() const; |
|
85 |
|
86 |
|
87 /** |
|
88 * @see Text |
|
89 * @return text message |
|
90 */ |
|
91 const TDesC& Text() const; |
|
92 |
|
93 |
|
94 /** |
|
95 * @see ContentType |
|
96 * @return type of content |
|
97 */ |
|
98 TIMCacheContentType ContentType() const; |
|
99 |
|
100 |
|
101 /** |
|
102 * Set message type |
|
103 * @param aNewType New message type. |
|
104 */ |
|
105 void SetMessageType( TIMCacheMessageType aNewType ); |
|
106 |
|
107 /** |
|
108 * Set messager type |
|
109 * @param aNewType New messager type. |
|
110 */ |
|
111 void SetMessagerType( TIMCacheMessagerType aNewType ); |
|
112 |
|
113 /** |
|
114 * Set messager read |
|
115 */ |
|
116 void SetRead() ; |
|
117 |
|
118 /** |
|
119 * IsUnread |
|
120 * @return ETrue if messgae is unread. |
|
121 */ |
|
122 TBool IsUnread() const ; |
|
123 |
|
124 |
|
125 protected: // Member variables |
|
126 |
|
127 /// Type of message |
|
128 TIMCacheMessageType iMessageType; |
|
129 // messager type |
|
130 TIMCacheMessagerType iMessagerType; |
|
131 |
|
132 /// Timestamp. |
|
133 TTime iTime; |
|
134 /// Owns. Textual content. |
|
135 HBufC* iText; |
|
136 |
|
137 // owned, message is unread |
|
138 TBool iUnread; |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // CIMIMCACHEMESSAGEBASE_H |
|
143 |
|
144 // End of File |