19 #include <kparts/part.h>
20 #include <kpluginfactory.h>
21 #include <kmessagewidget.h>
33 #include <QtDBus/QtDBus>
45 class KToggleFullScreenAction;
51 namespace KParts {
class GUIActivateEvent; }
57 class PresentationWidget;
71 class BrowserExtension;
99 Q_CLASSINFO(
"D-Bus Interface",
"org.kde.okular")
103 friend class PartTest;
113 Part(
QWidget* parentWidget,
QObject* parent, const QVariantList& args, KComponentData componentData);
119 void notifySetup( const
QVector< Okular::
Page * > &pages,
int setupFlags );
120 void notifyViewportChanged(
bool smoothMove );
121 void notifyPageChanged(
int page,
int flags );
123 bool openDocument(const KUrl& url, uint page);
124 void startPresentation();
127 KUrl realUrl() const;
129 void showSourceLocation(const
QString& fileName,
int line,
int column,
bool showGraphically = true);
130 void clearLastShownSourceLocation();
131 bool isWatchFileModeEnabled() const;
132 void setWatchFileModeEnabled(
bool enable);
133 bool areSourceLocationsShownGraphically() const;
134 void setShowSourceLocationsGraphically(
bool show);
135 bool openNewFilesInTabs() const;
138 Q_SCRIPTABLE Q_NOREPLY
void goToPage(uint page);
139 Q_SCRIPTABLE Q_NOREPLY
void openDocument( const
QString &doc );
140 Q_SCRIPTABLE uint pages();
141 Q_SCRIPTABLE uint currentPage();
142 Q_SCRIPTABLE
QString currentDocument();
143 Q_SCRIPTABLE
QString documentMetaData( const
QString &metaData ) const;
144 Q_SCRIPTABLE
void slotPreferences();
145 Q_SCRIPTABLE
void slotFind();
146 Q_SCRIPTABLE
void slotPrintPreview();
147 Q_SCRIPTABLE
void slotPreviousPage();
148 Q_SCRIPTABLE
void slotNextPage();
149 Q_SCRIPTABLE
void slotGotoFirst();
150 Q_SCRIPTABLE
void slotGotoLast();
151 Q_SCRIPTABLE
void slotTogglePresentation();
152 Q_SCRIPTABLE Q_NOREPLY
void reload();
153 Q_SCRIPTABLE Q_NOREPLY
void enableStartWithPrint();
156 void enablePrintAction(
bool enable);
157 void openSourceReference(const
QString& absFileName,
int line,
int column);
158 void viewerMenuStateChange(
bool enabled);
159 void enableCloseAction(
bool enable);
160 void mimeTypeChanged(KMimeType::Ptr mimeType);
161 void urlsDropped( const KUrl::List& urls );
166 bool openUrl(const KUrl &url);
167 void guiActivateEvent(KParts::GUIActivateEvent *event);
168 void displayInfoMessage( const
QString &message, KMessageWidget::MessageType messageType = KMessageWidget::Information,
int duration = -1 );;
173 bool closeUrl(
bool promptToSave);
174 void setReadWrite(
bool readwrite);
175 bool saveAs(const KUrl & saveUrl);
179 void openUrlFromDocument(const KUrl &url);
180 void openUrlFromBookmarks(const KUrl &url);
181 void handleDroppedUrls( const KUrl::List& urls );
183 void slotHistoryBack();
184 void slotHistoryNext();
185 void slotAddBookmark();
186 void slotRenameBookmarkFromMenu();
187 void slotRenameCurrentViewportBookmark();
188 void slotAboutToShowContextMenu(KMenu *menu,
QAction *action,
QMenu *contextMenu);
189 void slotPreviousBookmark();
190 void slotNextBookmark();
193 void slotSaveFileAs();
194 void slotSaveCopyAs();
195 void slotGetNewStuff();
196 void slotNewConfig();
197 void slotShowMenu(const Okular::
Page *page, const
QPoint &point);
198 void slotShowProperties();
199 void slotShowEmbeddedFiles();
200 void slotShowLeftPanel();
201 void slotShowBottomBar();
202 void slotShowPresentation();
203 void slotHidePresentation();
205 bool slotImportPSFile();
206 void slotAboutBackend();
210 void slotShowFindBar();
211 void slotHideFindBar();
212 void slotJobStarted(KIO::Job *job);
213 void slotJobFinished(KJob *job);
214 void loadCancelled(const
QString &reason);
215 void setWindowTitleFromDocument();
217 void updateViewActions();
218 void updateBookmarksActions();
219 void enableTOC(
bool enable);
220 void slotRebuildBookmarkMenu();
225 void restoreDocument(const KConfigGroup &group);
226 void saveDocumentRestoreInfo(KConfigGroup &group);
227 void slotFileDirty( const
QString& );
228 void slotDoFileDirty();
229 void psTransformEnded(
int,
QProcess::ExitStatus);
230 KConfigDialog * slotGeneratorPreferences();
232 void errorMessage( const QString &message,
int duration = 0 );
233 void warningMessage( const QString &message,
int duration = -1 );
234 void noticeMessage( const QString &message,
int duration = -1 );
237 Document::OpenResult doOpenFile(const KMimeType::Ptr &mime, const QString &fileNameToOpen,
bool *isCompressedFile);
239 void setupViewerActions();
240 void setViewerShortcuts();
243 void setupPrint(
QPrinter &printer );
245 bool handleCompressed( QString &destpath, const QString &path, const QString &compressedMimetype );
246 void rebuildBookmarkMenu(
bool unplugActions = true );
247 void updateAboutBackendAction();
248 void unsetDummyMode();
250 void resetStartArguments();
252 static
int numberOfParts;
254 KTemporaryFile *m_tempfile;
258 QString m_temporaryLocalFile;
259 bool isDocumentArchive;
263 SearchWidget *m_searchWidget;
265 KMessageWidget * m_topMessage;
266 KMessageWidget * m_formsMessage;
267 KMessageWidget * m_infoMessage;
268 QPointer<ThumbnailList> m_thumbnailList;
271 QPointer<MiniBarLogic> m_miniBarLogic;
275 QPointer<PresentationWidget> m_presentationWidget;
276 QPointer<ProgressWidget> m_progressWidget;
277 QPointer<PageSizeLabel> m_pageSizeLabel;
279 QPointer<BookmarkList> m_bookmarkList;
282 KDirWatch *m_watcher;
286 bool m_wasPresentationOpen;
287 int m_dirtyToolboxIndex;
288 bool m_wasSidebarVisible;
289 bool m_wasSidebarCollapsed;
290 bool m_fileWasRemoved;
300 KAction *m_beginningOfDocument;
301 KAction *m_endOfDocument;
302 KAction *m_historyBack;
303 KAction *m_historyNext;
304 KAction *m_addBookmark;
305 KAction *m_renameBookmark;
306 KAction *m_prevBookmark;
307 KAction *m_nextBookmark;
309 KAction *m_selectAll;
314 KAction *m_saveCopyAs;
315 KAction *m_printPreview;
316 KAction *m_showProperties;
317 KAction *m_showEmbeddedFiles;
319 QAction *m_exportAsText;
320 QAction *m_exportAsDocArchive;
321 KAction *m_showPresentation;
322 KToggleAction* m_showMenuBarAction;
323 KToggleAction* m_showLeftPanel;
324 KToggleAction* m_showBottomBar;
325 KToggleFullScreenAction* m_showFullScreenAction;
326 KAction *m_aboutBackend;
328 QMenu *m_exportAsMenu;
329 KAction *m_closeFindBar;
331 bool m_actionsSearched;
335 QList<QAction*> m_bookmarkActions;
336 bool m_cliPresentation;
338 QString m_addBookmarkText;
339 QIcon m_addBookmarkIcon;
346 FileKeeper *m_keeper;
352 void slotAnnotationPreferences();
353 void slotHandleActivatedSourceReference(const QString& absFileName,
int line,
int col,
bool *handled);
365 virtual QObject *create(
const char *iface,
QWidget *parentWidget,
QObject *parent,
const QVariantList &args,
const QString &keyword);
EmbedMode
Describes the possible embedding modes of the part.
Abstract interface for a document viewer.
Collector for all the data belonging to a page.
#define OKULAR_PART_EXPORT
Base class for objects being notified when something changes.
Abstract interface for controlling advanced features of a document viewer.