25
|
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 |
class CAknStylusPopUpMenu;
|
|
31 |
class CFSHtmlReloadAO;
|
|
32 |
|
|
33 |
enum TLinkType
|
|
34 |
{
|
|
35 |
EMailHeaderTo,
|
|
36 |
EMailHeaderCC,
|
|
37 |
EMailHeaderFrom,
|
|
38 |
EMailHeaderAttachment
|
|
39 |
};
|
|
40 |
|
|
41 |
class MFreestyleMessageViewEventHandler
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
virtual TBool HandleEventL( const TDesC& aUri ) = 0;
|
|
45 |
};
|
|
46 |
|
|
47 |
class CFreestyleMessageHeaderURLEventHandler : public CBase,
|
|
48 |
public MFreestyleMessageViewEventHandler,
|
|
49 |
public MEikMenuObserver
|
|
50 |
{
|
|
51 |
public:
|
|
52 |
IMPORT_C static CFreestyleMessageHeaderURLEventHandler * NewL(
|
|
53 |
CFreestyleEmailUiAppUi& aAppUi,
|
|
54 |
CFsEmailUiHtmlViewerView& aView );
|
|
55 |
~CFreestyleMessageHeaderURLEventHandler ();
|
|
56 |
|
|
57 |
IMPORT_C TBool HandleEventL( const TDesC& aUri );
|
|
58 |
void DismissMenuAndReload();
|
|
59 |
TBool IsMenuVisible();
|
|
60 |
|
|
61 |
public: //From MEikMenuObserver
|
|
62 |
void ProcessCommandL(TInt aCommandId);
|
|
63 |
void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/);
|
|
64 |
|
|
65 |
protected:
|
|
66 |
CFreestyleMessageHeaderURLEventHandler( CFreestyleEmailUiAppUi& aAppUi,
|
|
67 |
CFsEmailUiHtmlViewerView& aView );
|
|
68 |
void ConstructL();
|
|
69 |
|
|
70 |
private:
|
|
71 |
const TAttachmentData& FindAttachmentL( const CFreestyleMessageHeaderURL& aAttachmentUrl );
|
|
72 |
void LaunchAttachmentMenuL( const TAttachmentData& aAttachment );
|
|
73 |
TBool LaunchAttachmentMenuHWKeyL( const TAttachmentData& aAttachment );
|
|
74 |
void HandAttachmentActionMenuCommandL( TActionMenuCustomItemId aSelectedActionMenuItem,
|
|
75 |
const TAttachmentData& aAttachment );
|
|
76 |
void LaunchEmailAddressMenuL( );
|
|
77 |
TBool LaunchEmailAddressMenuHWKeyL();
|
|
78 |
void LaunchWebAddressMenuL( );
|
|
79 |
TBool LaunchWebAddressMenuHWKeyL( );
|
|
80 |
|
|
81 |
private:
|
|
82 |
CFreestyleMessageHeaderURL* iMessageHeaderURL;
|
|
83 |
CFreestyleEmailUiAppUi& iAppUi;
|
|
84 |
CFsEmailUiHtmlViewerView& iView;
|
|
85 |
CFSMailMessage* iMailMessage;
|
|
86 |
CFSEmailUiAttachmentsListModel* iAttachmentsListModel;
|
|
87 |
CAknStylusPopUpMenu* iEmailAddressStylusPopup;
|
|
88 |
CAknStylusPopUpMenu* iAttachmentStylusPopup;
|
|
89 |
CAknStylusPopUpMenu* iWebAddressStylusPopup;
|
|
90 |
HBufC* iUrl;
|
|
91 |
TBool iMenuVisible;
|
|
92 |
TBool iPendingReload;
|
|
93 |
CFSHtmlReloadAO* iHTMLReloadAO;
|
|
94 |
};
|
|
95 |
|
|
96 |
|
|
97 |
/******************************************************************************
|
|
98 |
* class TPopupMenuItem
|
|
99 |
******************************************************************************/
|
|
100 |
|
|
101 |
NONSHARABLE_CLASS (TPopupMenuItem)
|
|
102 |
{
|
|
103 |
public:
|
|
104 |
TInt iCommandId;
|
|
105 |
TBuf<KMaxName> iText;
|
|
106 |
TBool iDimmed;
|
|
107 |
TInt iListIndex;
|
|
108 |
};
|
|
109 |
|
|
110 |
|
|
111 |
/******************************************************************************
|
|
112 |
* class CFreestylePopupMenu
|
|
113 |
******************************************************************************/
|
|
114 |
|
|
115 |
NONSHARABLE_CLASS (CFreestylePopupMenu) : public CBase
|
|
116 |
{
|
|
117 |
public:
|
|
118 |
static CFreestylePopupMenu* NewL( TInt aResourceId );
|
|
119 |
~CFreestylePopupMenu();
|
|
120 |
|
|
121 |
private:
|
|
122 |
CFreestylePopupMenu( TInt aResourceId );
|
|
123 |
void ConstructL();
|
|
124 |
|
|
125 |
public:
|
|
126 |
TInt LaunchPopupMenuL(); // returns command id or KErrCancel
|
|
127 |
void SetDimmed( TInt aCommandId, TBool aDimmed );
|
|
128 |
|
|
129 |
private:
|
|
130 |
TInt CommandIdFromListIndex( TInt aListIndex );
|
|
131 |
void ConstructFromResourceL( TResourceReader& aReader );
|
|
132 |
void StrCopy( TDes& aTarget, const TDesC& aSource );
|
|
133 |
|
|
134 |
private:
|
|
135 |
TInt iResourceId;
|
|
136 |
|
|
137 |
RArray<TPopupMenuItem> iItemList;
|
|
138 |
};
|
|
139 |
|
|
140 |
|
|
141 |
#endif //__CFREESTYLE_MESSAGE_HEADER_EVENTHANDLER_URL_H__
|