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: uscontextobserver.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef USCONTEXTOBSERVER_H__ |
|
20 #define USCONTEXTOBSERVER_H__ |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <ximpcontextobserver.h> |
|
26 |
|
27 _LIT( KAddContactFileName, "c:\\add_contact.txt" ); |
|
28 |
|
29 // CLASS DESCRIPTION |
|
30 |
|
31 /** |
|
32 * Presence context observer for usage scenario tests. |
|
33 */ |
|
34 |
|
35 class CUSContextObserver : public CBase, |
|
36 public MXIMPContextObserver |
|
37 { |
|
38 |
|
39 public: |
|
40 static CUSContextObserver* CUSContextObserver::NewLC(); |
|
41 ~CUSContextObserver(); |
|
42 |
|
43 private: |
|
44 CUSContextObserver(); |
|
45 |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Method to wait with CActiveSchedulerWait |
|
51 * the given request completion. If request |
|
52 * is completed with error, leaves with failure code. |
|
53 * |
|
54 * NOTE! Only one request can be waited at time. |
|
55 * |
|
56 * @param aReqToWait The request to wait. |
|
57 */ |
|
58 void WaitOpToCompleteL ( const TXIMPRequestId& aReqToWait ); |
|
59 |
|
60 |
|
61 |
|
62 private: //From MXIMPContextObserver |
|
63 |
|
64 void HandlePresenceContextEvent ( const MXIMPContext& aContext, |
|
65 const MXIMPBase& aEvent ); |
|
66 |
|
67 |
|
68 private: //Data |
|
69 |
|
70 //OWN: Active scheduler wait for waiting the completion |
|
71 CActiveSchedulerWait iWait; |
|
72 |
|
73 //OWN: Request ID identifying request to wait |
|
74 TXIMPRequestId iReqToWait; |
|
75 |
|
76 //OWN: Result code from waited request |
|
77 TInt iReqResult; |
|
78 TBuf<50> gid[10]; |
|
79 TInt gidcount; |
|
80 |
|
81 }; |
|
82 |
|
83 |
|
84 |
|
85 #endif //USCONTEXTOBSERVER_H__ |
|
86 |
|
87 |
|