|
1 /* |
|
2 * Copyright (c) 2005 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: html control |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMAILHTMLBODYCONTROL |
|
21 #define CMAILHTMLBODYCONTROL |
|
22 |
|
23 // INCLUDES |
|
24 #include "MMailMsgBaseControl.h" |
|
25 #include <MMessageLoadObserver.h> |
|
26 #include <BrCtlInterface.h> // MBrCtlLoadEventObserver |
|
27 #include <BrCtlLinkResolver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CMailMessage; |
|
31 class MMailAppUiInterface; |
|
32 class CBrCtlInterface; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * HTML body control. |
|
38 * For replacing editor base default plain text body control |
|
39 * |
|
40 * @lib MailHtmlView |
|
41 * @since Series 60 3.1 |
|
42 */ |
|
43 class CMailHtmlBodyControl : public CBase, public MMailMsgBaseControl, |
|
44 MBrCtlLoadEventObserver, MBrCtlLinkResolver, MMessageLoadObserver |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * @param aMessage Mail message |
|
51 * @param aUICallBack UI call back |
|
52 */ |
|
53 static CMailHtmlBodyControl* NewLC( |
|
54 CMailMessage& aMessage, |
|
55 MMailAppUiInterface& aUICallBack ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CMailHtmlBodyControl(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * BrowserControl. |
|
66 * @since Series 60 3.0 |
|
67 * @return Browser control |
|
68 */ |
|
69 CBrCtlInterface& BrowserControl(); |
|
70 |
|
71 protected: // Functions from base classes |
|
72 // From: MMessageLoadObserver |
|
73 void MessageLoadingL(TInt aStatus, CMailMessage& aMessage); |
|
74 |
|
75 /** |
|
76 * From MMailMsgBaseControl. |
|
77 */ |
|
78 TRect CurrentLineRect(); |
|
79 void SetAndGetSizeL( TSize& aSize ); |
|
80 void ClipboardL( TMsgClipboardFunc aFunc ); |
|
81 void EditL( TMsgEditFunc aFunc ); |
|
82 TBool IsFocusChangePossible( TMsgFocusDirection aDirection ) const; |
|
83 TBool IsCursorLocation( TMsgCursorLocation aLocation ) const; |
|
84 TUint32 EditPermission() const; |
|
85 void PrepareForReadOnly( TBool aReadOnly ); |
|
86 TInt VirtualHeight(); |
|
87 TInt VirtualVisibleTop(); |
|
88 |
|
89 TInt CountPluginComponentControls() const; |
|
90 CCoeControl* PluginComponentControl( TInt aIndex ) const; |
|
91 void PluginSizeChanged(); |
|
92 void PluginFocusChanged( TDrawNow aDrawNow ); |
|
93 void PluginHandleResourceChange(TInt aType); |
|
94 TKeyResponse PluginOfferKeyEventL( |
|
95 const TKeyEvent& aKeyEvent, |
|
96 TEventCode aType); |
|
97 void SetPluginExtent(const TPoint& aPosition,const TSize& aSize); |
|
98 |
|
99 /** |
|
100 * From MBrCtlLoadEventObserver |
|
101 */ |
|
102 void HandleBrowserLoadEventL( |
|
103 TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, |
|
104 TUint aSize, |
|
105 TUint16 aTransactionId); |
|
106 |
|
107 /** |
|
108 * From MBrCtlLinkResolver |
|
109 */ |
|
110 TBool ResolveEmbeddedLinkL( |
|
111 const TDesC& aEmbeddedUrl, |
|
112 const TDesC& aCurrentUrl, |
|
113 TBrCtlLoadContentType aLoadContentType, |
|
114 MBrCtlLinkContent& aEmbeddedLinkContent ); |
|
115 TBool ResolveLinkL( |
|
116 const TDesC& aUrl, |
|
117 const TDesC& aCurrentUrl, |
|
118 MBrCtlLinkContent& aBrCtlLinkContent ); |
|
119 void CancelAll(); |
|
120 |
|
121 private: |
|
122 |
|
123 /** |
|
124 * constructor. |
|
125 */ |
|
126 CMailHtmlBodyControl( |
|
127 CMailMessage& aMessage, |
|
128 MMailAppUiInterface& aUICallBack ); |
|
129 |
|
130 /** |
|
131 * By default Symbian 2nd phase constructor is private. |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 public: // Data |
|
136 // ?one_line_short_description_of_data |
|
137 //?data_declaration; |
|
138 |
|
139 protected: // Data |
|
140 // ?one_line_short_description_of_data |
|
141 //?data_declaration; |
|
142 |
|
143 private: // Data |
|
144 /// Own: Browser control |
|
145 CBrCtlInterface* iBrControl; |
|
146 |
|
147 /// Ref: Link content |
|
148 MBrCtlLinkContent* iEmbeddedLinkContent; |
|
149 |
|
150 /// Ref: To viewed message |
|
151 CMailMessage& iMessage; |
|
152 |
|
153 /// Ref: UI call back |
|
154 MMailAppUiInterface& iUICallBack; |
|
155 // Reserved pointer for future extension |
|
156 //TAny* iReserved; |
|
157 |
|
158 }; |
|
159 |
|
160 #endif // CMAILHTMLBODYCONTROL |
|
161 |
|
162 // End of File |