for ( int i = startnum ; i <= endnum; i++ ) m_domtree->appendRes( i );
}
-
-/* do parsing only. */
-/* call showResponses() later */ /* public */
-void KitaPreviewPart::parseResponses( int startnum, int endnum )
-{
- if ( !m_domtree ) return ;
-
- for ( int i = startnum ; i <= endnum; i++ ) m_domtree->createResElement( i );
-}
-
-
-/*------------------------------------------------*/
-/* Show all responses ,header, footer, and etc,
- if these are not shown. */
-
-/* note that updateScreen() is called internally. */
-/* So, you need not call it later. */ /* public slot */
-void KitaPreviewPart::showAll()
-{
- if ( !m_domtree ) return ;
-
- int bottom = m_domtree->getBottomResNumber();
- int readNum = Kita::DatManager::getReadNum( m_datURL );
- if ( bottom != readNum ) {
-
- QCursor qc; qc.setShape( Qt::WaitCursor );
- QApplication::setOverrideCursor( qc );
-
- showResponses( 1, readNum );
- updateScreen( TRUE, FALSE );
-
- QApplication::restoreOverrideCursor();
- }
-}
-
/*-------------------*/
/* update screen */ /* public */
void KitaPreviewPart::updateScreen( bool showHeaderEtc, bool clock )
/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
-/* cache functions */
-
-
-/*----------------------------------*/
-/* load thread from cache & show it */ /* public */
-
-/* top = centerNum - preShowNum
- bottom = centerNum + afterShowNum
- readNum = Kita::DatManager::getReadNum
-
- No.1 <- show -> No.20 <- not show -> No.(top) <- show -> No.(bottom) <- not show -> No.(readNum) */
-
-bool KitaPreviewPart::load( int centerNum )
-{
- m_centerNum = centerNum;
- m_jumpNumAfterLoading = 0;
-
- return FALSE;
-}
-
-
-
-/*----------------------------*/
-/* start reloading */
-
-/* see also slotReceiveData()
- and slotFinishLoad(). */ /* public */
-bool KitaPreviewPart::reload( int jumpNum )
-{
- if ( !m_domtree ) return FALSE;
-
- /* If this is not MainPart, then open MainPart. */
- emit openURLRequestExt( m_datURL );
- return FALSE;
-}
-
-/*---------------------------------------------------------------*/
-/*---------------------------------------------------------------*/
/* goto anchor */
return TRUE;
}
-
-
-/* jump to kokomade yonda */ /* public slot */
-void KitaPreviewPart::slotGotoKokoyon()
-{
- return ;
-}
-
-
-
-/* public slot */
-void KitaPreviewPart::slotGobackAnchor()
-{
- if ( m_anchorStack.empty() ) return ;
-
- QString anc = m_anchorStack.last();
- m_anchorStack.pop_back();
- gotoAnchor( anc , FALSE );
-}
-
-
-
-
/* private */
void KitaPreviewPart::pushCurrentPosition()
{
return static_cast<DOM::Element>( node ).getAttribute( "id" ).string();
}
-/* public slot */
-void KitaPreviewPart::slotClickGotoFooter()
-{
- gotoAnchor( "footer", FALSE );
-}
-
-
/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
/* search */
m_find_y = 0;
}
-
-
-/* public */
-bool KitaPreviewPart::findText( const QString &query, bool reverse )
-{
- return FALSE;
-}
-
-
-
-
-
-
/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
/* popup menu */
/*-------------------------------------------------------*/
/* click */
-
-
-/* private slot */
-void KitaPreviewPart::slotOpenURLRequest( const KURL& urlin, const KParts::URLArgs& )
-{
- clickAnchor( urlin );
-}
-
-
/*------------------------------------------------------*/
/* This function is called when user clicked res anchor */ /* private */
void KitaPreviewPart::clickAnchor( const KURL& urlin )
/*-------------------------------------------------------*/
/* popup */
-
-/* public */
-bool KitaPreviewPart::isPopupVisible()
-{
- if ( !m_popup ) return FALSE;
- return m_popup->isVisible();
-}
-
-
-/* public slot */
void KitaPreviewPart::slotDeletePopup()
{
if ( m_popup ) delete m_popup;
m_multiPopup = FALSE;
}
-
-/* for convenience */ /* public slot */
-void KitaPreviewPart::slotShowResPopup( QPoint point, int refNum, int refNum2 )
-{
- QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum2 );
- if ( innerHTML == QString::null ) return ;
-
- showPopupCore( m_datURL, innerHTML, point );
-}
-
-
/* for convenience */ /* private */
void KitaPreviewPart::showPopup( const KURL& url, const QString& innerHTML )
{
m_multiPopup = FALSE;
}
-
-
-/* return TRUE if this view is under mouse. */ /* private */
-bool KitaPreviewPart::isUnderMouse( int mrgwd, int mrght )
-{
- QPoint pos = QCursor::pos();
- int cx = pos.x(), cy = pos.y();
-
- QPoint viewpos = view() ->mapToGlobal( QPoint( 0, 0 ) );
- int px = viewpos.x(), py = viewpos.y();
- int wd = view() ->visibleWidth(), ht = view() ->visibleHeight();
-
- if ( ( px < cx && cx < px + wd + mrgwd )
- && ( py < cy && cy < py + ht + mrght ) ) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-
/* private slot */
void KitaPreviewPart::slotLeave()
{
if ( innerHTML != QString::null ) showPopup( datURL, innerHTML );
}
-
-
-
-/* If selected Text is composed of only digits,
- then show res popup. */ /* private */
-bool KitaPreviewPart::showSelectedDigitPopup()
-{
- if ( !hasSelection() ) return FALSE;
-
- QString linkstr;
- int refNum;
- QString selectText = selectedText();
- const QChar *chpt = selectText.unicode();
- unsigned int length = selectText.length();
-
- if ( ( refNum = Kita::stringToPositiveNum( chpt, length ) ) != -1 ) {
- QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum );
- if ( innerHTML != QString::null ) {
- showPopup( m_datURL, innerHTML );
- startMultiPopup();
- return TRUE;
- }
- }
-
- return FALSE;
-}
/* rendering */
void showResponses( int startnum, int endnum );
- void parseResponses( int startnum, int endnum );
- void showAll();
void updateScreen( bool showHeaderEtc, bool clock );
void setInnerHTML( const QString& innerHTML );
- /* cache */
- bool load( int centerNum );
- bool reload( int jumpNum );
-
/* goto anchor */
bool gotoAnchor( const QString& anc, bool pushPosition );
- /* search */
- bool findText( const QString &query, bool reverse );
-
- /* popup */
- bool isPopupVisible();
-
public slots:
/* rendering */
void slotSetFaceOfHTMLPart();
void slotSetStyleSheetOfHTMLPart();
- /* goto anchor */
- void slotGotoKokoyon();
- void slotGobackAnchor();
-
- /* Tugi100, Mae100 etc. */
- void slotClickGotoFooter();
-
/* res popup */
void slotDeletePopup();
- void slotShowResPopup( QPoint point, int refNum, int refNum2 );
private:
bool startMultiPopup();
bool isMultiPopupMode();
void hidePopup();
- bool isUnderMouse( int mrgwd, int mrght );
- bool showSelectedDigitPopup();
protected:
private slots:
- /* click */
- void slotOpenURLRequest( const KURL&, const KParts::URLArgs& );
-
/* res popup */
void slotLeave();
void slotVSliderReleased();
signals:
- void openWriteDialog( QString );
void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
QString mimetype = QString::null,
int usr1 = 0,
void redrawHTMLPart( const KURL& url, bool force );
void mousePressed(); /* to KitaThreadView */
- /* cache */
- void receiveData();
- void finishReload();
-
/* res popup */
void hideChildPopup();
void isKitaActive();