|
1 /* |
|
2 * Copyright (c) 2007-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: Creates and display attachment action menu. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRCONTACTMENUATTACHMENTHANDLER_H |
|
20 #define CESMRCONTACTMENUATTACHMENTHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <eikcmobs.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CEikMenuPane; |
|
27 class CFscContactActionMenu; |
|
28 class CGulIcon; |
|
29 // <cmail> |
|
30 class CESMRAttachmentInfo; |
|
31 // </cmail> |
|
32 |
|
33 NONSHARABLE_CLASS( CESMRContactMenuAttachmentHandler ) : public CBase |
|
34 { |
|
35 public: // enumarations |
|
36 /** |
|
37 * Predefined action menu items that are availabe |
|
38 */ |
|
39 enum TESMRAttachmentActionMenuItem |
|
40 { |
|
41 EActionOpen = 0 |
|
42 }; |
|
43 |
|
44 public: // Constructors and destructors |
|
45 |
|
46 /** |
|
47 * Two-phase constructor. |
|
48 * |
|
49 * @param aContactActionMenu contact action menu |
|
50 * @return new instance of the class |
|
51 */ |
|
52 static CESMRContactMenuAttachmentHandler* NewL( |
|
53 CFscContactActionMenu& aContactActionMenu ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~CESMRContactMenuAttachmentHandler(); |
|
59 |
|
60 public: // New methods |
|
61 /** |
|
62 * Resets/disables attachment contact menu handler. |
|
63 */ |
|
64 void Reset(); |
|
65 |
|
66 /** |
|
67 * Sets attachment info for action menu to show/hide options. |
|
68 * Ownership does not change. |
|
69 * |
|
70 * @param aAttachmentInfo attachment info object |
|
71 */ |
|
72 void SetAttachmentInfo( CESMRAttachmentInfo* aAttachmentInfo ); |
|
73 |
|
74 /** |
|
75 * Enables contact action menu and options menu for given attachment(s). |
|
76 */ |
|
77 void InitActionMenuL( ); |
|
78 |
|
79 /** |
|
80 * Returns true if options menu / actions is available. |
|
81 */ |
|
82 TBool OptionsMenuAvailable( ); |
|
83 |
|
84 /** |
|
85 * Initializes options menu / actions submenu. |
|
86 * |
|
87 * @param aActionMenuPane actions submenu |
|
88 */ |
|
89 void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); |
|
90 |
|
91 /** |
|
92 * Executes contact action menu. |
|
93 */ |
|
94 void ShowActionMenuL( ); |
|
95 |
|
96 /** |
|
97 * Sets command observer for field. Field can use command |
|
98 * observer for triggering commands. |
|
99 * @param @aCommandObserver Reference to command observer |
|
100 */ |
|
101 void SetCommandObserver( MEikCommandObserver* aCommandObserver ); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * C++ default Constructor |
|
107 * @param aContactActionMenu contact action menu |
|
108 */ |
|
109 CESMRContactMenuAttachmentHandler( |
|
110 CFscContactActionMenu& aContactActionMenu ); |
|
111 |
|
112 /** |
|
113 * Symbian 2nd phase constructor |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 /** |
|
118 * Creates a single actionmenu item with selectable command |
|
119 * @param aResourceId |
|
120 * @param aCommandUid |
|
121 */ |
|
122 void CreateMenuItemL( TInt aResourceId, TUid aCommandUid ); |
|
123 |
|
124 /** |
|
125 * create icons to actionmenu |
|
126 */ |
|
127 CGulIcon* CreateIconL( TUid aCommandUid ); |
|
128 |
|
129 private: // data |
|
130 |
|
131 /// Ref: Contact action menu |
|
132 CFscContactActionMenu& iContactActionMenu; |
|
133 |
|
134 /// Not owned |
|
135 CESMRAttachmentInfo* iAttachmentInfo; |
|
136 |
|
137 /// Own: |
|
138 TBool iOptionsMenuAvailable; |
|
139 |
|
140 /// Own: array of actionmenu icons |
|
141 RPointerArray<CGulIcon> iIconArray; |
|
142 |
|
143 /// Ref: Pointer to command observer |
|
144 MEikCommandObserver* iCommandObserver; |
|
145 }; |
|
146 |
|
147 #endif // CESMRCONTACTMENUATTACHMENTHANDLER_H |
|
148 |
|
149 // End of file |