|
1 /* |
|
2 * Copyright (c) 2007 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: PSM server message. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PSMSRVMESSAGE_H |
|
20 #define PSMSRVMESSAGE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "psmmodechangeobserver.h" |
|
24 |
|
25 class CPsmManager; |
|
26 |
|
27 /** |
|
28 * PSM Message |
|
29 * |
|
30 * Wraps the message for PSM servers internal message handling |
|
31 * |
|
32 * @since S60 5.0 |
|
33 */ |
|
34 class CPsmMessage : public CBase, |
|
35 public MPsmModeChangeObserver |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor for external message |
|
41 * |
|
42 * @return New CSensrvMessage instance |
|
43 */ |
|
44 static CPsmMessage* NewL( CPsmManager& aPsmManager ); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor for external message |
|
48 * |
|
49 * @return New CSensrvMessage instance |
|
50 */ |
|
51 static CPsmMessage* NewLC( CPsmManager& aPsmManager ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CPsmMessage(); |
|
57 |
|
58 /** |
|
59 * Initializes the message. Must be done before message is |
|
60 * used first time and before use after each complete. |
|
61 * |
|
62 * @param aMessage Client message to wrap |
|
63 */ |
|
64 void Initialize( const RMessage2& aMessage ); |
|
65 |
|
66 /** |
|
67 * Completes the message |
|
68 * |
|
69 * @param aReason Completion reason identifier. Usually error code. |
|
70 */ |
|
71 void Complete( TInt aReason ) const; |
|
72 |
|
73 /** |
|
74 * Observes the mode change completion |
|
75 */ |
|
76 void NotifyPsmModeChangeComplete( const TInt aError ); |
|
77 |
|
78 private: |
|
79 |
|
80 /** |
|
81 * C++ constructor. |
|
82 */ |
|
83 CPsmMessage( CPsmManager& aPsmManager ); |
|
84 |
|
85 /** |
|
86 * By default Symbian 2nd phase constructor is private. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 private: // Data |
|
91 |
|
92 /** |
|
93 * Wrapped message |
|
94 */ |
|
95 RMessage2 iMessage; |
|
96 |
|
97 /** |
|
98 * Reference to PSM manager |
|
99 */ |
|
100 CPsmManager& iPsmManager; |
|
101 |
|
102 }; |
|
103 |
|
104 #endif // PSMSRVMESSAGE_H |