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 ***************************************************************************/
11 #ifndef KITAHTMLPART_H
12 #define KITAHTMLPART_H
14 #include <khtml_part.h>
21 HTMLPART_MODE_MAINPART,
27 /* ID of user defined event */
28 #define EVENT_GotoAnchor ( QEvent::User + 100 )
44 /*-------------------------------------------------------------*/
46 class KitaHTMLPart : public KHTMLPart
50 KitaDomTree* m_domtree;
51 Kita::ResPopup* m_popup;
53 /* basic information */
56 bool m_updatedKokoyon;
64 QStringList m_anchorStack;
65 int m_jumpNumAfterLoading; /* see also slotFinishLoad() */
84 KitaHTMLPart( QWidget* parent, const char* name = 0 );
86 bool setup( int mode , const KURL& url );
89 void showResponses( int startnum, int endnum );
90 void parseResponses( int startnum, int endnum );
92 void updateScreen( bool showHeaderEtc, bool clock );
93 void setInnerHTML( const QString& innerHTML );
96 bool load( int centerNum );
97 bool reload( int jumpNum );
100 bool gotoAnchor( const QString& anc, bool pushPosition );
103 bool findText( const QString &query, bool reverse );
106 bool isPopupVisible();
111 void slotRedrawAllHTMLPart( bool force );
112 void slotSetFaceOfHTMLPart();
113 void slotSetStyleSheetOfHTMLPart();
116 void slotReceiveData();
117 void slotFinishLoad();
120 void slotGotoKokoyon();
121 void slotGobackAnchor();
123 /* Tugi100, Mae100 etc. */
124 void slotClickGotoFooter();
127 void slotDeletePopup();
128 void slotShowResPopup( QPoint point, int refNum, int refNum2 );
133 void redrawHTMLPart( const KURL& datURL, bool force );
136 void connectSignals();
137 void createHTMLDocument();
140 void pushCurrentPosition();
141 QString getCurrentIDofNode();
144 void showPopupMenu( const KURL& kurl );
147 void clickAnchor( const KURL& urlin );
148 void showWritePopupMenu( const QString& refstr );
149 void showIDPopup( const QString& refstr );
150 void showBePopupMenu( const QString& refstr );
156 void showPopup( const KURL& url, const QString& innerHTML );
157 void showPopupCore( const KURL& url, const QString& innerHTML, QPoint point );
158 bool startMultiPopup();
159 bool isMultiPopupMode();
161 bool isUnderMouse( int mrgwd, int mrght );
162 bool showSelectedDigitPopup();
167 virtual void customEvent( QCustomEvent * e );
170 virtual void khtmlMousePressEvent( khtml::MousePressEvent* e );
176 void slotOpenURLRequest( const KURL&, const KParts::URLArgs& );
180 void slotVSliderReleased();
181 void slotHSliderReleased();
182 void slotHideChildPopup();
183 void slotKitaIsActive();
184 void slotOnURL( const QString& url );
188 void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
189 void mousePressed(); /* to KitaThreadView */
196 void hideChildPopup();
200 void activateThreadView( const KURL& );
201 void closeWriteTab( const KURL& );
204 void updateSubjectTab( const KURL& );
209 /*---------------------------------------------------*/
210 /*---------------------------------------------------*/
211 /*---------------------------------------------------*/
216 /* user defined events */
218 class GotoAnchorEvent : public QCustomEvent
224 GotoAnchorEvent( const QString& anc )
225 : QCustomEvent( EVENT_GotoAnchor ), m_anc( anc ) {};
227 const QString& getAnc() const { return m_anc; }