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: Openchats |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIMCVENGINEOPENCHATS_H |
|
20 #define CIMCVENGINEOPENCHATS_H |
|
21 |
|
22 //includes |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 #include "mimcvengineopenchats.h" |
|
28 #include "mimcvenginenewmsgobserver.h" |
|
29 #include "mimcvenginechatlistobserver.h" |
|
30 |
|
31 |
|
32 //forward declarations |
|
33 class CCAConversationItemPC; |
|
34 class CIMCVEngineMessageHandler; |
|
35 class MIMCVEngineChatInterface; |
|
36 class MIMCVEngineMessageReadInterface; |
|
37 |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CIMCVEngineOpenChats |
|
43 * |
|
44 * @lib imcvuiengine.dll |
|
45 * @since 5.0 |
|
46 */ |
|
47 class CIMCVEngineOpenChats : public CBase, |
|
48 public MIMCVEngineOpenChats, |
|
49 public MIMCVEngineNewMsgObserver, |
|
50 public MIMCVEngineChatListObserver |
|
51 |
|
52 { |
|
53 |
|
54 public: // From MIMCVEngineOpenChats |
|
55 |
|
56 /** |
|
57 * @see MIMCVEngineOpenChats |
|
58 */ |
|
59 TPtrC GetDisplayNameL(TInt aIndex) const; |
|
60 |
|
61 |
|
62 /** |
|
63 * @see MIMCVEngineOpenChats |
|
64 */ |
|
65 const TDesC& GetTargetIdL(TInt aIndex) const; |
|
66 |
|
67 |
|
68 /** |
|
69 * @see MIMCVEngineOpenChats |
|
70 */ |
|
71 TInt Count() const; |
|
72 |
|
73 /** |
|
74 * @see MIMCVEngineOpenChats |
|
75 */ |
|
76 void SetActiveItemL( const TInt aIndex ); |
|
77 |
|
78 /** |
|
79 * @see MIMCVEngineOpenChats |
|
80 */ |
|
81 const TDesC& GetActiveItem() const; |
|
82 |
|
83 /** |
|
84 * @see MIMCVEngineOpenChats |
|
85 */ |
|
86 TBool IsMsgPendingL( const TInt aIndex ) const; |
|
87 |
|
88 /** |
|
89 * @see MIMCVEngineOpenChats |
|
90 */ |
|
91 TInt FindIndexL(const TDesC& aItem); |
|
92 |
|
93 /** |
|
94 * @see MIMCVEngineOpenChats |
|
95 */ |
|
96 void RegisterObserver(MIMCVEngineOpenChatsObserver* aChatObserver); |
|
97 |
|
98 |
|
99 /** |
|
100 * @see MIMCVEngineOpenChats |
|
101 */ |
|
102 void UnRegisterObserver(); |
|
103 |
|
104 void ResetL(); |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * Inserts the chat container into the Conversations List |
|
110 * @param aContainerInfo - Conversation/Chat Container Info |
|
111 */ |
|
112 void Insert( MIMCVEngineMessageReadInterface* aContainerInfo ); |
|
113 |
|
114 /** |
|
115 * Delets the chat container from the Conversations List |
|
116 * @param aContainerInfo - Conversation/Chat Container Info |
|
117 */ |
|
118 void RemoveL( MIMCVEngineMessageReadInterface& aContainerInfo ); |
|
119 |
|
120 |
|
121 private: |
|
122 |
|
123 /** |
|
124 * @see MIMCVEngineChatListObserver |
|
125 */ |
|
126 void HandleChatListEvent( TInt aServiceId , TChatListEventType aEvent, |
|
127 MIMCVEngineMessageReadInterface* aContainerInfo |
|
128 ) ; |
|
129 |
|
130 public: |
|
131 |
|
132 /** |
|
133 * NewL - returns the instance to CIMCVEngineOpenChats |
|
134 */ |
|
135 static CIMCVEngineOpenChats* NewL(CIMCVEngineMessageHandler& aMessageHandler, |
|
136 MIMCVEngineChatInterface& aChatInterface, |
|
137 TInt aServiceId ); |
|
138 |
|
139 |
|
140 /** |
|
141 * Destructor |
|
142 */ |
|
143 virtual ~CIMCVEngineOpenChats(); |
|
144 |
|
145 |
|
146 private: |
|
147 /** |
|
148 * @see MIMCVEngineNewMsgObserver |
|
149 */ |
|
150 void HandleChatEventL( TChatEventType aEvent, MIMCVEngineMessage* aMessage = NULL ) ; |
|
151 |
|
152 private: //Two phased ctor |
|
153 |
|
154 /** |
|
155 *CIMCVEngineOpenChats - ctor |
|
156 */ |
|
157 CIMCVEngineOpenChats(CIMCVEngineMessageHandler& aMessageHandler, |
|
158 MIMCVEngineChatInterface& aChatInterface); |
|
159 |
|
160 |
|
161 /** |
|
162 *ConstructL |
|
163 */ |
|
164 void ConstructL( TInt aServiceId ); |
|
165 |
|
166 private: //Data |
|
167 |
|
168 //Doesn't own |
|
169 RPointerArray <MIMCVEngineMessageReadInterface> iOpenChatsArray; |
|
170 |
|
171 //holds the index of the active tab item |
|
172 TInt iActiveItem; |
|
173 |
|
174 CIMCVEngineMessageHandler& iMessageHandler; |
|
175 |
|
176 //Doesnt Own |
|
177 MIMCVEngineOpenChatsObserver* iChatObserver; |
|
178 |
|
179 //Doesnt Own- Chat Interface |
|
180 MIMCVEngineChatInterface& iChatInterface; |
|
181 |
|
182 }; |
|
183 |
|
184 #endif // CIMCVENGINEOPENCHATS_H |
|
185 |
|
186 // End of File |
|