|
1 /* |
|
2 * Copyright (c) 2004 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: Interface for Instant Messaging services |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef OPENAPI_IMSTATUS_H |
|
20 #define OPENAPI_IMSTATUS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <ecom/ECom.h> |
|
25 #include <badesca.h> |
|
26 #include <cntdef.h> |
|
27 |
|
28 // DATA TYPES |
|
29 // IM Status attribute |
|
30 enum TIMAttribute |
|
31 { |
|
32 EIMOnline = 0, |
|
33 EIMOffline, |
|
34 EIMAvailable, |
|
35 EIMNotAvailable, |
|
36 EIMDiscreet |
|
37 }; |
|
38 |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class MImStatusObserver; |
|
42 class MImStatusList; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 class MImStatusFetcher |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 virtual ~MImStatusFetcher() {} |
|
51 |
|
52 /** |
|
53 * Method for registering the IM Status Fetcher to the WV Engine. |
|
54 * This method is asynchronous method and it will signal its |
|
55 * completion using the HandleRegisterL function. |
|
56 * @since S60 2.6 |
|
57 * @param aObserver observer object used for notifying the user |
|
58 * software |
|
59 * @return Status codes (to be defined) |
|
60 */ |
|
61 virtual TInt RegisterObserverL( |
|
62 MImStatusObserver* aObserver ) = 0; |
|
63 |
|
64 /** |
|
65 * Method for unregistering the IM StatusFetcher from the WV Engine. |
|
66 * This method is synchronous method. |
|
67 * @since S60 2.6 |
|
68 * @return Status codes (to be defined) |
|
69 */ |
|
70 virtual TInt UnregisterObserverL( ) = 0; |
|
71 |
|
72 /** |
|
73 * Method for getting the users' online status using Contact Model IDs. |
|
74 * This method is asynchronous and the results are obtained |
|
75 * in HandleGetOnlineStatusL() function. |
|
76 * @since S60 2.6 |
|
77 * @param aContactIds array of contact model IDs |
|
78 * @return positive number is operation code. Negative numbers are |
|
79 * status codes (to be defined) |
|
80 */ |
|
81 virtual TInt GetOnlineStatusL( |
|
82 const CContactIdArray& aContactIds ) = 0; |
|
83 |
|
84 /** |
|
85 * Method for getting the users' online status using User IDs. |
|
86 * This method is asynchronous and the results are obtained |
|
87 * in HandleGetOnlineStatusL() function. |
|
88 * @since S60 2.6 |
|
89 * @param aUserIds array of user IDs |
|
90 * @return positive number is operation code. Negative numbers are |
|
91 * status codes (to be defined) |
|
92 */ |
|
93 virtual TInt GetOnlineStatusL( |
|
94 const CDesCArray& aUserIds ) = 0; |
|
95 |
|
96 |
|
97 }; |
|
98 |
|
99 |
|
100 // CLASS DECLARATION |
|
101 /** |
|
102 * MImStatusObserver |
|
103 * |
|
104 * Abstract interface for handling the notify events from the API. |
|
105 * User derives his class from this and implements the observer methods below. |
|
106 */ |
|
107 class MImStatusObserver |
|
108 { |
|
109 public: |
|
110 |
|
111 /** |
|
112 * Method for getting the users' online status. |
|
113 * @since S60 2.6 |
|
114 * @param aOpCode operatin code (see also the GetOnlineStatusL() method) |
|
115 * @param aErrorCode error codes (to be defined) |
|
116 * @param aStatusData the Online statuses of the requested users. |
|
117 * The user takes the ownership of the object! |
|
118 */ |
|
119 virtual void HandleGetOnlineStatusL( |
|
120 const TInt aOpCode, |
|
121 const TInt aErrorCode, |
|
122 MImStatusList* aStatusList ) = 0; |
|
123 }; |
|
124 |
|
125 |
|
126 |
|
127 // CLASS DECLARATION |
|
128 /** |
|
129 * MImStatusList |
|
130 * |
|
131 * Abstract interface for reading out the results of the satus fetching |
|
132 * This interface is returned in the HandleGetOnlineStatusL() method. |
|
133 */ |
|
134 class MImStatusList |
|
135 { |
|
136 public: |
|
137 /** |
|
138 * Method for getting the number of the returned statuses |
|
139 * @since S60 2.6 |
|
140 * @return the number of the statuses |
|
141 */ |
|
142 virtual TInt Count() = 0; |
|
143 |
|
144 // virtual TContactItemId& OwnerContactIdL( TInt aIndex ) = 0; |
|
145 |
|
146 /** |
|
147 * Method for getting the status owner user ID |
|
148 * @since S60 2.6 |
|
149 * @param aIndex index of the IM status |
|
150 * @return the owner user ID |
|
151 */ |
|
152 virtual TPtrC OwnerUserIdL( TInt aIndex ) = 0; |
|
153 |
|
154 /** |
|
155 * Method for getting the status value |
|
156 * @since S60 2.6 |
|
157 * @param aIndex index of the IM status |
|
158 * @return the value of the IM status |
|
159 */ |
|
160 virtual TIMAttribute IMStatusL( TInt aIndex ) = 0; |
|
161 }; |
|
162 |
|
163 |
|
164 #endif |
|
165 // End of File |