author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:28:47 +0100 | |
branch | RCL_3 |
changeset 45 | a9c0808a1095 |
parent 10 | fc9cf246af83 |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2007 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 the License "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: View observer for getlist Service API of contactservice. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
#ifndef C_CONTACTVIEWOBSERVER_H |
|
22 |
#define C_CONTACTVIEWOBSERVER_H |
|
23 |
||
24 |
||
25 |
#include <MVPbkContactViewObserver.h> |
|
26 |
#include <MVPbkContactLinkArray.h> |
|
27 |
#include "contactretrieveobserver.h" |
|
28 |
||
29 |
class CContactService; |
|
30 |
||
31 |
/** |
|
32 |
* View Flag is required so as to differentiate the callbacks, |
|
33 |
* since the callback is called twice. |
|
34 |
*/ |
|
35 |
enum TViewFlag |
|
36 |
{ |
|
37 |
EContactDefaultView=0, |
|
38 |
EContactFilteredView |
|
39 |
}; |
|
40 |
||
41 |
/** |
|
42 |
* This class has methods for handling events after the view on a database is set. |
|
43 |
*/ |
|
44 |
||
45 |
class CContactViewObserver:public CBase, |
|
46 |
public MVPbkContactViewObserver, |
|
47 |
public MCancelAsync |
|
48 |
{ |
|
49 |
public: |
|
50 |
static CContactViewObserver* NewL(MContactCallback* aCallback, |
|
51 |
enum TViewFlag aFlag, |
|
52 |
CContactIter* iIter, |
|
53 |
CContactService* aContactService, |
|
54 |
const TDesC& aStoreUri, |
|
55 |
TOrder aSortOrder, |
|
56 |
TInt aTransId, |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
57 |
CActiveSchedulerWait* aSchedulerWait, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
58 |
TCmdType val); |
5 | 59 |
|
60 |
||
61 |
||
62 |
/** |
|
63 |
* Methods to handle Contact Database View Setup events |
|
64 |
*/ |
|
65 |
void ContactViewReady( MVPbkContactViewBase& aView ); |
|
66 |
||
67 |
void ContactViewUnavailable( MVPbkContactViewBase& aView ) ; |
|
68 |
||
69 |
void ContactAddedToView(MVPbkContactViewBase& aView, |
|
70 |
TInt aIndex, |
|
71 |
const MVPbkContactLink& aContactLink ); |
|
72 |
||
73 |
void ContactRemovedFromView(MVPbkContactViewBase& aView, |
|
74 |
TInt aIndex, |
|
75 |
const MVPbkContactLink& aContactLink ); |
|
76 |
||
77 |
void ContactViewError(MVPbkContactViewBase& aView, |
|
78 |
TInt aError, |
|
79 |
TBool aErrorNotified ) ; |
|
80 |
||
81 |
CContactViewObserver( const TDesC& aStoreUri, |
|
82 |
enum TViewFlag aFlag, |
|
83 |
CContactIter* aIter, |
|
84 |
CContactService* aContactService, |
|
85 |
MContactCallback* aCallback, |
|
86 |
TOrder aSortOrder, |
|
87 |
TInt aTransId, |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
88 |
CActiveSchedulerWait* aSchedulerWait, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
89 |
TCmdType val = EGetList); |
5 | 90 |
|
91 |
void ReturnDefaultView(); |
|
92 |
||
93 |
/* |
|
94 |
* Implementation of Cancel of MCancelAsync |
|
95 |
*/ |
|
96 |
void Cancel(); |
|
97 |
||
98 |
private: |
|
99 |
||
100 |
/** |
|
101 |
*A method to setup the link array for the iterator to iterate over |
|
102 |
*/ |
|
103 |
void SetupContactLinkArrayL(MVPbkContactViewBase& aView ); |
|
104 |
||
105 |
private: |
|
106 |
//Store Uri |
|
107 |
const TDesC* iStoreUri; |
|
108 |
||
109 |
//Flag to determine the type of view |
|
110 |
TViewFlag iFlag; |
|
111 |
||
112 |
//Iterator - Output param |
|
113 |
CContactIter* iIter; |
|
114 |
||
115 |
//Callback Function |
|
116 |
MContactCallback* iCallback; |
|
117 |
||
118 |
//The order in which the result shud appear |
|
119 |
TOrder iSortOrder; |
|
120 |
||
121 |
//Transaction Id |
|
122 |
TInt iTransId; |
|
123 |
||
124 |
//To give default view of the database |
|
125 |
TBool iDefaultView; |
|
126 |
||
127 |
//For Stopping async calls |
|
128 |
CActiveSchedulerWait* iSchedulerWait; |
|
129 |
||
130 |
//View handle |
|
131 |
MVPbkContactViewBase* iView; |
|
132 |
||
133 |
//ContactService Handle |
|
134 |
CContactService* iContactService; |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
135 |
TCmdType iVal; |
5 | 136 |
|
137 |
}; |
|
138 |
||
139 |
#endif//C_CONTACTVIEWOBSERVER_H |