okular
document.cpp
Go to the documentation of this file.
101 AllocatedPixmap( DocumentObserver *o, int p, qulonglong m ) : observer( o ), page( p ), memory( m ) {}
132 QSet< DocumentObserver * >::const_iterator it=d->m_observers.constBegin(), end=d->m_observers.constEnd();\
136 QSet< DocumentObserver * >::const_iterator it = m_observers.constBegin(), end = m_observers.constEnd();\
166 const QPrinter::Orientation orientation = inchesWidth > inchesHeight ? QPrinter::Landscape : QPrinter::Portrait;
181 if (inchesWidth > definedPaperSize.width() * lowerBoundFactor && inchesWidth < definedPaperSize.width() * upperBoundFactor
182 && inchesHeight > definedPaperSize.height() * lowerBoundFactor && inchesHeight < definedPaperSize.height() * upperBoundFactor)
193 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A0") : i18nc("paper size", "portrait DIN/ISO A0");
195 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A1") : i18nc("paper size", "portrait DIN/ISO A1");
197 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A2") : i18nc("paper size", "portrait DIN/ISO A2");
199 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A3") : i18nc("paper size", "portrait DIN/ISO A3");
201 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A4") : i18nc("paper size", "portrait DIN/ISO A4");
203 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A5") : i18nc("paper size", "portrait DIN/ISO A5");
205 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A6") : i18nc("paper size", "portrait DIN/ISO A6");
207 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A7") : i18nc("paper size", "portrait DIN/ISO A7");
209 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A8") : i18nc("paper size", "portrait DIN/ISO A8");
211 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO A9") : i18nc("paper size", "portrait DIN/ISO A9");
213 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B0") : i18nc("paper size", "portrait DIN/ISO B0");
215 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B1") : i18nc("paper size", "portrait DIN/ISO B1");
217 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B2") : i18nc("paper size", "portrait DIN/ISO B2");
219 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B3") : i18nc("paper size", "portrait DIN/ISO B3");
221 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B4") : i18nc("paper size", "portrait DIN/ISO B4");
223 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B5") : i18nc("paper size", "portrait DIN/ISO B5");
225 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B6") : i18nc("paper size", "portrait DIN/ISO B6");
227 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B7") : i18nc("paper size", "portrait DIN/ISO B7");
229 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B8") : i18nc("paper size", "portrait DIN/ISO B8");
231 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B9") : i18nc("paper size", "portrait DIN/ISO B9");
233 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DIN/ISO B10") : i18nc("paper size", "portrait DIN/ISO B10");
235 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape letter") : i18nc("paper size", "portrait letter");
237 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape legal") : i18nc("paper size", "portrait legal");
239 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape executive") : i18nc("paper size", "portrait executive");
241 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape C5E") : i18nc("paper size", "portrait C5E");
243 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape Comm10E") : i18nc("paper size", "portrait Comm10E");
245 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape DLE") : i18nc("paper size", "portrait DLE");
247 return orientation == QPrinter::Landscape ? i18nc("paper size", "landscape folio") : i18nc("paper size", "portrait folio");
251 return orientation == QPrinter::Landscape ? i18nc("paper size", "ledger") : i18nc("paper size", "tabloid");
253 return orientation == QPrinter::Landscape ? i18nc("paper size", "unknown landscape paper size") : i18nc("paper size", "unknown portrait paper size");
275 return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 x %2 in (%3)", inchesWidth, inchesHeight, namePaperSize(inchesWidth, inchesHeight));
279 return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 x %2 mm (%3)", QString::number(inchesWidth * 25.4, 'd', 0), QString::number(inchesHeight * 25.4, 'd', 0), namePaperSize(inchesWidth, inchesHeight));
299 if (m_allocatedPixmapsTotalMemory > thirdTotalMemory) memoryToFree = m_allocatedPixmapsTotalMemory - thirdTotalMemory;
300 if (m_allocatedPixmapsTotalMemory > freeMemory) clipValue = (m_allocatedPixmapsTotalMemory - freeMemory) / 2;
307 if (m_allocatedPixmapsTotalMemory > freeMemory) clipValue = (m_allocatedPixmapsTotalMemory - freeMemory) / 2;
314 const qulonglong memoryLimit = qMin( qMax( freeMemory, getTotalMemory()/2 ), freeMemory+freeSwap );
315 if (m_allocatedPixmapsTotalMemory > memoryLimit) clipValue = (m_allocatedPixmapsTotalMemory - memoryLimit) / 2;
339 QVector< Okular::VisiblePageRect * >::const_iterator vIt = m_pageRects.constBegin(), vEnd = m_pageRects.constEnd();
404 //p--rintf("freeMemory A:[%d -%d = %d] \n", m_allocatedPixmaps.count() + pagesFreed, pagesFreed, m_allocatedPixmaps.count() );
413 AllocatedPixmap * DocumentPrivate::searchLowestPriorityPixmap( bool unloadableOnly, bool thenRemoveIt, DocumentObserver *observer )
733 && ( view->capabilityFlags( View::Zoom ) & ( View::CapabilityRead | View::CapabilitySerializable ) ) )
742 && ( view->capabilityFlags( View::ZoomModality ) & ( View::CapabilityRead | View::CapabilitySerializable ) ) )
755 && ( view->capabilityFlags( View::Zoom ) & ( View::CapabilityRead | View::CapabilitySerializable ) )
757 && ( view->capabilityFlags( View::ZoomModality ) & ( View::CapabilityRead | View::CapabilitySerializable ) ) )
837 QHash< QString, GeneratorInfo >::const_iterator genIt = m_loadedGenerators.constFind( propName );
888 bool DocumentPrivate::openDocumentInternal( const KService::Ptr& offer, bool isstdin, const QString& docFile, const QByteArray& filedata )
891 QHash< QString, GeneratorInfo >::const_iterator genIt = m_loadedGenerators.constFind( propName );
915 QObject::connect( m_generator, SIGNAL(error(QString,int)), m_parent, SIGNAL(error(QString,int)) );
916 QObject::connect( m_generator, SIGNAL(warning(QString,int)), m_parent, SIGNAL(warning(QString,int)) );
917 QObject::connect( m_generator, SIGNAL(notice(QString,int)), m_parent, SIGNAL(notice(QString,int)) );
988 QVector< Page * >::const_iterator pIt = m_pagesVector.constBegin(), pEnd = m_pagesVector.constEnd();
1007 DocumentViewport vp( m_generator->metaData( "NamedViewport", m_nextDocumentDestination ).toString() );
1026 KMessageBox::information( m_parent->widget(), i18n("Your annotation changes will not be saved automatically. Use File -> Save As...\nor your changes will be lost once the document is closed"), QString(), "annotNeedSaveAs" );
1031 KMessageBox::information( m_parent->widget(), i18n("Your annotations are saved internally by Okular.\nYou can export the annotated document using File -> Export As -> Document Archive"), QString(), "annotExportAsArchive" );
1106 void DocumentPrivate::performModifyPageAnnotation( int page, Annotation * annotation, bool appearanceChanged )
1150 void DocumentPrivate::performSetAnnotationContents( const QString & newContents, Annotation *annot, int pageNumber )
1216 QVector< Page * >::const_iterator pIt = m_pagesVector.constBegin(), pEnd = m_pagesVector.constEnd();
1230 // <general info><history> ... </history> save history up to OKULAR_HISTORY_SAVEDSTEPS viewports
1311 QRect requestRect = r->isTile() ? r->normalizedRect().geometry( r->width(), r->height() ) : QRect( 0, 0, r->width(), r->height() );
1312 TilesManager *tilesManager = ( r->observer() == m_tiledObserver ) ? r->page()->d->tilesManager() : 0;
1322 else if ( ( !r->d->mForce && r->page()->hasPixmap( r->observer(), r->width(), r->height(), r->normalizedRect() ) ) || !m_observers.contains(r->observer()) )
1327 else if ( !r->d->mForce && r->preload() && qAbs( r->pageNumber() - currentViewportPage ) >= maxDistance )
1334 else if ( tilesManager && tilesManager->isRequesting( r->normalizedRect(), r->width(), r->height() ) )
1340 else if ( !tilesManager && r->observer() == m_tiledObserver && m_generator->hasFeature( Generator::TiledRendering ) && (long)r->width() * (long)r->height() > 8000000L )
1350 tilesManager = new TilesManager( r->pageNumber(), pixmap->width(), pixmap->height(), r->page()->rotation() );
1357 tilesManager = new TilesManager( r->pageNumber(), r->width(), r->height(), r->page()->rotation() );
1369 const QList<Tile> tiles = tilesManager->tilesAt( r->normalizedRect(), TilesManager::TerminalTile );
1434 TilesManager * tm = ( request->observer() == m_tiledObserver ) ? request->page()->d->tilesManager() : 0;
1446 QRect requestRect = !request->isTile() ? QRect(0, 0, request->width(), request->height() ) : request->normalizedRect().geometry( request->width(), request->height() );
1447 kDebug(OkularDebug).nospace() << "sending request observer=" << request->observer() << " " <<requestRect.width() << "x" << requestRect.height() << "@" << request->pageNumber() << " async == " << request->asynchronous() << " isTile == " << request->isTile();
1512 QHash< QString, GeneratorInfo >::iterator it = m_loadedGenerators.begin(), itEnd = m_loadedGenerators.end();
1526 QVector<Page*>::const_iterator it = m_pagesVector.constBegin(), end = m_pagesVector.constEnd();
1553 QMap< DocumentObserver*, PagePrivate::PixmapObject >::ConstIterator it = page->d->m_pixmaps.constBegin(), itEnd = page->d->m_pixmaps.constEnd();
1557 PixmapRequest * p = new PixmapRequest( it.key(), pageNumber, size.width(), size.height(), 1, PixmapRequest::Asynchronous );
1567 PixmapRequest * p = new PixmapRequest( m_tiledObserver, pageNumber, tilesManager->width(), tilesManager->height(), 1, PixmapRequest::Asynchronous );
1573 QVector< Okular::VisiblePageRect * >::const_iterator vIt = m_pageRects.constBegin(), vEnd = m_pageRects.constEnd();
1610 void DocumentPrivate::doContinueDirectionMatchSearch(void *doContinueDirectionMatchSearchStruct)
1612 DoContinueDirectionMatchSearchStruct *searchStruct = static_cast<DoContinueDirectionMatchSearchStruct *>(doContinueDirectionMatchSearchStruct);
1638 const QString question = searchStruct->forward ? i18n("End of document reached.\nContinue from the beginning?") : i18n("Beginning of document reached.\nContinue from the bottom?");
1639 if ( searchStruct->noDialogs || KMessageBox::questionYesNo(m_parent->widget(), question, QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::Yes )
1656 searchStruct->match = page->findText( searchStruct->searchID, searchStruct->text, searchStruct->forward ? FromTop : FromBottom, searchStruct->caseSensitivity );
1670 QMetaObject::invokeMethod(m_parent, "doContinueDirectionMatchSearch", Qt::QueuedConnection, Q_ARG(void *, searchStruct));
1674 doProcessSearchMatch( searchStruct->match, search, searchStruct->pagesToNotify, searchStruct->currentPage, searchStruct->searchID, searchStruct->moveViewport, searchStruct->color );
1679 void DocumentPrivate::doProcessSearchMatch( RegularAreaRect *match, RunningSearch *search, QSet< int > *pagesToNotify, int currentPage, int searchID, bool moveViewport, const QColor & color )
1729 void DocumentPrivate::doContinueAllDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QString & text, int theCaseSensitivity, const QColor & color)
1731 QMap< Page *, QVector<RegularAreaRect *> > *pageMatches = static_cast< QMap< Page *, QVector<RegularAreaRect *> > * >(pageMatchesMap);
1778 QMetaObject::invokeMethod(m_parent, "doContinueAllDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotifySet), Q_ARG(void *, pageMatches), Q_ARG(int, currentPage + 1), Q_ARG(int, searchID), Q_ARG(QString, text), Q_ARG(int, caseSensitivity), Q_ARG(QColor, color));
1817 void DocumentPrivate::doContinueGooglesDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QStringList & words, int theCaseSensitivity, const QColor & color, bool matchAll)
1820 QMap< Page *, QVector<MatchColor> > *pageMatches = static_cast< QMap< Page *, QVector<MatchColor> > * >(pageMatchesMap);
1898 QMetaObject::invokeMethod(m_parent, "doContinueGooglesDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotifySet), Q_ARG(void *, pageMatches), Q_ARG(int, currentPage + 1), Q_ARG(int, searchID), Q_ARG(QStringList, words), Q_ARG(int, caseSensitivity), Q_ARG(QColor, color), Q_ARG(bool, matchAll));
2007 d->m_viewportIterator = d->m_viewportHistory.insert( d->m_viewportHistory.end(), DocumentViewport() );
2013 connect( d->m_undoStack, SIGNAL( canRedoChanged(bool) ), this, SIGNAL( canRedoChanged(bool) ) );
2023 QSet< View * >::const_iterator viewIt = d->m_views.constBegin(), viewEnd = d->m_views.constEnd();
2034 QHash< QString, GeneratorInfo >::const_iterator it = d->m_loadedGenerators.constBegin(), itEnd = d->m_loadedGenerators.constEnd();
2060 bool Document::openDocument( const QString & docFile, const KUrl& url, const KMimeType::Ptr &_mime )
2118 KService::List offers = KMimeTypeTrader::self()->query(mime->name(),"okular/Generator",constraint);
2143 emit error( i18n( "Can not find a plugin which is able to handle the document being passed." ), -1 );
2221 d->m_annotationsNeedSaveAs = ( d->canAddAnnotationsNatively() && containsExternalAnnotations );
2269 const QStringList docScripts = d->m_generator->metaData( "DocumentScripts", "JavaScript" ).toStringList();
2362 QHash< QString, GeneratorInfo >::const_iterator genIt = d->m_loadedGenerators.constFind( d->m_generatorName );
2450 QVector<Page*>::const_iterator it = d->m_pagesVector.constBegin(), end = d->m_pagesVector.constEnd();
2487 QVector<Page*>::const_iterator it = d->m_pagesVector.constBegin(), end = d->m_pagesVector.constEnd();
2574 if ( !d->m_generator || !d->m_generator->hasFeature( Generator::FontInfo ) || d->m_fontThread )
2592 connect( d->m_fontThread, SIGNAL(gotFont(Okular::FontInfo)), this, SLOT(fontReadingGotFont(Okular::FontInfo)) );
2634 void Document::setVisiblePageRects( const QVector< VisiblePageRect * > & visiblePageRects, DocumentObserver *excludeObserver )
2791 void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests, PixmapRequestFlags reqOptions )
2799 QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
2807 // FIXME This assumes all requests come from the same observer, that is true atm but not enforced anywhere
2811 QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
2817 QLinkedList< PixmapRequest * >::iterator sIt = d->m_pixmapRequestsStack.begin(), sEnd = d->m_pixmapRequestsStack.end();
2832 QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
2837 kDebug(OkularDebug).nospace() << "request observer=" << request->observer() << " " <<request->width() << "x" << request->height() << "@" << request->pageNumber();
2852 const QList<Tile> tiles = request->page()->d->tilesManager()->tilesAt( request->normalizedRect(), TilesManager::TerminalTile );
2959 kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties has already been called since last call to Document::modifyPageAnnotationProperties";
2970 kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
2983 void Document::translatePageAnnotation(int page, Annotation* annotation, const NormalizedPoint & delta )
2986 QUndoCommand *uc = new Okular::TranslateAnnotationCommand( d, annotation, page, delta, complete );
2998 QUndoCommand *uc = new EditAnnotationContentsCommand( d, annotation, page, newContents, newCursorPos,
3033 d->m_undoStack->beginMacro(i18nc("remove a collection of annotations from the page", "remove annotations"));
3058 iface->annotationProxy() && iface->annotationProxy()->supports(AnnotationProxy::Modification) )
3128 void Document::setViewport( const DocumentViewport & viewport, DocumentObserver *excludeObserver, bool smoothMove )
3237 void Document::searchText( int searchID, const QString & text, bool fromStart, Qt::CaseSensitivity caseSensitivity,
3243 if ( !d->m_generator || !d->m_generator->hasFeature( Generator::TextExtraction ) || d->m_pagesVector.isEmpty() )
3259 connect(this, SIGNAL(searchFinished(int,Okular::Document::SearchStatus)), searchDialog, SLOT(deleteLater()));
3304 QMap< Page *, QVector<RegularAreaRect *> > *pageMatches = new QMap< Page *, QVector<RegularAreaRect *> >;
3307 QMetaObject::invokeMethod(this, "doContinueAllDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotify), Q_ARG(void *, pageMatches), Q_ARG(int, 0), Q_ARG(int, searchID), Q_ARG(QString, text), Q_ARG(int, caseSensitivity), Q_ARG(QColor, color));
3317 int currentPage = fromStart ? fromStartSearchPage : ((s->continueOnPage != -1) ? s->continueOnPage : viewportPage);
3328 match = lastPage->findText( searchID, text, forward ? NextResult : PreviousResult, caseSensitivity, &s->continueOnMatch );
3337 DoContinueDirectionMatchSearchStruct *searchStruct = new DoContinueDirectionMatchSearchStruct();
3350 QMetaObject::invokeMethod(this, "doContinueDirectionMatchSearch", Qt::QueuedConnection, Q_ARG(void *, searchStruct));
3357 QMap< Page *, QVector< QPair<RegularAreaRect *, QColor> > > *pageMatches = new QMap< Page *, QVector<QPair<RegularAreaRect *, QColor> > >;
3361 QMetaObject::invokeMethod(this, "doContinueGooglesDocumentSearch", Qt::QueuedConnection, Q_ARG(void *, pagesToNotify), Q_ARG(void *, pageMatches), Q_ARG(int, 0), Q_ARG(int, searchID), Q_ARG(QStringList, words), Q_ARG(int, caseSensitivity), Q_ARG(QColor, color), Q_ARG(bool, matchAll));
3452 QUndoCommand *uc = new EditFormTextCommand( this, form, pageNumber, newContents, newCursorPos, form->text(), prevCursorPos, prevAnchorPos );
3483 QUndoCommand *uc = new EditFormComboCommand( this, form, pageNumber, newText, newCursorPos, prevText, prevCursorPos, prevAnchorPos );
3487 void Document::editFormButtons( int pageNumber, const QList< FormFieldButton* >& formButtons, const QList< bool >& newButtonStates )
3489 QUndoCommand *uc = new EditFormButtonsCommand( this, pageNumber, formButtons, newButtonStates );
3625 KMessageBox::information( widget(), i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that.") );
3633 KMessageBox::information( widget(), i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that.") );
3646 KMessageBox::information( widget(), i18n( "No application found for opening file of mimetype %1.", mime->name() ) );
3793 QHash< int, QString >::const_iterator it = editors.constFind( SettingsCore::externalEditor() );
3822 const SourceReference * Document::dynamicSourceReference( int pageNr, double absX, double absY )
3827 QMetaObject::invokeMethod( d->m_generator, "dynamicSourceReference", Qt::DirectConnection, Q_RETURN_ARG(const Okular::SourceReference*, ref), Q_ARG(int, pageNr), Q_ARG(double, absX), Q_ARG(double, absY) );
3869 QMetaObject::invokeMethod( d->m_generator, "printError", Qt::DirectConnection, Q_RETURN_ARG(Okular::Generator::PrintError, err) );
3891 return i18n( "Could not find a suitable binary for printing. Make sure CUPS lpr binary is available" );
3918 QString constraint( "([X-KDE-Priority] > 0) and (exist Library) and ([X-KDE-okularHasInternalSettings])" );
3945 QString constraint( "([X-KDE-Priority] > 0) and (exist Library) and ([X-KDE-okularHasInternalSettings])" );
3976 QHash< QString, GeneratorInfo >::const_iterator genIt = d->m_loadedGenerators.constFind( d->m_generatorName );
3993 QHash< QString, GeneratorInfo >::iterator genIt = d->m_loadedGenerators.find( d->m_generatorName );
4031 QHash< QString, GeneratorInfo >::iterator genIt = d->m_loadedGenerators.find( d->m_generatorName );
4078 QMetaObject::invokeMethod(d->m_generator, "requestFontData", Qt::DirectConnection, Q_ARG(Okular::FontInfo, font), Q_ARG(QByteArray *, &result));
4099 std::auto_ptr< QIODevice > mainEntryDevice( static_cast< const KZipFileEntry * >( mainEntry )->createDevice() );
4142 std::auto_ptr< QIODevice > docEntryDevice( static_cast< const KZipFileEntry * >( docEntry )->createDevice() );
4151 std::auto_ptr< QIODevice > metadataEntryDevice( static_cast< const KZipFileEntry * >( metadataEntry )->createDevice() );
4163 const KMimeType::Ptr docMime = KMimeType::findByPath( tempFileName, 0, true /* local file */ );
4281 if (currentPage->orientation() == Okular::Rotation90 || currentPage->orientation() == Okular::Rotation270) qSwap(width, height);
4333 const TilesManager *tm = ( req->observer() == m_tiledObserver ) ? req->page()->d->tilesManager() : 0;
4339 AllocatedPixmap * memoryPage = new AllocatedPixmap( req->observer(), req->pageNumber(), memoryBytes );
4378 // TODO: For generators that generate the bbox by pixmap scanning, if the first generated pixmap is very small, the bounding box will forever be inaccurate.
4379 // TODO: Crop computation should also consider annotations, actions, etc. to make sure they're not cropped away.
4380 // TODO: Help compute bounding box for generators that create a QPixmap without a QImage, like text and plucker.
4453 foreachObserverD( notifyContentsCleared( DocumentObserver::Pixmap | DocumentObserver::Highlights | DocumentObserver::Annotations ) );
4484 foreachObserver( notifyContentsCleared( DocumentObserver::Pixmap | DocumentObserver::Highlights ) );
void editFormList(int pageNumber, Okular::FormFieldChoice *form, const QList< int > &newChoices)
Edit the selected list entries in form on page page to be newChoices.
Definition: document.cpp:3456
bool savePageDocumentInfo(KTemporaryFile *infoFile, int what) const
Definition: document.cpp:972
Generator * loadGeneratorLibrary(const KService::Ptr &service)
Definition: document.cpp:798
QString execute(ScriptType type, const QString &script)
Definition: scripter.cpp:46
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
void cleanupPixmapMemory(qulonglong numberOfBytes, const NormalizedRect &visibleRect, int visiblePageNumber)
Removes at least numberOfBytes bytes worth of tiles (least ranked tiles are removed first)...
Definition: tilesmanager.cpp:449
void error(const QString &text, int duration)
This signal is emitted whenever an error occurred.
virtual bool exportTo(const QString &fileName, const ExportFormat &format)
This method is called to export the document in the given format and save it under the given fileName...
Definition: generator.cpp:339
virtual void setCapability(ViewCapability capability, const QVariant &option)
Sets a new value for the specified capability.
Definition: view.cpp:72
virtual PageSize::List pageSizes() const
Returns the list of supported page sizes.
Definition: generator.cpp:309
struct Okular::DocumentViewport::@1 autoFit
If 'autoFit.enabled == true' then the page must be autofitted in the viewport.
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition: generator.h:208
Definition: page_p.h:44
QList< ExportFormat > exportFormats() const
Returns the list of supported export formats.
Definition: document.cpp:2722
static AudioPlayer * instance()
Gets the instance of the audio player.
Definition: audioplayer.cpp:219
void startFontReading()
Starts the reading of the information about the fonts in the document, if available.
Definition: document.cpp:2572
void slotTimedMemoryCheck()
Definition: document.cpp:1275
Definition: generator_p.h:141
TilesManager * tilesManager() const
Get/set the tiles manager for the tiled observer.
Definition: page.cpp:1014
virtual void generateTextPage(Page *page)
This method can be called to trigger the generation of a text page for the given page.
Definition: generator.cpp:257
Definition: document_p.h:47
Highlighting information has been changed.
Definition: observer.h:44
void translatePageAnnotation(int page, Annotation *annotation, const Okular::NormalizedPoint &delta)
Translates the position of the given annotation on the given page by a distance delta in normalized c...
Definition: document.cpp:2983
void requestPixmaps(const QLinkedList< PixmapRequest * > &requests)
Sends requests for pixmap generation.
Definition: document.cpp:2786
Searching for the next result on the page, earlier result should be located so we search from the las...
Definition: global.h:37
DocumentViewport m_nextDocumentViewport
Definition: document_p.h:208
void performAddPageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1035
static NormalizedRect fromRotatedRect(const NormalizedRect &rect, Rotation rotation)
Returns a non rotated version of rect, which is rotated by rotation.
Definition: tilesmanager.cpp:581
void unregisterView(View *view)
Unregister the specified view from the current document.
Definition: document.cpp:4059
void linkEndPresentation()
This signal is emitted whenever an action requests an end presentation operation. ...
Page * page() const
Returns a pointer to the page where the pixmap shall be generated for.
Definition: generator.cpp:479
void setPageBoundingBox(int page, const NormalizedRect &boundingBox)
Sets the bounding box of the given page (in terms of upright orientation, i.e., Rotation0).
Definition: document.cpp:4365
void requestTextPage(uint number)
Sends a request for text page generation for the given page number.
Definition: document.cpp:2898
void notifyAnnotationChanges(int page)
Definition: document.cpp:2909
void setViewport(const DocumentViewport &viewport, DocumentObserver *excludeObserver=0, bool smoothMove=false)
Sets the current document viewport to the given viewport.
Definition: document.cpp:3128
void doProcessSearchMatch(RegularAreaRect *match, RunningSearch *search, QSet< int > *pagesToNotify, int currentPage, int searchID, bool moveViewport, const QColor &color)
Definition: document.cpp:1679
void sendGeneratorPixmapRequest()
Definition: document.cpp:1283
Rotation rotation() const
Returns the rotation of the page as defined by the user.
Definition: page.cpp:170
void sourceReferenceActivated(const QString &absFileName, int line, int col, bool *handled)
This signal is emitted whenever a source reference with the given parameters has been activated...
int column() const
Returns the column of the position in the source file.
Definition: sourcereference.cpp:55
QLinkedList< PixmapRequest * > m_executingPixmapRequests
Definition: document_p.h:217
virtual void rotationChanged(Rotation orientation, Rotation oldOrientation)
This method is called when the orientation has been changed by the user.
Definition: generator.cpp:305
virtual bool supportsCapability(ViewCapability capability) const
Query whether the view support the specified capability.
Definition: view.cpp:54
void modifyPageAnnotationProperties(int page, Annotation *annotation)
Modifies the given annotation on the given page.
Definition: document.cpp:2965
void loadServiceList(const KService::List &offers)
Definition: document.cpp:827
bool hasPixmap(DocumentObserver *observer, int width=-1, int height=-1, const NormalizedRect &rect=NormalizedRect()) const
Returns whether the page of size width x height has a pixmap in the region given by rect for the give...
Definition: page.cpp:218
bool m_annotationBeingMoved
Definition: document_p.h:272
virtual const QList< EmbeddedFile * > * embeddedFiles() const
Returns the 'list of embedded files' object of the document or 0 if no list of embedded files is avai...
Definition: generator.cpp:290
virtual bool isAllowed(Permission action) const
This method returns whether given action (Permission) is allowed in this document.
Definition: generator.cpp:300
const NormalizedRect & normalizedRect() const
Returns the normalized region of the page to request.
Definition: generator.cpp:502
bool canConfigurePrinter() const
Returns whether the document can configure the printer itself.
Definition: document.cpp:2518
BookmarkManager * bookmarkManager() const
Returns the bookmark manager of the document.
Definition: document.cpp:3493
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition: generator.cpp:211
virtual PageSizeMetric pagesSizeMetric() const
This method returns the metric of the page size.
Definition: generator.cpp:295
bool supportsPrintToFile() const
Returns whether the document supports printing to both PDF and PS files.
Definition: document.cpp:3854
Is being moved (mouse drag and drop). If ExternallyDrawn, the generator must not draw it...
Definition: annotations.h:136
void loadAllGeneratorLibraries()
Definition: document.cpp:815
void deletePixmap(DocumentObserver *observer)
Deletes the pixmap for the given observer.
Definition: page.cpp:722
Qt::CaseSensitivity caseSensitivity
Definition: document_p.h:76
bool exportToText(const QString &fileName) const
Exports the document as ASCII text and saves it under fileName.
Definition: document.cpp:2710
Whether the Generator can read a document directly from its raw data.
Definition: generator.h:203
KUrl currentDocument() const
Returns the url of the currently opened document.
Definition: document.cpp:2657
bool showCaption() const
Returns whether the caption shall be shown.
Definition: annotations.cpp:1396
PageSize::List pageSizes() const
Returns the list of supported page sizes or an empty list if this feature is not available.
Definition: document.cpp:2690
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
bool print(QPrinter &printer)
Prints the document to the given printer.
Definition: document.cpp:3859
QLinkedList< DocumentViewport > m_viewportHistory
Definition: document_p.h:206
qulonglong m_allocatedPixmapsTotalMemory
Definition: document_p.h:220
ExportFormat::List m_exportFormats
Definition: document_p.h:235
void close()
This signal is emitted whenever an action requests a document close operation.
Definition: area.h:860
void editPageAnnotationContents(int page, Annotation *annotation, const QString &newContents, int newCursorPos, int prevCursorPos, int prevAnchorPos)
Edits the plain text contents of the given annotation on the given page.
Definition: document.cpp:2990
virtual QVariant metaData(const QString &key, const QVariant &option) const
This method returns the meta data of the given key with the given option of the document.
Definition: generator.cpp:328
void saveDocumentInfo() const
Definition: document.cpp:1186
QStringList supportedMimeTypes() const
Returns the list with the supported MIME types.
Definition: document.cpp:3950
Whether the Generator can provide information about the fonts used in the document.
Definition: generator.h:204
void doContinueGooglesDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QStringList &words, int caseSensitivity, const QColor &color, bool matchAll)
Definition: document.cpp:1817
static QString getKeyTitle(Key key)
Returns the user visible string for the given key.
Definition: document.cpp:4726
void processRenditionAction(const Okular::RenditionAction *action)
This signal is emitted whenever an rendition action is triggered and the UI should process it...
Whether the Generator supports postscript-based file printing.
Definition: generator.h:207
bool hasTextPage() const
Returns whether the page provides a text page (TextPage).
Definition: page.cpp:244
void setContents(const QString &contents)
Sets the contents of the annotation.
Definition: annotations.cpp:539
QVariant documentMetaData(const QString &key, const QVariant &option) const
Request a particular metadata of the Document itself (ie, not something depending on the document typ...
Definition: document.cpp:1938
TextType textType() const
Returns the text type of the text annotation.
Definition: annotations.cpp:1024
BookmarkManager * m_bookmarkManager
Definition: document_p.h:239
bool openDocument(const QString &docFile, const KUrl &url, const KMimeType::Ptr &mime)
Opens the document.
Definition: document.cpp:2060
Definition: annotations.h:856
Searching from top of the page, next result is to be found, there was no earlier search result...
Definition: global.h:35
void canUndoChanged(bool undoAvailable)
This signal is emmitted whenever the availability of the undo function changes.
void setNextViewport()
Sets the current document viewport to the previous viewport in the viewport history.
Definition: document.cpp:3208
void stopFontReading()
Force the termination of the reading of the information about the fonts in the document, if running.
Definition: document.cpp:2598
void setNormalizedRect(const NormalizedRect &rect)
Sets the region of the page to request.
Definition: generator.cpp:494
QString printError() const
Returns the last print error in case print() failed.
Definition: document.cpp:3864
bool isOpened() const
Returns whether the document is currently opened.
Definition: document.cpp:2513
Rotation rotation() const
Returns the current rotation of the document.
Definition: document.cpp:2751
qulonglong getFreeMemory(qulonglong *freeSwap=0)
Definition: document.cpp:484
QPointer< FontExtractionThread > m_fontThread
Definition: document_p.h:263
Searching from bottom of the page, next result is to be found, there was no earlier search result...
Definition: global.h:36
void removeObserver(DocumentObserver *observer)
Unregisters the given observer for the document.
Definition: document.cpp:2444
VisiblePageRect(int pageNumber=-1, const NormalizedRect &rectangle=NormalizedRect())
Creates a new visible page rectangle.
Definition: document.cpp:4807
bool m_annotationEditingEnabled
Definition: document_p.h:270
void canRedoChanged(bool redoAvailable)
This signal is emmitted whenever the availability of the redo function changes.
Definition: generator.h:201
Document(QWidget *widget)
Creates a new document with the given widget as widget to relay GUI things (messageboxes, ...).
Definition: document.cpp:2002
Definition: pagecontroller_p.h:26
bool canProvideFontInformation() const
Whether the current document can provide information about the fonts used in it.
Definition: document.cpp:2609
bool canAddAnnotationsNatively() const
Definition: document.cpp:3042
void linkGoToPage()
This signal is emitted whenever an action requests a goto operation.
QWidget * printConfigurationWidget() const
Returns a custom printer configuration page or 0 if no custom printer configuration page is available...
Definition: document.cpp:3901
virtual void notifyViewportChanged(bool smoothMove)
This method is called whenever the viewport has been changed.
Definition: observer.cpp:27
QMap< int, RunningSearch * > m_searches
Definition: document_p.h:191
Searching for the previous result on the page, earlier result should be located so we search from the...
Definition: global.h:38
const Page * page(int number) const
Returns the page object for the given page number or 0 if the number is out of range.
Definition: document.cpp:2619
bool isExternal() const
Returns whether the goto action points to an external document.
Definition: action.cpp:110
virtual ExportFormat::List exportFormats() const
Returns the list of additional supported export formats.
Definition: generator.cpp:334
Set along with Annotations when Save As is needed or annotation changes will be lost.
Definition: observer.h:48
void saveViewsInfo(View *view, QDomElement &e) const
Definition: document.cpp:752
SaveInterface * generatorSave(GeneratorInfo &info)
Definition: document.cpp:878
virtual CapabilityFlags capabilityFlags(ViewCapability capability) const
Query the flags for the specified capability.
Definition: view.cpp:60
QString get(const QString &key) const
Returns the value for a given key or an empty string when the key doesn't exist.
Definition: document.cpp:4657
Abstract interface for configuration control.
Definition: configinterface.h:38
void linkFind()
This signal is emitted whenever an action requests a find operation.
QList< Tile > tilesAt(const NormalizedRect &rect, TileLeaf tileLeaf)
Returns a list of all tiles intersecting with rect.
Definition: tilesmanager.cpp:358
Generator can edit native annotations.
Definition: annotations.h:692
void performSetAnnotationContents(const QString &newContents, Annotation *annot, int pageNumber)
Definition: document.cpp:1150
virtual QString editChoice() const
The text entered into an editable combo box choice field.
Definition: form.cpp:242
void setBoundingBox(const NormalizedRect &bbox)
Sets the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright or...
Definition: page.cpp:205
void setRequest(const NormalizedRect &rect, int pageWidth, int pageHeight)
Sets a region to be requested so the tiles manager knows which pixmaps to expect and discard those no...
Definition: tilesmanager.cpp:539
bool isAllowed(Permission action) const
Returns whether the given action is allowed in the document.
Definition: document.cpp:2662
void setVisiblePageRects(const QVector< VisiblePageRect * > &visiblePageRects, DocumentObserver *excludeObserver=0)
Sets the list of visible page rectangles.
Definition: document.cpp:2634
const DocumentInfo * documentInfo() const
Returns the meta data of the document or 0 if no meta data are available.
Definition: document.cpp:2529
virtual SubType subType() const =0
Returns the sub type of the annotation.
QDomNode getAnnotationPropertiesDomNode() const
Retrieve the QDomNode representing this annotation's properties.
Definition: annotations.cpp:801
DocumentObserver * observer() const
Returns the observer of the request.
Definition: generator.cpp:444
KXMLGUIClient * guiClient()
This method requests the XML GUI Client provided by the interface.
Definition: guiinterface.h:50
void removePageAnnotation(int page, Annotation *annotation)
Removes the given annotation from the given page.
Definition: document.cpp:3025
void setRotation(int rotation)
This slot is called whenever the user changes the rotation of the document.
Definition: document.cpp:4426
void removePageAnnotations(int page, const QList< Annotation * > &annotations)
Removes the given annotations from the given page.
Definition: document.cpp:3031
QString pageSizeString(int page) const
Returns the size string for the given page or an empty string if the page is out of range...
Definition: document.cpp:2773
virtual void notifySetup(const QVector< Okular::Page * > &pages, int setupFlags)
This method is called whenever the document is initialized or reconstructed.
Definition: observer.cpp:23
RegularAreaRect * match
Definition: document_p.h:72
QString bookmarkedPageRange() const
Returns the range of the bookmarked.pages.
Definition: document.cpp:3514
The Goto action changes the viewport to another page or loads an external document.
Definition: action.h:115
QMap< DocumentObserver *, PixmapObject > m_pixmaps
Definition: page_p.h:119
bool saveDocumentArchive(const QString &fileName)
Saves a document archive.
Definition: document.cpp:4180
NormalizedRect boundingBox() const
Returns the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright...
Definition: page.cpp:195
DocumentViewport destViewport() const
Returns the document viewport the goto action points to.
Definition: action.cpp:122
void fontReadingProgress(int page)
Reports the progress when reading the fonts in the document.
bool canUndo() const
Returns true if there is an undo command available; otherwise returns false.
Definition: document.cpp:3091
void fontReadingGotFont(const Okular::FontInfo &font)
Definition: document.cpp:1497
void setZoom(int factor, DocumentObserver *excludeObserver=0)
Sets the zoom for the current document.
Definition: document.cpp:3183
Definition: page_p.h:47
virtual QWidget * printConfigurationWidget() const =0
Builds and returns a new printing configuration widget.
void setPageSize(const PageSize &size)
This slot is called whenever the user changes the page size of the document.
Definition: document.cpp:4458
The annotation is located next to the text.
Definition: annotations.h:740
bool openRelativeFile(const QString &fileName)
Definition: document.cpp:786
virtual void notifyVisibleRectsChanged()
This method is called whenever the visible rects have been changed.
Definition: observer.cpp:39
QSet< DocumentObserver * > m_observers
Definition: document_p.h:212
QList< int > bookmarkedPageList() const
Returns a list of the bookmarked.pages.
Definition: document.cpp:3498
bool canModifyExternalAnnotations() const
Definition: document.cpp:3053
QHash< QString, GeneratorInfo > m_loadedGenerators
Definition: document_p.h:245
QDomNode m_prevPropsOfAnnotBeingModified
Definition: document_p.h:276
QWidget * widget() const
Returns the widget to be used for relaying GUI things (messageboxes, ...)
Definition: document.cpp:2508
virtual const DocumentInfo * generateDocumentInfo()
Returns the general information object of the document or 0 if no information are available...
Definition: generator.cpp:275
virtual QStringList choices() const =0
The possible choices of the choice field.
bool operator<(const DocumentViewport &other) const
Definition: document.cpp:4599
bool openDocumentInternal(const KService::Ptr &offer, bool isstdin, const QString &docFile, const QByteArray &filedata)
Definition: document.cpp:888
DocumentViewport(int number=-1)
Creates a new viewport for the given page number.
Definition: document.cpp:4491
RegularAreaRect * findText(int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect=0) const
Returns the bounding rect of the text which matches the following criteria or 0 if the search is not ...
Definition: page.cpp:304
QString destinationName() const
Returns the document named destination the goto action points to.
Definition: action.cpp:128
bool removeAnnotation(Annotation *annotation)
Removes the annotation from the page.
Definition: page.cpp:661
Whether the Generator can change the size of the document pages.
Definition: generator.h:205
const QVector< VisiblePageRect * > & visiblePageRects() const
Returns the list of visible page rectangles.
Definition: document.cpp:2629
void processMovieAction(const Okular::MovieAction *action)
This signal is emitted whenever an movie action is triggered and the UI should process it...
QSet< int > * pagesToNotify
Definition: document_p.h:71
QRect geometry(int xScale, int yScale) const
Returns the rectangle that accrues when the normalized rectangle is multiplyed with the scaling xScal...
Definition: area.cpp:239
bool canModifyPageAnnotation(const Annotation *annotation) const
Tests if the annotation can be modified.
Definition: document.cpp:2929
int pageNumber
The number of the page nearest the center of the viewport.
Definition: document.h:1035
Abstract interface for advanced printing control.
Definition: printinterface.h:39
void setTextSelections(RegularAreaRect *areas, const QColor &color)
Sets the color and areas of text selections.
Definition: page.cpp:591
void searchFinished(int id, Okular::Document::SearchStatus endStatus)
Reports that the current search finished.
const KComponentData * componentData() const
Returns the component data associated with the generator.
Definition: document.cpp:3971
struct Okular::DocumentViewport::@0 rePos
If 'rePos.enabled == true' then this structure contains the viewport center or top left depending on ...
Is drawn externally (by the generator which provided it)
Definition: annotations.h:135
void rotationFinished(int page, Okular::Page *okularPage)
Definition: document.cpp:1475
PrintingType printingSupport() const
Returns what sort of printing the document supports: Native, Postscript, None.
Definition: document.cpp:3832
bool supportsPageSizes() const
Returns whether the document supports the listing of page sizes.
Definition: document.cpp:2680
QLinkedList< Annotation * > annotations() const
Returns the list of annotations of the page.
Definition: page.cpp:492
bool asynchronous() const
Returns whether the generation should be done synchronous or asynchronous.
Definition: generator.cpp:469
QString namePaperSize(double inchesWidth, double inchesHeight) const
Definition: document.cpp:159
The keywords which describe the content of the document.
Definition: document.h:1092
DocumentViewport nextDocumentViewport() const
Definition: document.cpp:1002
const DocumentSynopsis * documentSynopsis() const
Returns the table of content of the document or 0 if no table of content is available.
Definition: document.cpp:2567
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition: generator.h:206
bool hasFeature(GeneratorFeature feature) const
Query for the specified feature.
Definition: generator.cpp:344
void unloadGenerator(const GeneratorInfo &info)
Definition: document.cpp:846
const DocumentViewport & viewport() const
Returns the current viewport of the document.
Definition: document.cpp:2624
virtual void notifyCurrentPageChanged(int previous, int current)
This method is called after the current page of the document has been entered.
Definition: observer.cpp:52
Definition: document_p.h:83
bool preload() const
Returns whether the generation request is for a page that is not important i.e.
Definition: generator.cpp:474
A DOM tree containing information about the document.
Definition: document.h:1073
void editFormCombo(int pageNumber, Okular::FormFieldChoice *form, const QString &newText, int newCursorPos, int prevCursorPos, int prevAnchorPos)
Set the active choice in the combo box form on page page to newText The new cursor position (newCurso...
Definition: document.cpp:3465
void playSound(const Sound *sound, const SoundAction *linksound=0)
Enqueue the specified sound for playing, optionally taking more information about the playing from th...
Definition: audioplayer.cpp:225
QVariant metaData(const QString &key, const QVariant &option=QVariant()) const
Returns the meta data for the given key and option or an empty variant if the key doesn't exists...
Definition: document.cpp:2746
int priority() const
Returns the priority (less it better, 0 is maximum) of the request.
Definition: generator.cpp:464
virtual void notifyZoom(int factor)
This method is called whenever the zoom of the document has been changed.
Definition: observer.cpp:43
QString localizedSize(const QSizeF &size) const
Definition: document.cpp:260
void setPrevViewport()
Sets the current document viewport to the next viewport in the viewport history.
Definition: document.cpp:3191
bool m_showWarningLimitedAnnotSupport
Definition: document_p.h:273
void editFormText(int pageNumber, Okular::FormFieldText *form, const QString &newContents, int newCursorPos, int prevCursorPos, int prevAnchorPos)
Edit the text contents of the specified form on page page to be newContents.
Definition: document.cpp:3445
Definition: chooseenginedialog_p.h:20
QVector< VisiblePageRect * > m_pageRects
Definition: document_p.h:250
virtual bool print(QPrinter &printer)
This method is called to print the document to the given printer.
Definition: generator.cpp:318
bool canRemovePageAnnotation(const Annotation *annotation) const
Tests if the annotation can be removed.
Definition: document.cpp:3003
QLinkedList< DocumentViewport >::iterator m_viewportIterator
Definition: document_p.h:207
void set(const QString &key, const QString &value, const QString &title=QString())
Sets a value for a special key.
Definition: document.cpp:4628
virtual AnnotationProxy * annotationProxy() const =0
Returns the annotation proxy.
QByteArray fontData(const FontInfo &font) const
Gets the font data for the given font.
Definition: document.cpp:4072
qulonglong totalMemory() const
The total memory consumed by the tiles manager.
Definition: tilesmanager.cpp:444
void setSize(int width, int height)
Inform the new size of the page and mark all tiles to repaint.
Definition: tilesmanager.cpp:136
void linkPresentation()
This signal is emitted whenever an action requests a start presentation operation.
The possibility to save with the current changes to the document.
Definition: saveinterface.h:48
void processSourceReference(const SourceReference *reference)
Processes/Executes the given source reference.
Definition: document.cpp:3761
void performRemovePageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1068
void setNextDocumentViewport(const DocumentViewport &viewport)
Sets the next viewport in the viewport history.
Definition: document.cpp:3227
void setAnnotationEditingEnabled(bool enable)
Control annotation editing (creation, modification and removal), which is enabled by default...
Definition: document.cpp:4288
virtual bool loadDocumentFromData(const QByteArray &fileData, QVector< Page * > &pagesVector)
Loads the document from the raw data fileData and fills the pagesVector with the parsed pages...
Definition: generator.cpp:176
QString giveAbsolutePath(const QString &fileName) const
Definition: document.cpp:775
The page size is not defined in a physical metric.
Definition: generator.h:310
KXMLGUIClient * guiClient()
Returns the gui client of the generator, if it provides one.
Definition: document.cpp:2283
void textGenerationDone(Page *page)
Definition: document.cpp:4408
bool historyAtBegin() const
Returns whether the document history is at the begin.
Definition: document.cpp:2736
int configurableGenerators() const
Returns the number of generators that have a configuration widget.
Definition: document.cpp:3943
void calculateMaxTextPages()
Definition: document.cpp:4385
bool exportTo(const QString &fileName, const ExportFormat &format) const
Exports the document in the given format and saves it under fileName.
Definition: document.cpp:2731
bool canRemoveExternalAnnotations() const
Definition: document.cpp:3064
virtual void notifyPageChanged(int page, int flags)
This method is called whenever the content on page described by the passed flags has been changed...
Definition: observer.cpp:31
The creator of the document (this can be different from the author)
Definition: document.h:1084
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
bool isNull() const
Returns whether this normalized rectangle is a null normalized rect.
Definition: area.cpp:151
void fontReadingEnded()
Reports that the reading of the fonts in the document is finished.
virtual QList< int > currentChoices() const =0
The currently selected choices.
QTimer * m_saveBookmarksTimer
Definition: document_p.h:243
bool canExportToText() const
Returns whether the document supports the export to ASCII text.
Definition: document.cpp:2701
QLinkedList< AllocatedPixmap * > m_allocatedPixmaps
Definition: document_p.h:219
virtual void pageSizeChanged(const PageSize &pageSize, const PageSize &oldPageSize)
This method is called when the page size has been changed by the user.
Definition: generator.cpp:314
QSizeF allPagesSize() const
If all pages have the same size this method returns it, if the page sizes differ an empty size object...
Definition: document.cpp:2756
void slotGeneratorConfigChanged(const QString &)
Definition: document.cpp:1505
The capability is suitable for being serialized/deserialized.
Definition: view.h:57
virtual bool save(const QString &fileName, SaveOptions options, QString *errorText)=0
Save to the specified fileName with the specified options.
void performModifyPageAnnotation(int page, Annotation *annotation, bool appearanceChanged)
Definition: document.cpp:1106
AllocatedPixmap * searchLowestPriorityPixmap(bool unloadableOnly=false, bool thenRemoveIt=false, DocumentObserver *observer=0)
Definition: document.cpp:413
void searchText(int searchID, const QString &text, bool fromStart, Qt::CaseSensitivity caseSensitivity, SearchType type, bool moveViewport, const QColor &color, bool noDialogs=false)
Searches the given text in the document.
Definition: document.cpp:3237
The size of the pages (if all pages have the same size)
Definition: document.h:1095
QString parameters() const
Returns the parameters of the application to execute.
Definition: action.cpp:174
bool historyAtEnd() const
Returns whether the document history is at the end.
Definition: document.cpp:2741
void requestDone(PixmapRequest *request)
This method is used by the generators to signal the finish of the pixmap generation request...
Definition: document.cpp:4294
Okular::Sound * sound() const
Returns the sound object which contains the sound data.
Definition: action.cpp:358
void gotFont(const Okular::FontInfo &font)
Emitted when a new font is found during the reading of the fonts of the document. ...
Base class for objects being notified when something changes.
Definition: observer.h:28
virtual void generatePixmap(PixmapRequest *request)
This method can be called to trigger the generation of a new pixmap as described by request...
Definition: generator.cpp:217
void setPixmap(const QPixmap *pixmap, const NormalizedRect &rect)
Sets the pixmap of the tiles covered by rect (which represents the location of pixmap on the page)...
Definition: tilesmanager.cpp:188
void warnLimitedAnnotSupport()
Definition: document.cpp:1016
static QString getKeyString(Key key)
Returns the internal string for the given key.
Definition: document.cpp:4669
bool operator==(const DocumentViewport &other) const
Definition: document.cpp:4581
The Browse action browses an url by opening a web browser or email client, depedning on the url proto...
Definition: action.h:226
bool isTile() const
Returns whether the generator should render just the region given by normalizedRect() or the entire p...
Definition: generator.cpp:489
virtual bool supportsOption(SaveOption option) const =0
Query for the supported saving options.
The DocumentAction action contains an action that is performed on the current document.
Definition: action.h:265
void prepareToModifyAnnotationProperties(Annotation *annotation)
Prepares to modify the properties of the given annotation.
Definition: document.cpp:2954
void setNextDocumentDestination(const QString &namedDestination)
Sets the next namedDestination in the viewport history.
Definition: document.cpp:3232
void openUrl(const KUrl &url)
This signal is emitted whenever an action requests an open url operation for the given document url...
QMutex m_pixmapRequestsMutex
Definition: document_p.h:218
Definition: page_p.h:45
void editFormButtons(int pageNumber, const QList< Okular::FormFieldButton * > &formButtons, const QList< bool > &newButtonStates)
Set the states of the group of form buttons formButtons on page page to newButtonStates.
Definition: document.cpp:3487
bool isRequesting(const NormalizedRect &rect, int pageWidth, int pageHeight) const
Checks whether a given region has already been requested.
Definition: tilesmanager.cpp:534
bool saveChanges(const QString &fileName)
Save the document and the optional changes to it to the specified fileName.
Definition: document.cpp:4019
QString fileName() const
Returns the file name of the application to execute.
Definition: action.cpp:168
ConfigInterface * generatorConfig(GeneratorInfo &info)
Definition: document.cpp:868
Whether the Generator can render tiles.
Definition: generator.h:209
bool supportsTiles() const
Returns whether the current document supports tiles.
Definition: document.cpp:2685
void registerView(View *view)
Register the specified view for the current document.
Definition: document.cpp:4040
virtual QVariant capability(ViewCapability capability) const
Query the value of the specified capability.
Definition: view.cpp:66
bool canRedo() const
Returns true if there is a redo command available; otherwise returns false.
Definition: document.cpp:3096
bool moveViewport
Definition: document_p.h:77
void addPageAnnotation(int page, Annotation *annotation)
Adds a new annotation to the given page.
Definition: document.cpp:2919
QString pagesSizeString() const
Definition: document.cpp:144
bool extractLilyPondSourceReference(const QString &url, QString *file, int *row, int *col)
Definition: sourcereference.cpp:60
void addObserver(DocumentObserver *observer)
Registers a new observer for the document.
Definition: document.cpp:2431
Whether the Generator can extract text from the document in the form of TextPage's.
Definition: generator.h:202
void fillConfigDialog(KConfigDialog *dialog)
Fill the KConfigDialog dialog with the setting pages of the generators.
Definition: document.cpp:3912
The Rendition action executes an operation on a video or executes some JavaScript code on activation...
Definition: action.h:491
Rotation orientation() const
Returns the orientation of the page as defined by the document.
Definition: page.cpp:165
void addAnnotation(Annotation *annotation)
Adds a new annotation to the page.
Definition: page.cpp:641
bool supportsSearching() const
Returns whether the document supports searching.
Definition: document.cpp:2675
Generator can create native annotations.
Definition: annotations.h:691
const SourceReference * dynamicSourceReference(int pageNr, double absX, double absY)
Asks the generator to dynamically generate a SourceReference for a given page number and absolute X a...
Definition: document.cpp:3822
virtual bool reparseConfig()=0
This method is called to tell the generator to re-parse its configuration.
QList< int > m_allocatedTextPagesFifo
Definition: document_p.h:221
bool canSaveChanges() const
Returns whether the changes to the document (modified annotations, values in form fields...
Definition: document.cpp:3987
Document * viewDocument() const
Return the document which this view is associated to, or null if it is not associated with any docume...
Definition: view.cpp:44
Relative to the top left corner of the page.
Definition: document.h:1043
void quit()
This signal is emitted whenever an action requests an application quit operation. ...
Definition: annotations.h:731
Generator can remove native annotations.
Definition: annotations.h:693
Definition: page_p.h:51
PageController * m_pageController
Definition: document_p.h:255
virtual bool loadDocument(const QString &fileName, QVector< Page * > &pagesVector)=0
Loads the document with the given fileName and fills the pagesVector with the parsed pages...
QPrinter::Orientation orientation() const
Returns the orientation of the document (for printing purposes).
Definition: document.cpp:4266
void doContinueAllDocumentSearch(void *pagesToNotifySet, void *pageMatchesMap, int currentPage, int searchID, const QString &text, int caseSensitivity, const QColor &color)
Definition: document.cpp:1729
virtual const DocumentSynopsis * generateDocumentSynopsis()
Returns the 'table of content' object of the document or 0 if no table of content is available...
Definition: generator.cpp:280
bool closeDocument()
This method is called when the document is closed and not used any longer.
Definition: generator.cpp:181
int row() const
Returns the row of the position in the source file.
Definition: sourcereference.cpp:50
DocumentObserver * m_tiledObserver
Definition: document_p.h:215
void continueSearch(int searchID)
Continues the search for the given searchID.
Definition: document.cpp:3365
Definition: scripter.h:24
const QList< EmbeddedFile * > * embeddedFiles() const
Returns the list of embedded files or 0 if no embedded files are available.
Definition: document.cpp:2614
QString m_nextDocumentDestination
Definition: document_p.h:209
QStringList m_supportedMimeTypes
Definition: document_p.h:253
void fontReadingProgress(int page)
Definition: document.cpp:1485
DocumentActionType documentActionType() const
Returns the type of action.
Definition: action.cpp:247
A DOM tree that describes the Table of Contents.
Definition: document.h:1154
void loadViewsInfo(View *view, const QDomElement &e)
Definition: document.cpp:719
bool openDocumentArchive(const QString &docFile, const KUrl &url)
Opens a document archive.
Definition: document.cpp:4084
void setPageTextSelection(int page, RegularAreaRect *rect, const QColor &color)
Sets the text selection for the given page.
Definition: document.cpp:3075
void doContinueDirectionMatchSearch(void *doContinueDirectionMatchSearchStruct)
Definition: document.cpp:1610
int selectedGenerator() const
Definition: chooseenginedialog.cpp:43
void resetSearch(int searchID)
Resets the search for the given searchID.
Definition: document.cpp:3401
void setViewportPage(int page, DocumentObserver *excludeObserver=0, bool smoothMove=false)
Sets the current document viewport to the given page.
Definition: document.cpp:3116
QLinkedList< PixmapRequest * > m_pixmapRequestsStack
Definition: document_p.h:216
Remove all the previous requests, even for non requested page pixmaps.
Definition: document.h:350
The date of last modification of the document.
Definition: document.h:1089
virtual void addPages(KConfigDialog *dialog)=0
This method allows the generator to add custom configuration pages to the config dialog of okular...
void setTile(bool tile)
Sets whether the generator should render only the given normalized rect or the entire page...
Definition: generator.cpp:484
virtual bool supports(Capability capability) const =0
Query for the supported capabilities.
void setRotationInternal(int r, bool notify)
Definition: document.cpp:4431
bool m_annotationsNeedSaveAs
Definition: document_p.h:271
qulonglong calculateMemoryToFree()
Definition: document.cpp:283
The producer of the document (e.g. some software)
Definition: document.h:1085
int m_maxAllocatedTextPages
Definition: document_p.h:222
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.