|
51
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2006 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: XIMP Framework XIMPTestEventFactory
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
#ifndef PRFWTESTEVENTFACTORY_H__
|
|
|
20 |
#define PRFWTESTEVENTFACTORY_H__
|
|
|
21 |
|
|
|
22 |
#include <e32base.h>
|
|
|
23 |
#include <ximpdatasubscriptionstate.h>
|
|
|
24 |
|
|
|
25 |
// CLASS DESCRIPTION
|
|
|
26 |
|
|
|
27 |
class CPresentityGroupListEventImp;
|
|
|
28 |
class CPresentityGroupContentEventImp;
|
|
|
29 |
class CXIMPDataSubscriptionStateImp;
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Presence event factory for use in tests.
|
|
|
33 |
*/
|
|
|
34 |
class XIMPTestEventFactory
|
|
|
35 |
{
|
|
|
36 |
public:
|
|
|
37 |
|
|
|
38 |
// @see below
|
|
|
39 |
enum TTestPGLArraySpecifier
|
|
|
40 |
{
|
|
|
41 |
ETestPGLCreated = 0, // group info is created
|
|
|
42 |
ETestPGLUpdated, // group info is updated
|
|
|
43 |
ETestPGLDeleted, // group info is deleted
|
|
|
44 |
ETestPGLEmpty, // make an empty array for empty event
|
|
|
45 |
};
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
* Places an identity (uri-displayname pair) inside a group info into the
|
|
|
49 |
* array defined by aArraySpec, and returns the created event.
|
|
|
50 |
*
|
|
|
51 |
* In cleanupstack there are 5 items, FIFO:
|
|
|
52 |
* - created list
|
|
|
53 |
* - updated list
|
|
|
54 |
* - deleted list
|
|
|
55 |
* - current list
|
|
|
56 |
* - event imp
|
|
|
57 |
*
|
|
|
58 |
* This is because this event won't take ownership to the arrays
|
|
|
59 |
* when created this way.
|
|
|
60 |
*
|
|
|
61 |
* @param aUri URI of group
|
|
|
62 |
* @param aDispName Displayname
|
|
|
63 |
* @param aArraySpec Defines into which array to put the group info
|
|
|
64 |
* @param aUriCurrent The URI of group in "current"-list
|
|
|
65 |
* @param aDispNameCurrent The display name of the group in
|
|
|
66 |
* "current"-list
|
|
|
67 |
* @param aStatus The subscription status
|
|
|
68 |
* @return The suitably filled event.
|
|
|
69 |
*/
|
|
|
70 |
IMPORT_C static CPresentityGroupListEventImp* CreateGroupListEventLCX(
|
|
|
71 |
const TDesC& aUri,
|
|
|
72 |
const TDesC& aDispName,
|
|
|
73 |
|
|
|
74 |
TTestPGLArraySpecifier aArraySpec,
|
|
|
75 |
|
|
|
76 |
const TDesC& aUriCurrent,
|
|
|
77 |
const TDesC& aDispNameCurrent,
|
|
|
78 |
|
|
|
79 |
MXIMPDataSubscriptionState::TSubscriptionState aSubscriptionState,
|
|
|
80 |
MXIMPDataSubscriptionState::TDataState aDataState
|
|
|
81 |
);
|
|
|
82 |
|
|
|
83 |
// @see below
|
|
|
84 |
enum TTestPGLContentArraySpecifier
|
|
|
85 |
{
|
|
|
86 |
ETestPGLCntAdded = 0, // group content is added
|
|
|
87 |
ETestPGLCntUpdated, // group content is updated
|
|
|
88 |
ETestPGLCntRemoved, // group content is deleted
|
|
|
89 |
ETestPGLCntEmpty, // make an empty array for empty event
|
|
|
90 |
};
|
|
|
91 |
|
|
|
92 |
/**
|
|
|
93 |
* Places an group member (identity-displayname pair) inside
|
|
|
94 |
* a group content info into the delta array defined by aArraySpec,
|
|
|
95 |
* and returns the created event.
|
|
|
96 |
*
|
|
|
97 |
* The current member list will contain only the group member
|
|
|
98 |
* specified by parameters aIdentityCurrent and aDispNameCurrent.
|
|
|
99 |
* To support more members than 1 this method needs to be changed,
|
|
|
100 |
* but for now, it suffices for our testing.
|
|
|
101 |
*
|
|
|
102 |
* In cleanupstack there are 5 items, FIFO:
|
|
|
103 |
* - added list
|
|
|
104 |
* - updated list
|
|
|
105 |
* - removed list
|
|
|
106 |
* - current member list
|
|
|
107 |
* - event imp
|
|
|
108 |
*
|
|
|
109 |
* This is because this event won't take ownership to the arrays
|
|
|
110 |
* when created this way.
|
|
|
111 |
*
|
|
|
112 |
* @param aGroupId The group id
|
|
|
113 |
* @param aUri Uri
|
|
|
114 |
* @param aDispName Displayname
|
|
|
115 |
* @param aArraySpec Defines into which delta array to put the member
|
|
|
116 |
* @param aIdentityCurrent Identity part of current member
|
|
|
117 |
* @param aDispNameCurrent Display name part of current member
|
|
|
118 |
* @param aStatus The subscription status
|
|
|
119 |
* @return The suitably filled event.
|
|
|
120 |
*/
|
|
|
121 |
IMPORT_C static CPresentityGroupContentEventImp*
|
|
|
122 |
CreateGroupContentEventLCX(
|
|
|
123 |
const TDesC& aGroupId,
|
|
|
124 |
|
|
|
125 |
const TDesC& aIdentityForDelta,
|
|
|
126 |
const TDesC& aDispNameForDelta,
|
|
|
127 |
|
|
|
128 |
TTestPGLContentArraySpecifier aArraySpec,
|
|
|
129 |
|
|
|
130 |
const TDesC& aIdentityCurrent,
|
|
|
131 |
const TDesC& aDispNameCurrent,
|
|
|
132 |
|
|
|
133 |
MXIMPDataSubscriptionState::TSubscriptionState aSubscriptionState,
|
|
|
134 |
MXIMPDataSubscriptionState::TDataState aDataState
|
|
|
135 |
);
|
|
|
136 |
};
|
|
|
137 |
|
|
|
138 |
#endif //PRFWTESTEVENTFACTORY_H__
|
|
|
139 |
|
|
|
140 |
|