summaryrefslogtreecommitdiffstats
path: root/src/viewer.h
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:26:24 +0200
committerMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:26:24 +0200
commit8c20dc919f7d54eb48fb60f39ba5e1d466a70763 (patch)
tree44d89f278d5dd066603e5ab9c0b270bc8eb4ad51 /src/viewer.h
downloadklamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.tar.gz
klamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.zip
Initial commit
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/viewer.h')
-rw-r--r--src/viewer.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/viewer.h b/src/viewer.h
new file mode 100644
index 0000000..9f47889
--- /dev/null
+++ b/src/viewer.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Teemu Rytilahti *
+ * teemu.rytilahti@kde-fi.org *
+ * *
+ * Licensed under GPL. *
+ ***************************************************************************/
+
+#ifndef VIEWER_H
+#define VIEWER_H
+
+#include <khtml_part.h>
+
+class KURL;
+
+namespace KIO
+{
+ class MetaData;
+}
+
+namespace KlamAV
+{
+ class Viewer : public KHTMLPart
+ {
+ Q_OBJECT
+ public:
+ Viewer(QWidget* parent, const char* name);
+ virtual bool closeURL();
+ virtual bool openURL(const KURL &);
+
+ /** used by the BrowserRun object to call KHTMLPart::openURL() */
+ void openPage(const KURL& url) { KHTMLPart::openURL(url);}
+
+ public slots:
+
+ void slotScrollUp();
+ void slotScrollDown();
+ void slotZoomIn();
+ void slotZoomOut();
+ void slotSetZoomFactor(int percent);
+ void slotPrint();
+ void setSafeMode();
+
+ virtual void slotPaletteOrFontChanged() = 0;
+
+ signals:
+ /** This gets emitted when url gets clicked */
+ void urlClicked(const KURL& url, bool background=false);
+
+ protected: // methods
+ int pointsToPixel(int points) const;
+
+ protected slots:
+ virtual void slotOpenURLRequest(const KURL& url, const KParts::URLArgs& args);
+ virtual void slotPopupMenu(KXMLGUIClient*, const QPoint&, const KURL&, const KParts::URLArgs&, KParts::BrowserExtension::PopupFlags, mode_t);
+
+ /** Copies current link to clipboard. */
+ void slotCopyLinkAddress();
+
+ /** Copies currently selected text to clipboard */
+ virtual void slotCopy();
+
+ /** Opens @c m_url inside this viewer */
+ virtual void slotOpenLinkInternal();
+
+ /** Opens @c m_url in external viewer, eg. Konqueror */
+ virtual void slotOpenLinkInBrowser();
+
+ /** Opens @c m_url in foreground tab */
+ virtual void slotOpenLinkInForegroundTab();
+
+ /** Opens @c m_url in background tab */
+ virtual void slotOpenLinkInBackgroundTab();
+
+ /** This changes cursor to wait cursor */
+ void slotStarted(KIO::Job *);
+
+ /** This reverts cursor back to normal one */
+ void slotCompleted();
+
+ virtual void slotSelectionChanged();
+
+ protected: // attributes
+ KURL m_url;
+
+ private:
+ /**
+ * Display article in external browser.
+ */
+ void displayInExternalBrowser(const KURL &url, const QString &mime);
+ };
+}
+
+#endif // VIEWER_H
+// vim: ts=4 sw=4 et