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() */
82 KitaHTMLPart( QWidget* parent, const char* name = 0 );
84 bool setup( int mode , const KURL& url );
87 void showResponses( int startnum, int endnum );
88 void parseResponses( int startnum, int endnum );
90 void updateScreen( bool showHeaderEtc, bool clock );
91 void setInnerHTML( const QString& innerHTML );
94 bool load( int centerNum );
95 bool reload( int jumpNum );
98 bool gotoAnchor( const QString& anc, bool pushPosition );
101 bool findText( const QString &query, bool reverse );
104 bool isPopupVisible();
109 void slotSetFaceOfHTMLPart();
112 void slotReceiveData();
113 void slotFinishLoad();
116 void slotGotoKokoyon();
117 void slotGobackAnchor();
119 /* Tugi100, Mae100 etc. */
120 void slotClickGotoFooter();
123 void slotDeletePopup();
124 void slotShowResPopup( QPoint point, int refNum, int refNum2 );
129 void redrawHTMLPart( const KURL& datURL, bool force );
132 void connectSignals();
133 void createHTMLDocument();
136 void pushCurrentPosition();
137 QString getCurrentIDofNode();
140 void showPopupMenu( const KURL& kurl );
143 void clickAnchor( const KURL& urlin );
144 void showWritePopupMenu( const QString& refstr );
145 void showIDPopup( const QString& refstr );
146 void showBePopupMenu( const QString& refstr );
152 void showPopup( const KURL& url, const QString& innerHTML );
153 void showPopupCore( const KURL& url, const QString& innerHTML, QPoint point );
154 bool startMultiPopup();
155 bool isMultiPopupMode();
157 bool isUnderMouse( int mrgwd, int mrght );
158 bool showSelectedDigitPopup();
163 virtual void customEvent( QCustomEvent * e );
166 virtual void khtmlMousePressEvent( khtml::MousePressEvent* e );
172 void slotOpenURLRequest( const KURL&, const KParts::URLArgs& );
176 void slotVSliderReleased();
177 void slotHSliderReleased();
178 void slotHideChildPopup();
179 void slotOnURL( const QString& url );
183 void mousePressed(); /* to KitaThreadView */
190 void hideChildPopup();
195 /*---------------------------------------------------*/
196 /*---------------------------------------------------*/
197 /*---------------------------------------------------*/
202 /* user defined events */
204 class GotoAnchorEvent : public QCustomEvent
210 GotoAnchorEvent( const QString& anc )
211 : QCustomEvent( EVENT_GotoAnchor ), m_anc( anc ) {};
213 const QString& getAnc() const { return m_anc; }