20 #ifndef MESSAGEVIEWER_MAILWEBVIEW_H
21 #define MESSAGEVIEWER_MAILWEBVIEW_H
26 #ifdef KDEPIM_NO_WEBKIT
27 # include <QTextBrowser>
36 #include <boost/function.hpp>
39 class KActionCollection;
41 namespace MessageViewer {
42 #ifndef KDEPIM_NO_WEBKIT
47 #ifdef KDEPIM_NO_WEBKIT
64 FindWrapsAroundDocument = 1,
66 FindCaseSensitively = 4,
67 HighlightAllOccurrences = 8,
71 Q_DECLARE_FLAGS( FindFlags, FindFlag )
73 bool findText( const QString & test, FindFlags flags );
74 void clearFindSelection();
76 void scrollUp(
int pixels );
77 void scrollDown(
int pixels );
78 bool isScrolledToBottom() const;
79 bool hasVerticalScrollBar() const;
80 void scrollPageDown(
int percent );
81 void scrollPageUp(
int percent );
82 void scrollToAnchor( const QString & anchor );
84 QString selectedText() const;
85 bool isAttachmentInjectionPoint( const QPoint & globalPos ) const;
86 void injectAttachments( const boost::function<QString()> & delayedHtml );
87 bool removeAttachmentMarking( const QString &
id );
88 void markAttachment( const QString &
id, const QString & style );
89 bool replaceInnerHtml( const QString &
id, const boost::function<QString()> & delayedHtml );
90 void setElementByIdVisible( const QString &
id,
bool visible );
91 void setHtml( const QString & html, const QUrl & baseUrl );
92 QString htmlSource() const;
94 void clearSelection();
95 void scrollToRelativePosition(
double pos );
96 double relativePosition() const;
98 void setAllowExternalContent(
bool allow );
100 QUrl linkOrImageUrlAt( const QPoint & global ) const;
102 void setScrollBarPolicy( Qt::Orientation orientation, Qt::ScrollBarPolicy policy );
103 Qt::ScrollBarPolicy scrollBarPolicy( Qt::Orientation orientation ) const;
105 bool isAShortUrl(const KUrl &url) const;
106 void expandUrl(const KUrl &url);
108 #ifndef KDEPIM_NO_WEBKIT
110 void saveMainFrameScreenshotInFile(
const QString &filename);
111 void openBlockableItemsDialog();
115 void slotShowDetails();
122 void popupMenu(
const QUrl &url,
const QUrl&imageUrl,
const QPoint &point );
124 void linkHovered(
const QString & link,
const QString & title=QString(),
const QString & textContent=QString() );
125 #ifdef KDEPIM_NO_WEBKIT
126 void linkClicked(
const QUrl & link );
128 void messageMayBeAScam();
131 #ifdef KDEPIM_MOBILE_UI
132 friend class MessageViewItem;
134 virtual bool event( QEvent *event );
137 virtual void keyReleaseEvent(QKeyEvent*);
138 virtual void keyPressEvent(QKeyEvent*);
139 virtual void wheelEvent (QWheelEvent* e);
142 void hideAccessKeys();
145 #ifndef KDEPIM_NO_WEBKIT
146 bool checkForAccessKey(QKeyEvent *event);
147 void showAccessKeys();
148 void makeAccessKeyLabel(
const QChar &accessKey,
const QWebElement &element);
149 enum AccessKeyState {
154 AccessKeyState mAccessKeyActivated;
155 QList<QLabel*> mAccessKeyLabels;
156 QHash<QChar, QWebElement> mAccessKeyNodes;
157 QHash<QString, QChar> mDuplicateLinkElements;
159 ScamDetection *mScamDetection;
161 KActionCollection *mActionCollection;
166 Q_DECLARE_OPERATORS_FOR_FLAGS( MessageViewer::MailWebView::FindFlags )
MailWebView extends KWebView so that it can emit the popupMenu() signal.
#define MESSAGEVIEWER_EXPORT