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 TQt, and distribute the resulting executable,
00022     without including the source code for TQt 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   TQ_OBJECT
00043         public:
00044 
00048             static void displayInExternalBrowser(const KURL &url, const TQString& mimetype=TQString());    
00049 
00050             Viewer(TQWidget* parent, const char* name);
00051             virtual ~Viewer();
00052 
00053             virtual bool closeURL();
00054         
00055             
00056         public slots:
00057             
00058             void slotScrollUp(); 
00059             void slotScrollDown();
00060             void slotZoomIn();
00061             void slotZoomOut();
00062             void slotSetZoomFactor(int percent);
00063             void slotPrint();
00064             void setSafeMode();
00065 
00066             virtual void slotPaletteOrFontChanged() = 0;
00067         
00068         signals:
00070             void urlClicked(const KURL& url, Viewer* viewer, bool newTab, bool background);
00071 
00072             protected: // methods
00073             int pointsToPixel(int points) const;
00074 
00075         protected slots:
00076         
00077             // FIXME: Sort out how things are supposed to work and clean up the following slots
00078 
00080             virtual void urlSelected(const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args);
00081 
00083             virtual void slotOpenURLRequest(const KURL& url, const KParts::URLArgs& args);
00084 
00085             virtual void slotPopupMenu(KXMLGUIClient*, const TQPoint&, const KURL&, const KParts::URLArgs&, KParts::BrowserExtension::PopupFlags, mode_t);
00086 
00088             void slotCopyLinkAddress();
00089 
00091             virtual void slotCopy();
00092 
00094             virtual void slotOpenLinkInternal();
00095 
00097             virtual void slotOpenLinkInBrowser();
00098 
00100             virtual void slotOpenLinkInForegroundTab();
00101 
00103             virtual void slotOpenLinkInBackgroundTab();
00104             
00105             virtual void slotOpenLinkInThisTab();
00106 
00107             virtual void slotSaveLinkAs();
00108 
00110             void slotStarted(KIO::Job *);
00111 
00113             void slotCompleted();
00114 
00115             virtual void slotSelectionChanged();
00116 
00117         protected: // attributes
00118             KURL m_url;
00119             
00120     };
00121 }
00122 
00123 #endif // VIEWER_H
00124 // vim: ts=4 sw=4 et