0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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:
|
|
15 |
* @file
|
|
16 |
* This contains BlockItems.h
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __BLOCK_ITEMS_H__
|
|
23 |
#define __BLOCK_ITEMS_H__
|
|
24 |
|
|
25 |
#include <e32base.h>
|
|
26 |
|
|
27 |
const TInt KTEFMaxNameLength = 255;
|
|
28 |
typedef TBuf<KTEFMaxNameLength> TTEFSectionName;
|
|
29 |
typedef TBuf<KTEFMaxNameLength> TTEFFunction;
|
|
30 |
typedef TBuf<KTEFMaxNameLength> TTEFObjectType;
|
|
31 |
|
|
32 |
enum TTEFBlockItemType
|
|
33 |
/**
|
|
34 |
* @internalComponent
|
|
35 |
* @test
|
|
36 |
*
|
|
37 |
* Types of block item
|
|
38 |
*
|
|
39 |
* ETEFNull
|
|
40 |
* - undefined type
|
|
41 |
*
|
|
42 |
* ETEFCreateObject
|
|
43 |
* - create an object
|
|
44 |
*
|
|
45 |
* ETEFRestoreObject
|
|
46 |
* - restore an object from the shared area
|
|
47 |
*
|
|
48 |
* ETEFCommand
|
|
49 |
* - execute a command on an object
|
|
50 |
*
|
|
51 |
* ETEFStore
|
|
52 |
* - store the object in shared area
|
|
53 |
*
|
|
54 |
* ETEFOutstanding
|
|
55 |
* - wait for all outstandign requests to complete
|
|
56 |
*
|
|
57 |
* ETEFDelay
|
|
58 |
* - delay all processing
|
|
59 |
*
|
|
60 |
* ETEFAsyncDelay
|
|
61 |
* - delay but keep asynchronus operations running during delay.
|
|
62 |
*
|
|
63 |
* ETEFSharedActiveScheduler
|
|
64 |
* - use active schedular from shared data
|
|
65 |
*
|
|
66 |
* ETEFStoreActiveScheduler
|
|
67 |
* - store active schedular in shared data
|
|
68 |
*/
|
|
69 |
{
|
|
70 |
ETEFNull = 0,
|
|
71 |
ETEFCreateObject,
|
|
72 |
ETEFRestoreObject,
|
|
73 |
ETEFCommand,
|
|
74 |
ETEFStore,
|
|
75 |
ETEFOutstanding,
|
|
76 |
ETEFDelay,
|
|
77 |
ETEFAsyncDelay,
|
|
78 |
ETEFSharedActiveScheduler,
|
|
79 |
ETEFStoreActiveScheduler
|
|
80 |
};
|
|
81 |
|
|
82 |
class TTEFCommand
|
|
83 |
/**
|
|
84 |
* @internalComponent
|
|
85 |
* @test
|
|
86 |
*/
|
|
87 |
{
|
|
88 |
public:
|
|
89 |
TTEFSectionName iObject;
|
|
90 |
TTEFFunction iFunction;
|
|
91 |
};
|
|
92 |
|
|
93 |
class TTEFBlockItem
|
|
94 |
/**
|
|
95 |
* @internalComponent
|
|
96 |
* @test
|
|
97 |
*/
|
|
98 |
{
|
|
99 |
public:
|
|
100 |
TTEFBlockItem()
|
|
101 |
: iItemType(ETEFNull)
|
|
102 |
, iExpectedError(0)
|
|
103 |
, iExpectedAsyncError(0)
|
|
104 |
, iError(0)
|
|
105 |
, iAsyncError(0)
|
|
106 |
, iTime(0)
|
|
107 |
, iExecuted(EFalse) {}
|
|
108 |
|
|
109 |
TTEFBlockItemType iItemType;
|
|
110 |
TTEFObjectType iObjectType;
|
|
111 |
TTEFCommand iCommand;
|
|
112 |
TTEFSectionName iSection;
|
|
113 |
TInt iExpectedError;
|
|
114 |
TInt iExpectedAsyncError;
|
|
115 |
TInt iError;
|
|
116 |
TInt iAsyncError;
|
|
117 |
TInt iTime;
|
|
118 |
TBool iExecuted;
|
|
119 |
};
|
|
120 |
|
|
121 |
/**
|
|
122 |
* @internalComponent
|
|
123 |
* @test
|
|
124 |
*/
|
|
125 |
typedef CArrayFixFlat<TTEFBlockItem> TTEFItemArray;
|
|
126 |
|
|
127 |
/**
|
|
128 |
* @internalComponent
|
|
129 |
* @test
|
|
130 |
*/
|
|
131 |
typedef TPckgBuf<TTEFBlockItem> TTEFItemPkgBuf;
|
|
132 |
|
|
133 |
class MSharedData
|
|
134 |
/**
|
|
135 |
* @internalComponent
|
|
136 |
* @test
|
|
137 |
*
|
|
138 |
* Access to the shared data
|
|
139 |
*/
|
|
140 |
{
|
|
141 |
public:
|
|
142 |
/*
|
|
143 |
* Create and active scheduler in the shared data
|
|
144 |
*
|
|
145 |
* @leave system wide error
|
|
146 |
*/
|
|
147 |
virtual void CreateActiveSchedulerL() =0;
|
|
148 |
|
|
149 |
/*
|
|
150 |
* Delete the active scheduler in the shared data
|
|
151 |
*
|
|
152 |
* @leave system wide error
|
|
153 |
*/
|
|
154 |
virtual void DeleteActiveSchedulerL() =0;
|
|
155 |
|
|
156 |
/*
|
|
157 |
* Get an object in the shared data and own it.
|
|
158 |
* As owner you will be resonsible for it's deletion.
|
|
159 |
*
|
|
160 |
* @param aName - name of object to own
|
|
161 |
*
|
|
162 |
* @return the obeject
|
|
163 |
*
|
|
164 |
* @leave system wide error
|
|
165 |
*/
|
|
166 |
virtual TAny* GetObjectAndOwnL(const TDesC& aName) =0;
|
|
167 |
|
|
168 |
/*
|
|
169 |
* Put an object in the shared data and disown it.
|
|
170 |
* The shared data becomes will be resonsible for it's deletion.
|
|
171 |
*
|
|
172 |
* @param aName - name of object to own
|
|
173 |
* @param aAny - the object
|
|
174 |
* @param aCleanupOperation - Operation to delete the object if still in shared data on exit
|
|
175 |
*
|
|
176 |
* @leave system wide error
|
|
177 |
*/
|
|
178 |
virtual void PutAndDisownL(const TDesC& aName, TAny* aAny, TCleanupOperation aCleanupOperation) =0;
|
|
179 |
};
|
|
180 |
|
|
181 |
#endif // __BLOCK_ITEMS_H__
|