when a new activity is added, don't move more than necessary to show it
[kdebase.git] / runtime / khelpcenter / view.h
blobd3b08e22488661362bff0d1de2aa67465bca3d15
1 #ifndef __view_h__
2 #define __view_h__
4 #include <khtml_part.h>
6 #include "glossary.h"
7 #include "navigator.h"
8 //Added by qt3to4:
9 #include <QEvent>
11 class KActionCollection;
13 namespace DOM {
14 class Node;
17 namespace KHC {
19 class Formatter;
21 class View : public KHTMLPart
23 Q_OBJECT
24 public:
25 View( QWidget *parentWidget, QObject *parent, KHTMLPart::GUIProfile prof,
26 KActionCollection *col );
28 ~View();
30 virtual bool openUrl( const KUrl &url );
32 virtual void saveState( QDataStream &stream );
33 virtual void restoreState( QDataStream &stream );
35 enum State { Docu, About, Search };
37 int state() const { return mState; }
38 QString title() const { return mTitle; }
40 static QString langLookup( const QString &fname );
42 void beginSearchResult();
43 void writeSearchResult( const QString & );
44 void endSearchResult();
46 void beginInternal( const KUrl & );
47 KUrl internalUrl() const;
49 int zoomStepping() const { return m_zoomStepping; }
51 Formatter *formatter() const { return mFormatter; }
53 void copySelectedText();
55 public Q_SLOTS:
56 void lastSearch();
57 void slotIncFontSizes();
58 void slotDecFontSizes();
59 void slotReload( const KUrl &url = KUrl() );
60 void slotCopyLink();
61 bool nextPage(bool checkOnly = false);
62 bool prevPage(bool checkOnly = false);
64 Q_SIGNALS:
65 void searchResultCacheAvailable();
67 protected:
68 bool eventFilter( QObject *o, QEvent *e );
70 private Q_SLOTS:
71 void setTitle( const QString &title );
72 void showMenu( const QString& url, const QPoint& pos);
74 private:
75 void showAboutPage();
76 KUrl urlFromLinkNode( const DOM::Node &n ) const;
78 int mState;
79 QString mTitle;
81 QString mSearchResult;
82 KUrl mInternalUrl;
84 int m_zoomStepping;
86 Formatter *mFormatter;
87 KActionCollection *mActionCollection;
88 QString mCopyURL;
93 #endif
95 // vim:ts=2:sw=2:et