20 #ifndef MESSAGEVIEWER_MAILWEBVIEW_H
21 #define MESSAGEVIEWER_MAILWEBVIEW_H
25 #ifdef KDEPIM_NO_WEBKIT
26 # include <QTextBrowser>
32 #include <boost/function.hpp>
36 class KActionCollection;
38 namespace MessageViewer {
39 #ifndef KDEPIM_NO_WEBKIT
44 #ifdef KDEPIM_NO_WEBKIT
57 FindWrapsAroundDocument = 1,
59 FindCaseSensitively = 4,
60 HighlightAllOccurrences = 8,
64 Q_DECLARE_FLAGS( FindFlags, FindFlag )
66 bool findText( const
QString & test, FindFlags flags );
67 void clearFindSelection();
69 void scrollUp(
int pixels );
70 void scrollDown(
int pixels );
71 bool isScrolledToBottom() const;
72 bool hasVerticalScrollBar() const;
73 void scrollPageDown(
int percent );
74 void scrollPageUp(
int percent );
75 void scrollToAnchor( const
QString & anchor );
78 bool isAttachmentInjectionPoint( const
QPoint & globalPos ) const;
79 void injectAttachments( const boost::function<
QString()> & delayedHtml );
80 bool removeAttachmentMarking( const
QString &
id );
82 bool replaceInnerHtml( const
QString &
id, const boost::function<
QString()> & delayedHtml );
83 void setElementByIdVisible( const
QString &
id,
bool visible );
84 void setHtml( const
QString & html, const
QUrl & baseUrl );
87 void clearSelection();
88 void scrollToRelativePosition(
double pos );
89 double relativePosition() const;
91 void setAllowExternalContent(
bool allow );
93 QUrl linkOrImageUrlAt( const
QPoint & global ) const;
95 void setScrollBarPolicy( Qt::Orientation orientation, Qt::ScrollBarPolicy policy );
96 Qt::ScrollBarPolicy scrollBarPolicy( Qt::Orientation orientation ) const;
98 bool isAShortUrl(const KUrl &url) const;
99 void expandUrl(const KUrl &url);
101 #ifndef KDEPIM_NO_WEBKIT
103 void saveMainFrameScreenshotInFile(
const QString &filename);
104 void openBlockableItemsDialog();
108 void slotShowDetails();
115 void popupMenu(
const QUrl &url,
const QUrl&imageUrl,
const QPoint &point );
118 #ifdef KDEPIM_NO_WEBKIT
119 void linkClicked(
const QUrl & link );
121 void messageMayBeAScam();
124 #ifdef KDEPIM_MOBILE_UI
125 friend class MessageViewItem;
127 virtual bool event(
QEvent *event );
130 virtual void keyReleaseEvent(
QKeyEvent*);
135 void hideAccessKeys();
138 #ifndef KDEPIM_NO_WEBKIT
139 bool checkForAccessKey(
QKeyEvent *event);
140 void showAccessKeys();
141 void makeAccessKeyLabel(
const QChar &accessKey,
const QWebElement &element);
142 enum AccessKeyState {
147 AccessKeyState mAccessKeyActivated;
152 ScamDetection *mScamDetection;
154 KActionCollection *mActionCollection;
159 Q_DECLARE_OPERATORS_FOR_FLAGS( MessageViewer::MailWebView::FindFlags )
MailWebView extends KWebView so that it can emit the popupMenu() signal.
#define MESSAGEVIEWER_EXPORT