1 /***************************************************************************
2 * Copyright (C) 2004 by Kita Developers *
3 * ikemo@users.sourceforge.jp *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
10 #ifndef KITAHTMLPART_H
11 #define KITAHTMLPART_H
13 #include <QtCore/QEvent>
15 #include <khtml_part.h>
20 HTMLPART_MODE_MAINPART,
26 /* ID of user defined event */
27 const int EVENT_GotoAnchor = QEvent::User + 100;
41 class HTMLPart : public KHTMLPart
48 /* basic information */
51 bool m_updatedKokoyon;
59 QStringList m_anchorStack;
60 int m_jumpNumAfterLoading; /* see also slotFinishLoad() */
77 HTMLPart(QWidget* parent);
79 bool setup(int mode , const KUrl& url);
82 void showResponses(int startnum, int endnum);
83 void parseResponses(int startnum, int endnum);
85 void updateScreen(bool showHeaderEtc, bool clock);
86 void setInnerHTML(const QString& innerHTML);
89 bool load(int centerNum);
90 bool reload(int jumpNum);
93 bool gotoAnchor(const QString& anc, bool pushPosition);
96 bool findText(const QString &query, bool reverse);
99 bool isPopupVisible();
104 void slotSetFaceOfHTMLPart();
107 void slotReceiveData();
108 void slotFinishLoad();
111 void slotGotoKokoyon();
112 void slotGobackAnchor();
114 /* Tugi100, Mae100 etc. */
115 void slotClickGotoFooter();
118 void slotDeletePopup();
119 void slotShowResPopup(const QPoint& point, int refNum, int refNum2);
124 void redrawHTMLPart(const KUrl& datUrl, bool force);
127 void connectSignals();
128 void createHTMLDocument();
131 void pushCurrentPosition();
132 QString getCurrentIdOfNode();
135 void showPopupMenu(const KUrl& kurl);
138 void clickAnchor(const KUrl& urlin);
139 void showWritePopupMenu(const QString& refstr);
140 void showIdPopup(const QString& refstr);
141 void showBePopupMenu(const QString& refstr);
147 void showPopup(const KUrl& url, const QString& innerHTML);
148 void showPopupCore(const KUrl& url, const QString& innerHTML,
149 const QPoint& point);
150 bool startMultiPopup();
151 bool isMultiPopupMode();
153 bool isUnderMouse(int mrgwd, int mrght);
154 bool showSelectedDigitPopup();
156 HTMLPart(const HTMLPart&);
157 HTMLPart& operator=(const HTMLPart&);
162 virtual void customEvent(QEvent * e);
165 virtual void khtmlMousePressEvent(khtml::MousePressEvent* e);
171 void slotOpenUrlRequest(const KUrl&, const KParts::OpenUrlArguments&);
175 void slotVSliderReleased();
176 void slotHSliderReleased();
177 void slotHideChildPopup();
178 void slotOnUrl(const QString& url);
182 void mousePressed(); /* to ThreadView */
189 void hideChildPopup();
192 /* user defined events */
193 class GotoAnchorEvent : public QEvent
199 GotoAnchorEvent(const QString& anc)
200 : QEvent(QEvent::Type(EVENT_GotoAnchor)), m_anc(anc) {};
202 const QString& getAnc() const { return m_anc; }