author | Johnson Ma <johnson.ma@nokia.com> |
Tue, 30 Mar 2010 14:39:29 +0800 | |
changeset 1 | 96906a986c3b |
permissions | -rw-r--r-- |
1
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
1 |
// |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
2 |
// Interface.h |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
3 |
// Copyright © 1997-2001 Symbian Ltd. All rights reserved. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
4 |
// |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
5 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
6 |
#ifndef _CEXAMPLEINTERFACE__ |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
7 |
#define _CEXAMPLEINTERFACE__ |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
8 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
9 |
#include <e32base.h> |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
10 |
#include <ECom.h> |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
11 |
#include <badesca.h> |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
12 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
13 |
// UID of this interface |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
14 |
const TUid KCExampleInterfaceUid = {0x10009DC0}; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
15 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
16 |
/** |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
17 |
An example abstract class being representative of the |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
18 |
concrete class which the client wishes to use. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
19 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
20 |
It acts as a base, for a real class to provide all the |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
21 |
functionality that a client requires. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
22 |
It supplies instantiation & destruction by using |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
23 |
the ECom framework, and functional services |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
24 |
by using the methods of the actual class. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
25 |
*/ |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
26 |
class CExampleInterface : public CBase |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
27 |
{ |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
28 |
public: |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
29 |
// The interface for passing initialisation parameters |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
30 |
// to the derived class constructor. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
31 |
struct TExampleInterfaceInitParams |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
32 |
{ |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
33 |
TInt integer; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
34 |
const TDesC* descriptor; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
35 |
}; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
36 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
37 |
// Instantiates an object of this type |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
38 |
static CExampleInterface* NewL(); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
39 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
40 |
// Instantiates an object of this type |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
41 |
// using the aMatchString as the resolver parameters. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
42 |
static CExampleInterface* NewL(const TDesC8& aMatchString); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
43 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
44 |
// Instantiates an object of this type |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
45 |
// using the aMatchString as the resolver parameters |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
46 |
// and passing the aParams parameters |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
47 |
static CExampleInterface* NewL(const TDesC8& aMatchString, TExampleInterfaceInitParams& aParams); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
48 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
49 |
// Destructor. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
50 |
virtual ~CExampleInterface(); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
51 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
52 |
// Request a list of all available implementations which |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
53 |
// satisfy this given interface. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
54 |
static void ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
55 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
56 |
// Pure interface method |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
57 |
// Representative of a method provided on the interface by |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
58 |
// the interface definer. |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
59 |
virtual void DoMethodL(TDes& aString) = 0; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
60 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
61 |
protected: |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
62 |
//Default c'tor |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
63 |
inline CExampleInterface(); |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
64 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
65 |
private: |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
66 |
// Unique instance identifier key |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
67 |
TUid iDtor_ID_Key; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
68 |
}; |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
69 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
70 |
#include "Interface.inl" |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
71 |
|
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
72 |
#endif |
96906a986c3b
contribute ITE to symbian foundation
Johnson Ma <johnson.ma@nokia.com>
parents:
diff
changeset
|
73 |