/* private */
void KitaHTMLPart::clearPart()
{
-
slotDeletePopup();
/* delete KitaDomTree */
emit updateSubjectTab( m_datURL );
}
}
+
m_datURL = QString::null;
m_mode = HTMLPART_MODE_MAINPART;
}
/* private */
void KitaHTMLPart::connectSignals()
{
-
Kita::SignalCollection * signalCollection = Kita::SignalCollection::getInstance();
-
/* rendering */
connect( this, SIGNAL( redrawHTMLPart( const KURL&, bool ) ), signalCollection, SIGNAL( redrawHTMLPart( const KURL&, bool ) ) );
connect( signalCollection, SIGNAL( redrawHTMLPart( const KURL&, bool ) ), SLOT( slotRedrawHTMLPart( const KURL& , bool ) ) );
connect( signalCollection, SIGNAL( kitaIsActive() ), SLOT( slotKitaIsActive() ) );
connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
-
/* click */
connect( this, SIGNAL( openURLRequestExt(
const KURL&, const KParts::URLArgs&, QString, int,
const KURL& , const KParts::URLArgs&, QString, int,
const KURL& ) ) );
-
/* write dock */
connect( this, SIGNAL( activateThreadView( const KURL& ) ),
signalCollection, SIGNAL( activateThreadView( const KURL& ) ) );
/* public slot */
void KitaHTMLPart::slotClickGotoFooter()
{
- if ( !m_domtree
- || m_mode != HTMLPART_MODE_MAINPART
- ) {
+ if ( !m_domtree || m_mode != HTMLPART_MODE_MAINPART ) {
gotoAnchor( "footer", FALSE );
return ;
}
/* scroll & select & return */
if ( m_findPos != -1 ) {
-
int matchLen = regexp.matchedLength();
QRect qr = m_findNode.getRect();
return TRUE;
}
- }
-
- /*------------------------*/
- else if ( m_findNode.nodeName().string() == "table" ) {
+ } else if ( m_findNode.nodeName().string() == "table" ) {
QRect qr = m_findNode.getRect();
m_find_y = qr.bottom();
- }
- /*------------------------*/
- else if ( m_findNode.nodeName().string() == "div" ) {
+ } else if ( m_findNode.nodeName().string() == "div" ) {
QRect qr = m_findNode.getRect();
- if ( reverse ) m_find_y = qr.bottom();
- else m_find_y = qr.top();
- }
+ if ( reverse ) {
+ m_find_y = qr.bottom();
+ } else {
+ m_find_y = qr.top();
+ }
- /*------------------------*/
- else if ( m_findNode.nodeName().string() == "br" ) {
+ } else if ( m_findNode.nodeName().string() == "br" ) {
DOM::Node tmpnode = m_findNode.previousSibling();
while ( !m_findNode.isNull() && next.isNull() ) {
m_findNode = m_findNode.parentNode();
- if ( !m_findNode.isNull() ) next = m_findNode.nextSibling();
+ if ( !m_findNode.isNull() ) {
+ next = m_findNode.nextSibling();
+ }
}
}
/* revearse */
while ( !m_findNode.isNull() && next.isNull() ) {
m_findNode = m_findNode.parentNode();
- if ( !m_findNode.isNull() ) next = m_findNode.previousSibling();
+ if ( !m_findNode.isNull() ) {
+ next = m_findNode.previousSibling();
+ }
}
}
}
}
-
/* end */
popupMenu->insertItem( i18n( "End" ), ID_End_Link );
}
if ( i != -1 ) {
refNum = refstr.left( i ).toInt();
refNum2 = refstr.mid( i + 1 ).toInt();
- if ( refNum2 < refNum ) refNum2 = refNum;
- } else refNum = refNum2 = refstr.toInt();
+ if ( refNum2 < refNum ) {
+ refNum2 = refNum;
+ }
+ } else {
+ refNum = refNum2 = refstr.toInt();
+ }
if ( !refNum ) return ;
if ( m_mode == HTMLPART_MODE_POPUP ) {
emit openURLRequestExt( urlin );
- } else gotoAnchor( QString().setNum( refNum ), TRUE );
+ } else {
+ gotoAnchor( QString().setNum( refNum ), TRUE );
+ }
}
BEMENU_COPYURL,
BEMENU_SHOWBROWSER
};
-
+
QClipboard * clipboard = QApplication::clipboard();
-
+
popupMenu->insertItem( i18n( "copy URL" ), BEMENU_COPYURL );
popupMenu->insertItem( i18n( "Open with Web Browser" ), BEMENU_SHOWBROWSER );
-
+
/*--------------------------------------*/
/* show popup menu */
-
+
int ret = popupMenu->exec( QCursor::pos() );
delete popupMenu;
switch ( ret ) {
-
+
case BEMENU_COPYURL:
/* copy */
clipboard->setText( strURL, QClipboard::Clipboard );
clipboard->setText( strURL, QClipboard::Selection );
break;
-
+
case BEMENU_SHOWBROWSER:
emit openURLRequestExt( strURL, KParts::URLArgs(), "text/html" );
break;
-
+
default:
break;
}
if ( m_popup && m_popup->isVisible() ) {
m_multiPopup = TRUE;
m_popup->moveMouseAbove();
- } else m_multiPopup = FALSE;
+ } else {
+ m_multiPopup = FALSE;
+ }
return m_multiPopup;
}
/* Is it multi-popup mode now ? */ /* private */
bool KitaHTMLPart::isMultiPopupMode()
{
- if ( !m_popup ) m_multiPopup = FALSE;
- else if ( m_popup->isHidden() ) m_multiPopup = FALSE;
+ if ( !m_popup ) {
+ m_multiPopup = FALSE;
+ } else if ( m_popup->isHidden() ) {
+ m_multiPopup = FALSE;
+ }
return m_multiPopup;
}
-
/* private */
void KitaHTMLPart::hidePopup()
{
- if ( m_popup ) m_popup->hide();
+ if ( m_popup ) {
+ m_popup->hide();
+ }
m_multiPopup = FALSE;
}
-
-
/* return TRUE if this view is under mouse. */ /* private */
bool KitaHTMLPart::isUnderMouse( int mrgwd, int mrght )
{
return FALSE;
}
-
/* private slot */
void KitaHTMLPart::slotLeave()
{
hidePopup();
/* emit signal to have parent hide this if this is popup . */
- if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) emit hideChildPopup();
+ if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) {
+ emit hideChildPopup();
+ }
}
-
/* private slot */
void KitaHTMLPart::slotVSliderReleased()
{
-
QScrollBar * bar = view() ->verticalScrollBar();
QRect rt = bar->sliderRect();
int mrg = rt.right() - rt.left();
hidePopup();
/* emit signal to have parent hide this if this is popup . */
- if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( mrg, 0 ) ) emit hideChildPopup();
+ if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( mrg, 0 ) ) {
+ emit hideChildPopup();
+ }
}
/* private slot */
void KitaHTMLPart::slotHSliderReleased()
{
-
QScrollBar * bar = view() ->horizontalScrollBar();
QRect rt = bar->sliderRect();
int mrg = rt.bottom() - rt.top();
hidePopup();
/* emit signal to have parent hide this if this is popup . */
- if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, mrg ) ) emit hideChildPopup();
+ if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, mrg ) ) {
+ emit hideChildPopup();
+ }
}
hidePopup();
/* emit signal to have parent hide this if this is popup . */
- if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) emit hideChildPopup();
+ if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) {
+ emit hideChildPopup();
+ }
}
/* get reference */
QString refstr;
KURL datURL = m_datURL;
- if ( url.at( 0 ) == '#' ) refstr = url.mid( 1 );
- else datURL = Kita::getDatURL( KURL( m_datURL, url ) , refstr );
+ if ( url.at( 0 ) == '#' ) {
+ refstr = url.mid( 1 );
+ } else {
+ datURL = Kita::getDatURL( KURL( m_datURL, url ) , refstr );
+ }
/*------------------------*/
/* id popup */
if ( url.left( 6 ) == "#idpop" ) {
int num = Kita::DatManager::getNumByID( m_datURL, url.mid( 6 ) );
QString tmpstr;
- if ( num >= 2 ) tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
- else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+ if ( num >= 2 ) {
+ tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
+ } else {
+ tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+ }
showPopup( m_datURL, tmpstr );
return ;
}
int num = 0;
Kita::DatManager::getTreeByRes( m_datURL, no, num );
QString tmpstr;
- if ( num ) tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
- else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+ if ( num ) {
+ tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
+ } else {
+ tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+ }
showPopup( m_datURL, tmpstr );
return ;
}
return FALSE;
}
-
-
-
-
-/*--------------------------------------------------------------*/
-/*--------------------------------------------------------------*/
-/* class ResPopup */
-
-