// ------------------- KTextDocumentLayout -------------------- KTextDocumentLayout::KTextDocumentLayout(QTextDocument *doc, KTextDocumentLayout::LayoutState *layout) : QAbstractTextDocumentLayout(doc), m_state(layout), d(new Private(this)) { d->paintDevice = new KPostscriptPaintDevice(); setPaintDevice(d->paintDevice); if (m_state == 0) m_state = new LayoutStateDummy(); connect (this, SIGNAL(finishedLayout()), this, SLOT(postLayoutHook())); connect(this, SIGNAL(finishedLayout()), SLOT(adjustSize())); }
ShrinkToFitShapeContainer::ShrinkToFitShapeContainer(KoShape *childShape, KoDocumentResourceManager *documentResources) : KoShapeContainer(*(new ShrinkToFitShapeContainerPrivate(this, childShape))) { Q_UNUSED(documentResources); Q_D(ShrinkToFitShapeContainer); setPosition(childShape->position()); setSize(childShape->size()); setZIndex(childShape->zIndex()); setRunThrough(childShape->runThrough()); rotate(childShape->rotation()); //setTransformation(childShape->transformation()); if (childShape->parent()) { childShape->parent()->addShape(this); childShape->setParent(0); } childShape->setPosition(QPointF(0.0,0.0)); // since its relative to my position, this won't move it childShape->setSelectable(false); // our ShrinkToFitShapeContainer will handle that from now on d->model = new ShrinkToFitShapeContainerModel(this, d); addShape(childShape); QSet<KoShape*> delegates; delegates << childShape; setToolDelegates(delegates); KoTextShapeData* data = dynamic_cast<KoTextShapeData*>(childShape->userData()); Q_ASSERT(data); KoTextDocumentLayout *lay = qobject_cast<KoTextDocumentLayout*>(data->document()->documentLayout()); Q_ASSERT(lay); QObject::connect(lay, SIGNAL(finishedLayout()), static_cast<ShrinkToFitShapeContainerModel*>(d->model), SLOT(finishedLayout())); }
KHTMLImage::KHTMLImage( QWidget *parentWidget, QObject *parent, KHTMLPart::GUIProfile prof ) : KParts::ReadOnlyPart( parent ), m_image( 0 ) { KHTMLPart* parentPart = qobject_cast<KHTMLPart*>( parent ); setComponentData( KHTMLImageFactory::componentData(), prof == KHTMLPart::BrowserViewGUI && !parentPart ); KVBox *box = new KVBox( parentWidget ); box->setAcceptDrops( true ); m_khtml = new KHTMLPart( box, this, prof ); m_khtml->setAutoloadImages( true ); // We do not want our subpart to be destroyed when its widget is, // since that may cause all KHTMLParts to die when we're dealing // with m_khtml->setAutoDeletePart( false ); connect( m_khtml->view(), SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition()) ); setWidget( box ); // VBox can't take focus, so pass it on to sub-widget box->setFocusProxy( m_khtml->widget() ); m_ext = new KHTMLImageBrowserExtension( this ); m_ext->setObjectName( "be" ); m_sbExt = new KParts::StatusBarExtension( this ); m_sbExt->setObjectName( "sbe" ); // Remove unnecessary actions. delete actionCollection()->action( "setEncoding" ); delete actionCollection()->action( "viewDocumentSource" ); delete actionCollection()->action( "selectAll" ); // forward important signals from the khtml part // forward opening requests to parent frame (if existing) KHTMLPart *p = qobject_cast<KHTMLPart*>(parent); KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext; connect(m_khtml->browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), be, SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments))); connect(m_khtml->browserExtension(), SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)), this, SLOT(slotPopupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap))); connect( m_khtml->browserExtension(), SIGNAL(enableAction(const char*,bool)), m_ext, SIGNAL(enableAction(const char*,bool)) ); m_ext->setURLDropHandlingEnabled( true ); }
ResultsView::ResultsView( QWidget *parent, const char *name ) : KHTMLPart( parent, parent ) , _scrollValue( 0 ) { ////////setReadOnly(true); /* TODO: configurably underlined links */ // setLinkUnderline(false); //KDE4 CHANGE ////////basicMode = false; // don't let ktextbrowser internally handle link clicks ////////setNotifyClick(true); connect( view(), SIGNAL(finishedLayout()), this, SLOT(doScroll()) ); }
IndexGeneratorManager::IndexGeneratorManager(QTextDocument *document) : QObject(document) , m_document(document) , m_state(FirstRunNeeded) { m_documentLayout = static_cast<KoTextDocumentLayout *>(document->documentLayout()); // connect to layoutIsDirty connect(m_documentLayout, SIGNAL(layoutIsDirty()), this, SLOT(requestGeneration())); // connect to FinishedLayout connect(m_documentLayout, SIGNAL(finishedLayout()), this, SLOT(startDoneTimer())); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(timeout())); m_updateTimer.setInterval(5000); // after 5 seconds of pause we update m_updateTimer.setSingleShot(true); connect(&m_doneTimer, SIGNAL(timeout()), this, SLOT(layoutDone())); m_doneTimer.setInterval(1000); // after 1 seconds of silence we assume layout is done m_doneTimer.setSingleShot(true); }
EvaChatView::EvaChatView( TQWidget * parent, const char * name ) : TDEHTMLPart(parent, name), menu(NULL), d(0), buffer(""), m_isScrollAtBottom(true) { //setOnlyLocalReferences(true); menu = new TDEPopupMenu(0, "popup"); copyAction = KStdAction::copy( this, SLOT(copy()), actionCollection()); copyAction->setText(i18n("&Copy Text")); copyAction->setShortcut( TDEShortcut("Ctrl+C")); setDNDEnabled(true); setAutoloadImages(true); view()->setHScrollBarMode(TQScrollView::AlwaysOff); //setStandardFont("Helvetica"); //buffer += "<body style=\"font-size:9pt;font-family:Helvetica\">"; TQObject::connect(view(), SIGNAL(finishedLayout()), SLOT(slotScrollToBottom())); TQObject::connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); TQObject::connect(this, SIGNAL(popupMenu(const TQString &, const TQPoint &)), SLOT(slotPopupMenu(const TQString &, const TQPoint &))); TQObject::connect(browserExtension(), SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)), SLOT(slotLinkClicked( const KURL &, const KParts::URLArgs &))); }