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: Server Message interface.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef XIMPSRVMESSAGE_H
|
|
19 |
#define XIMPSRVMESSAGE_H
|
|
20 |
|
|
21 |
#include "ximppanics.h"
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Server Message interface.
|
|
27 |
*/
|
|
28 |
class MXIMPSrvMessage
|
|
29 |
{
|
|
30 |
public:
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Message argument indexes.
|
|
34 |
*/
|
|
35 |
enum TParamIndex
|
|
36 |
{
|
|
37 |
Ep0 = 0,
|
|
38 |
Ep1 = 1,
|
|
39 |
Ep2 = 2,
|
|
40 |
Ep3 = 3
|
|
41 |
};
|
|
42 |
|
|
43 |
public: // Methods
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Public destructor.
|
|
47 |
* Objects can be deleted through this interface.
|
|
48 |
*/
|
|
49 |
virtual ~MXIMPSrvMessage() {};
|
|
50 |
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Completes the client request with given reason.
|
|
54 |
*
|
|
55 |
* @param aReason The completion code.
|
|
56 |
*/
|
|
57 |
virtual void Complete( TInt aReason ) = 0;
|
|
58 |
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Tests whether this message is completed or not.
|
|
62 |
*
|
|
63 |
* @return ETrue if the message is completed.
|
|
64 |
* Else EFalse.
|
|
65 |
*/
|
|
66 |
virtual TBool IsCompleted() const = 0;
|
|
67 |
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Returns an integer describing the function being called.
|
|
71 |
*
|
|
72 |
* @return The function being called over IPC
|
|
73 |
*/
|
|
74 |
virtual TInt Function() const = 0;
|
|
75 |
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Gets message argument as an integer value.
|
|
79 |
*
|
|
80 |
* @param aIndex The index value identifying the argument.
|
|
81 |
* @return The message argument.
|
|
82 |
*/
|
|
83 |
virtual TInt Int( TParamIndex aIndex ) const = 0;
|
|
84 |
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Gets the length of a descriptor argument in the client's process,
|
|
88 |
* leaving on failure.
|
|
89 |
*
|
|
90 |
* @param aIndex The index value identifying the argument.
|
|
91 |
* @return The length of the descriptor.
|
|
92 |
*/
|
|
93 |
virtual TInt GetDesLengthL( TParamIndex aIndex ) const = 0;
|
|
94 |
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Reads data from the specified argument into the specified
|
|
98 |
* 8-bit target descriptor, and leaving on failure.
|
|
99 |
*
|
|
100 |
* @param aIndex The index value identifying the argument.
|
|
101 |
* @param aDes The target descriptor into which the client
|
|
102 |
* data is to be written.
|
|
103 |
*/
|
|
104 |
virtual void ReadL( TParamIndex aIndex, TDes8& aDes ) const = 0;
|
|
105 |
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Writes data from the specified source descriptor to the
|
|
109 |
* 8-bit descriptor argument, and leaving on failure.
|
|
110 |
*
|
|
111 |
* @param aIndex The index value identifying the argument.
|
|
112 |
* @param aDes The source descriptor containing the data to be written.
|
|
113 |
*/
|
|
114 |
virtual void WriteL( TParamIndex aIndex, const TDesC8& aDes ) const = 0;
|
|
115 |
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Panics the client.
|
|
119 |
*
|
|
120 |
* @param aReason The panic code.
|
|
121 |
*/
|
|
122 |
virtual void PanicClientAndLeaveL( NXIMPPanic::TReason aReason ) const = 0;
|
|
123 |
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Moves message ownership from previous pointer to new given one.
|
|
127 |
* (NULLifies existing pointer)
|
|
128 |
*
|
|
129 |
* @param aNewSelfPtr New self pointer where to assign object ownership.
|
|
130 |
* Only one place at time can own the message object.
|
|
131 |
*/
|
|
132 |
virtual void PlaceOwnershipHere( MXIMPSrvMessage*& aNewSelfPtr ) = 0;
|
|
133 |
};
|
|
134 |
|
|
135 |
|
|
136 |
#endif // XIMPSRVMESSAGE_H
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|