|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Message header URL event handler |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CFREESTYLE_MESSAGE_HEADER_EVENTHANDLER_URL_H__ |
|
19 #define __CFREESTYLE_MESSAGE_HEADER_EVENTHANDLER_URL_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include "FreestyleEmailUiConstants.h" |
|
23 #include "FreestyleEmailUiAttachmentsListModel.h" |
|
24 |
|
25 class CFreestyleEmailUiAppUi; |
|
26 class CFSMailMessage; |
|
27 class CFsEmailUiHtmlViewerView; |
|
28 class CFreestyleMessageHeaderURL; |
|
29 class TAttachmentData; |
|
30 |
|
31 enum TLinkType |
|
32 { |
|
33 EMailHeaderTo, |
|
34 EMailHeaderCC, |
|
35 EMailHeaderFrom, |
|
36 EMailHeaderAttachment |
|
37 }; |
|
38 |
|
39 class MFreestyleMessageViewEventHandler |
|
40 { |
|
41 public: |
|
42 virtual TBool HandleEventL( const TDesC& aUri ) = 0; |
|
43 }; |
|
44 |
|
45 class CFreestyleMessageHeaderURLEventHandler : public CBase, |
|
46 public MFreestyleMessageViewEventHandler |
|
47 { |
|
48 public: |
|
49 IMPORT_C static CFreestyleMessageHeaderURLEventHandler * NewL( |
|
50 CFreestyleEmailUiAppUi& aAppUi, |
|
51 CFsEmailUiHtmlViewerView& aView ); |
|
52 ~CFreestyleMessageHeaderURLEventHandler (); |
|
53 |
|
54 IMPORT_C TBool HandleEventL( const TDesC& aUri ); |
|
55 |
|
56 protected: |
|
57 CFreestyleMessageHeaderURLEventHandler( CFreestyleEmailUiAppUi& aAppUi, |
|
58 CFsEmailUiHtmlViewerView& aView ); |
|
59 void ConstructL(); |
|
60 |
|
61 private: |
|
62 const TAttachmentData& FindAttachmentL( const CFreestyleMessageHeaderURL& aAttachmentUrl ); |
|
63 void LaunchAttachmentMenuL( const TAttachmentData& aAttachment ); |
|
64 void HandAttachmentActionMenuCommandL( TActionMenuCustomItemId aSelectedActionMenuItem, |
|
65 const TAttachmentData& aAttachment ); |
|
66 |
|
67 void LaunchEmailAddressMenuL( const CFreestyleMessageHeaderURL& iMessageHeaderURL ); |
|
68 void HandleEmailAddressActionMenuCommandL( TActionMenuCustomItemId aSelectedActionMenuItem, |
|
69 const CFreestyleMessageHeaderURL& iMessageHeaderURL ); |
|
70 |
|
71 void SaveEmailAsContactL( const TDesC& aEmailAddress ); |
|
72 |
|
73 private: |
|
74 CFreestyleMessageHeaderURL* iMessageHeaderURL; |
|
75 CFreestyleEmailUiAppUi& iAppUi; |
|
76 CFsEmailUiHtmlViewerView& iView; |
|
77 CFSMailMessage* iMailMessage; |
|
78 CFSEmailUiAttachmentsListModel* iAttachmentsListModel; |
|
79 }; |
|
80 |
|
81 #endif //__CFREESTYLE_MESSAGE_HEADER_EVENTHANDLER_URL_H__ |