📄 htmlview.cpp
字号:
emit documentDone( _view );}void KHTMLView::slotDocumentDone(){ // Scroll to where we want to go if ( scrollToX ) { if ( displayHScroll ) slotScrollHorz( scrollToX ); scrollToX = 0; } if ( scrollToY ) { if ( displayVScroll ) slotScrollVert( scrollToY ); scrollToY = 0; } // debug( "emit documentDone( this );" ); emit documentDone( this );}void KHTMLView::slotDocumentRequest( KHTMLView *_view, const char *_url ){ emit documentRequest( _view, _url );}void KHTMLView::slotCancelDocumentRequest( KHTMLView *_view, const char *_url ){ emit cancelDocumentRequest( _view, _url );}void KHTMLView::slotSetTitle( const char *_text ){ emit setTitle( _text );}void KHTMLView::slotURLSelected( KHTMLView *_view, const char *_url, int _button, const char *_target ){ // debugT("URL selected '%s'\n",_url ); emit URLSelected( _view, _url, _button, _target );}void KHTMLView::slotURLSelected( const char *_url, int _button, const char *_target ){ // debugT("URL 2 selected '%s'\n",_url ); emit URLSelected( this, _url, _button, _target );}void KHTMLView::slotOnURL( KHTMLView *_view, const char *_url ){ // debugT("On URL '%s'\n",_url ); emit onURL( _view, _url );}void KHTMLView::slotOnURL( const char *_url ){ // debugT("On URL 2 '%s'\n",_url); emit onURL( this, _url );}void KHTMLView::slotTextSelected( bool _selected ){ emit textSelected( this, _selected );}void KHTMLView::slotPopupMenu( KHTMLView *_view, const char *_url, const QPoint &_point ){ emit popupMenu( _view, _url, _point );}void KHTMLView::slotPopupMenu( const char *_url, const QPoint &_point ){ emit popupMenu( this, _url, _point );}void KHTMLView::slotImageRequest( KHTMLView *_view, const char *_url ){ emit imageRequest( _view, _url );}void KHTMLView::slotImageRequest( const char *_url ){ emit imageRequest( this, _url ); emit imageRequest( _url );}void KHTMLView::slotCancelImageRequest( KHTMLView *_view, const char *_url ){ emit cancelImageRequest( _view, _url );}void KHTMLView::slotCancelImageRequest( const char *_url ){ emit cancelImageRequest( this, _url ); emit cancelImageRequest( _url );}void KHTMLView::slotImageLoaded( const char *_url, const char *_filename ){ if ( view ) view->slotFileLoaded( _url, _filename );}void KHTMLView::slotFormSubmitted( KHTMLView *_view, const char *_method, const char *_url, const char *_data ){ emit formSubmitted( _view, _url, _method, _data );}void KHTMLView::slotFormSubmitted( const char *_method, const char *_url, const char *_data ){ // debugT("Form submitted '%s'\n",_url); emit formSubmitted( this, _url, _method, _data );}void KHTMLView::slotGoUp(){ emit goUp( this ); emit goUp();}void KHTMLView::slotGoRight(){ emit goRight( this ); emit goRight();}void KHTMLView::slotGoLeft(){ emit goLeft( this ); emit goLeft();}int KHTMLView::xOffset(){ return view->xOffset();}int KHTMLView::yOffset(){ return view->yOffset();}const char* KHTMLView::getURL( QPoint & p ){ return view->getURL( p );}void KHTMLView::select( QRegExp& _pattern, bool _select ){ view->select( 0L, _pattern, _select );}void KHTMLView::openURL( const char *_url ){ // debug( "openURL : %s", _url ); emit documentRequest( this, _url );}bool KHTMLView::isFrameSet(){ return view->isFrameSet();}void KHTMLView::setIsFrameSet( bool _frameset ){ /* if ( _frameset ) { displayVScroll = FALSE; displayHScroll = FALSE; } */ view->setIsFrameSet( _frameset ); }bool KHTMLView::isFrame(){ return view->isFrame();}void KHTMLView::setIsFrame( bool _frame ){ // debugT(">>>>>>>>>>>>>>>> I am a frame %x <<<<<<<<<<<<<<<<<<\n",(int)this); /* if ( _frame ) { displayVScroll = FALSE; displayHScroll = FALSE; } */ view->setIsFrame( _frame ); }void KHTMLView::setSelected( bool _selected ){ view->setSelected( _selected ); if ( _selected ) emit frameSelected( this );}bool KHTMLView::isSelected(){ return view->isSelected();}KHTMLView* KHTMLView::getSelectedView(){ // debugT(">>>>>>>>>>>>>>>>>>>>>>>>>> HTMLView 1 <<<<<<<<<<<<<<<<<<<<<<<<\n"); if ( isFrame() && isSelected() ) return this; // debugT(">>>>>>>>>>>>>>>>>>>>>>>>>> HTMLView 2 <<<<<<<<<<<<<<<<<<<<<<<<\n"); if ( isFrameSet() ) return view->getSelectedFrame(); // debugT(">>>>>>>>>>>>>>>>>>>>>>>>>> HTMLView 3 <<<<<<<<<<<<<<<<<<<<<<<<\n"); return 0L;}void KHTMLView::slotVertSubtractLine(){ if ( vert->isVisible() ) vert->subtractLine ();}void KHTMLView::slotVertAddLine(){ if ( vert->isVisible() ) vert->addLine ();}void KHTMLView::slotVertSubtractPage(){ if ( vert->isVisible() ) vert->subtractPage ();}void KHTMLView::slotVertAddPage(){ if ( vert->isVisible() ) vert->addPage ();} bool KHTMLView::mouseMoveHook( QMouseEvent * ){ return FALSE;}bool KHTMLView::mouseReleaseHook( QMouseEvent * ){ return FALSE;}bool KHTMLView::mousePressedHook( const char*, const char*, QMouseEvent*, bool ){ return FALSE;}bool KHTMLView::dndHook( const char *, QPoint & ){ return FALSE;}void KHTMLView::select( QPainter * _painter, QRect &_rect ){ view->select( _painter, _rect );}void KHTMLView::select( QPainter * _painter, bool _select ){ view->select( _painter, _select );}void KHTMLView::selectByURL( QPainter *_painter,const char *_url,bool _select ){ view->selectByURL( _painter, _url, _select );}void KHTMLView::getSelected( QStrList &_list ){ view->getSelected( _list );}void KHTMLView::getSelectedText( QString &_str ){ view->getSelectedText( _str );}bool KHTMLView::isTextSelected() const{ return view->isTextSelected();}void KHTMLView::findTextBegin(){ view->findTextBegin();}bool KHTMLView::findTextNext( const QRegExp &exp ){ return view->findTextNext( exp );}void KHTMLView::findTextEnd(){ view->findTextEnd();}void KHTMLView::setMarginWidth( int _w ){ view->setMarginWidth( _w );}void KHTMLView::setMarginHeight( int _h ){ view->setMarginHeight( _h );}bool KHTMLView::gotoAnchor(const char* anchor){ return view->gotoAnchor(anchor);}bool KHTMLView::gotoXY(int _x, int _y){ if ( !displayVScroll ) _y = 0; if ( !displayHScroll ) _x = 0; return view->gotoXY(_x, _y);}void KHTMLView::setCharset( const char *_c){ view->setCharset(_c);}void KHTMLView::setOverrideCharset(const char *name){ view->setOverrideCharset(name);}KHTMLView* KHTMLView::topView(){ KHTMLView *v = this; while( v->getParentView() ) v = v->getParentView(); return v;}void KHTMLView::data( const char *_url, const char *_data, int _len, bool _eof ){ view->data( _url, _data, _len, _eof );}SavedPage * KHTMLView::saveYourself(){ SavedPage *p = new SavedPage(); p->isFrame = isFrame(); p->frameName = frameName; p = view->saveYourself(p); KURL url(p->url); if(url.isMalformed()) return 0; return p;}void KHTMLView::restore(SavedPage *p){ KHTMLView *v; KHTMLView *top = findView( "_top" ); for ( v = viewList->first(); v != 0; v = viewList->next() ) { if ( v->getFrameName() ) { if ( strcmp( v->getFrameName(), p->frameName ) == 0 ) if( top != v->findView( "_top" ) ) continue; else break; } } if(v) v->view->restore( p ); else view->restore( p );}void KHTMLView::restorePosition( int x, int y ){ view->restorePosition( x, y );}#include "htmlview.moc"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -