|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #if !defined(__MSVOP_H__) |
|
17 #define __MSVOP_H__ |
|
18 |
|
19 #if !defined(__E32BASE_H__) |
|
20 #include <e32base.h> |
|
21 #endif |
|
22 |
|
23 #if !defined(__MSVSTD_H__) |
|
24 #include <msvstd.h> |
|
25 #endif |
|
26 |
|
27 // forward declarations |
|
28 class CBaseServerMtm; |
|
29 class CMsvMtmOperation; |
|
30 class TMsvSystemProgress; |
|
31 |
|
32 //********************************** |
|
33 // MMsvOperationObserver |
|
34 //********************************** |
|
35 // |
|
36 // |
|
37 // |
|
38 |
|
39 class MMsvOperationObserver |
|
40 /** |
|
41 @internalComponent |
|
42 @released |
|
43 */ |
|
44 { |
|
45 public: |
|
46 virtual void OperationCompleted(TMsvId aServiceId, TMsvOp aOpId)=0; |
|
47 virtual void OperationCancelled(const CMsvMtmOperation& aOperation)=0; |
|
48 }; |
|
49 |
|
50 |
|
51 //********************************** |
|
52 // CMsvServerOperation |
|
53 //********************************** |
|
54 // |
|
55 // Abstract base class for server side operations |
|
56 // |
|
57 |
|
58 /** |
|
59 @internalComponent |
|
60 @released |
|
61 */ |
|
62 enum TMsvOperationState { EMsvOperationNull, |
|
63 EMsvOperationQueued, |
|
64 EMsvOperationRunning, |
|
65 EMsvOperationCompleted, |
|
66 EMsvOperationFailed}; |
|
67 |
|
68 class CMsvServerOperation : public CActive |
|
69 /** |
|
70 @internalComponent |
|
71 @released |
|
72 */ |
|
73 { |
|
74 public: |
|
75 ~CMsvServerOperation(); |
|
76 // |
|
77 virtual const TDesC8& Progress()=0; |
|
78 virtual TInt SystemProgress(TMsvSystemProgress& aSysProgress); |
|
79 // |
|
80 inline TMsvOp Id() const; |
|
81 inline TUid MtmUid() const; |
|
82 inline TMsvId ServiceId() const; |
|
83 inline TMsvId SessionId() const; |
|
84 inline TMsvOperationState State() const; |
|
85 inline void SetState(TMsvOperationState aState); |
|
86 |
|
87 protected: |
|
88 CMsvServerOperation(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId); |
|
89 // |
|
90 protected: |
|
91 RMessage2 iMessage; |
|
92 private: |
|
93 TMsvOp iId; |
|
94 TUid iMtmUid; |
|
95 TMsvId iServiceId; |
|
96 TInt iSessionId; |
|
97 TMsvOperationState iState; |
|
98 }; |
|
99 |
|
100 #include "MSVOP.INL" |
|
101 |
|
102 #endif |