akregator/src

viewer.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Teemu Rytilahti <tpr@d5k.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef VIEWER_H
00026 #define VIEWER_H
00027 
00028 #include <khtml_part.h>
00029 
00030 class KURL;
00031 
00032 namespace KIO
00033 {
00034     class MetaData;
00035 }
00036 
00037 namespace Akregator
00038 {
00039     class Viewer : public KHTMLPart
00040     {
00041         Q_OBJECT
00042         public:
00043 
00047             static void displayInExternalBrowser(const KURL &url, const QString& mimetype=QString::null);    
00048 
00049             Viewer(QWidget* parent, const char* name);
00050             virtual ~Viewer();
00051 
00052             virtual bool closeURL();
00053         
00054             
00055         public slots:
00056             
00057             void slotScrollUp(); 
00058             void slotScrollDown();
00059             void slotZoomIn();
00060             void slotZoomOut();
00061             void slotSetZoomFactor(int percent);
00062             void slotPrint();
00063             void setSafeMode();
00064 
00065             virtual void slotPaletteOrFontChanged() = 0;
00066         
00067         signals:
00069             void urlClicked(const KURL& url, Viewer* viewer, bool newTab, bool background);
00070 
00071             protected: // methods
00072             int pointsToPixel(int points) const;
00073 
00074         protected slots:
00075         
00076             // FIXME: Sort out how things are supposed to work and clean up the following slots
00077 
00079             virtual void urlSelected(const QString &url, int button, int state, const QString &_target, KParts::URLArgs args);
00080 
00082             virtual void slotOpenURLRequest(const KURL& url, const KParts::URLArgs& args);
00083 
00084             virtual void slotPopupMenu(KXMLGUIClient*, const QPoint&, const KURL&, const KParts::URLArgs&, KParts::BrowserExtension::PopupFlags, mode_t);
00085 
00087             void slotCopyLinkAddress();
00088 
00090             virtual void slotCopy();
00091 
00093             virtual void slotOpenLinkInternal();
00094 
00096             virtual void slotOpenLinkInBrowser();
00097 
00099             virtual void slotOpenLinkInForegroundTab();
00100 
00102             virtual void slotOpenLinkInBackgroundTab();
00103             
00104             virtual void slotOpenLinkInThisTab();
00105 
00106             virtual void slotSaveLinkAs();
00107 
00109             void slotStarted(KIO::Job *);
00110 
00112             void slotCompleted();
00113 
00114             virtual void slotSelectionChanged();
00115 
00116         protected: // attributes
00117             KURL m_url;
00118             
00119     };
00120 }
00121 
00122 #endif // VIEWER_H
00123 // vim: ts=4 sw=4 et
KDE Home | KDE Accessibility Home | Description of Access Keys