|
1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 |
|
18 #ifndef __MCSPLUGINHANDLER_H__ |
|
19 #define __MCSPLUGINHANDLER_H__ |
|
20 |
|
21 #include <mcsmenuhandlerplugin.h> |
|
22 |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <viewcli.h> // For CVwsSessionWrapper |
|
26 #include <msvapi.h> // For MMsvSessionObserver |
|
27 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
28 #include <viewclipartner.h> |
|
29 #endif |
|
30 |
|
31 #include <vwsdef.h> // For TVwsViewId |
|
32 |
|
33 |
|
34 class CEikonEnv; |
|
35 class CVwsSessionWrapper; |
|
36 class CMsvSession; |
|
37 |
|
38 /** |
|
39 * @ingroup group_mcsplugin |
|
40 * |
|
41 * Handler for menu items of type "menu:shortcut" "menu:folder" and "menu:suite". |
|
42 * |
|
43 * @since S60 9.1 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CMCSPluginHandler ): public CMenuHandlerPlugin, public MMsvSessionObserver |
|
46 { |
|
47 |
|
48 public: // construction |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CMCSPluginHandler(); |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. Leaves on failure. |
|
57 * @param aMenu Menu. |
|
58 * @return The constructed object. |
|
59 */ |
|
60 static CMCSPluginHandler* NewL( RMenu &aMenu ); |
|
61 |
|
62 protected: // construction |
|
63 |
|
64 /** |
|
65 * Constructor. |
|
66 * @param aMenu Menu. |
|
67 */ |
|
68 CMCSPluginHandler( RMenu &aMenu ); |
|
69 |
|
70 /** |
|
71 * Second-phase constructor. |
|
72 */ |
|
73 void ConstructL(); |
|
74 |
|
75 public: // from CMenuHandler |
|
76 |
|
77 /** |
|
78 * Query support for item type. |
|
79 * @param aType Type. |
|
80 * @return ETrue if handler supports this type, EFalse otherwise. |
|
81 */ |
|
82 TBool SupportsType( const TDesC& aType ); |
|
83 |
|
84 /** |
|
85 * Handle command. |
|
86 * @param aItem Item of supported type. |
|
87 * @param aCommand Command. |
|
88 * @param aParams. Command parameters. |
|
89 * @param aStatus Observer request status. When the operation completes, |
|
90 * this status will be completed with the resulting error code. |
|
91 * @return Asynchronous operation. Owned by the caller. |
|
92 */ |
|
93 CMenuOperation* HandleCommandL( |
|
94 CMenuItem& aItem, |
|
95 const TDesC8& aCommand, |
|
96 const TDesC8& aParams, |
|
97 TRequestStatus& aStatus ); |
|
98 |
|
99 public: // from MMsvSessionObserver |
|
100 |
|
101 /** |
|
102 * Handles an event from the message server. |
|
103 * Not used, but must be defined to be able to use the messaging server. |
|
104 * |
|
105 * @since S60 v3.2 |
|
106 * @param aEvent Indicates the event type. |
|
107 * @param aArg1 Event type-specific argument value |
|
108 * @param aArg2 Event type-specific argument value |
|
109 * @param aArg3 Event type-specific argument value |
|
110 */ |
|
111 void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, |
|
112 TAny* aArg3 ); |
|
113 |
|
114 |
|
115 |
|
116 private: // internal |
|
117 |
|
118 void LaunchShortcutL( CMenuItem& aItem ); |
|
119 |
|
120 TInt GetEmailAccountCountL(); |
|
121 |
|
122 private: // data |
|
123 |
|
124 CEikonEnv* iEikEnv; |
|
125 |
|
126 /** |
|
127 * View server session wrapper. |
|
128 * Own |
|
129 */ |
|
130 CVwsSessionWrapper* iVwsSession; |
|
131 |
|
132 /** |
|
133 * Message server session |
|
134 * Own. |
|
135 */ |
|
136 CMsvSession* iMsvSession; |
|
137 |
|
138 }; |
|
139 |
|
140 #endif // __MCSPLUGINHANDLER_H__ |