19 #include <kparts/part.h>
20 #include <kpluginfactory.h>
32 #include <QtDBus/QtDBus>
44 class KToggleFullScreenAction;
50 namespace KParts {
class GUIActivateEvent; }
56 class PageViewTopMessage;
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();
125 QStringList supportedMimeTypes() const;
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);
137 Q_SCRIPTABLE Q_NOREPLY
void goToPage(uint page);
138 Q_SCRIPTABLE Q_NOREPLY
void openDocument( const QString &doc );
139 Q_SCRIPTABLE uint pages();
140 Q_SCRIPTABLE uint currentPage();
141 Q_SCRIPTABLE QString currentDocument();
142 Q_SCRIPTABLE QString documentMetaData( const QString &metaData ) const;
143 Q_SCRIPTABLE
void slotPreferences();
144 Q_SCRIPTABLE
void slotFind();
145 Q_SCRIPTABLE
void slotPrintPreview();
146 Q_SCRIPTABLE
void slotPreviousPage();
147 Q_SCRIPTABLE
void slotNextPage();
148 Q_SCRIPTABLE
void slotGotoFirst();
149 Q_SCRIPTABLE
void slotGotoLast();
150 Q_SCRIPTABLE
void slotTogglePresentation();
151 Q_SCRIPTABLE Q_NOREPLY
void reload();
152 Q_SCRIPTABLE Q_NOREPLY
void enableStartWithPrint();
155 void enablePrintAction(
bool enable);
156 void openSourceReference(const QString& absFileName,
int line,
int column);
157 void viewerMenuStateChange(
bool enabled);
158 void enableCloseAction(
bool enable);
163 bool openUrl(const KUrl &url);
164 void guiActivateEvent(KParts::GUIActivateEvent *event);
169 bool closeUrl(
bool promptToSave);
170 void setReadWrite(
bool readwrite);
171 bool saveAs(const KUrl & saveUrl);
175 void openUrlFromDocument(const KUrl &url);
176 void openUrlFromBookmarks(const KUrl &url);
178 void slotHistoryBack();
179 void slotHistoryNext();
180 void slotAddBookmark();
181 void slotRenameBookmarkFromMenu();
182 void slotRenameCurrentViewportBookmark();
183 void slotAboutToShowContextMenu(KMenu *menu, QAction *action, QMenu *contextMenu);
184 void slotPreviousBookmark();
185 void slotNextBookmark();
188 void slotSaveFileAs();
189 void slotSaveCopyAs();
190 void slotGetNewStuff();
191 void slotNewConfig();
192 void slotShowMenu(const Okular::
Page *page, const QPoint &point);
193 void slotShowProperties();
194 void slotShowEmbeddedFiles();
195 void slotShowLeftPanel();
196 void slotShowBottomBar();
197 void slotShowPresentation();
198 void slotHidePresentation();
199 void slotExportAs(QAction *);
200 bool slotImportPSFile();
201 void slotAboutBackend();
205 void slotShowFindBar();
206 void slotHideFindBar();
207 void slotJobStarted(KIO::Job *job);
208 void slotJobFinished(KJob *job);
209 void loadCancelled(const QString &reason);
210 void setWindowTitleFromDocument();
212 void updateViewActions();
213 void updateBookmarksActions();
214 void enableTOC(
bool enable);
215 void slotRebuildBookmarkMenu();
220 void restoreDocument(const KConfigGroup &group);
221 void saveDocumentRestoreInfo(KConfigGroup &group);
222 void slotFileDirty( const QString& );
223 void slotDoFileDirty();
224 void psTransformEnded(
int, QProcess::ExitStatus);
225 KConfigDialog * slotGeneratorPreferences();
228 void setupViewerActions();
229 void setViewerShortcuts();
232 void setupPrint( QPrinter &printer );
233 void doPrint( QPrinter &printer );
234 bool handleCompressed( QString &destpath, const QString &path, const QString &compressedMimetype );
235 void rebuildBookmarkMenu(
bool unplugActions = true );
236 void updateAboutBackendAction();
237 void unsetDummyMode();
239 void resetStartArguments();
241 static
int numberOfParts;
243 KTemporaryFile *m_tempfile;
247 QString m_temporaryLocalFile;
248 bool isDocumentArchive;
252 SearchWidget *m_searchWidget;
254 PageViewTopMessage * m_topMessage;
255 PageViewTopMessage * m_formsMessage;
256 QPointer<ThumbnailList> m_thumbnailList;
257 QPointer<PageView> m_pageView;
259 QPointer<MiniBarLogic> m_miniBarLogic;
260 QPointer<MiniBar> m_miniBar;
261 QPointer<MiniBar> m_pageNumberTool;
263 QPointer<PresentationWidget> m_presentationWidget;
264 QPointer<ProgressWidget> m_progressWidget;
265 QPointer<PageSizeLabel> m_pageSizeLabel;
266 QPointer<Reviews> m_reviewsWidget;
267 QPointer<BookmarkList> m_bookmarkList;
270 KDirWatch *m_watcher;
271 QTimer *m_dirtyHandler;
274 bool m_wasPresentationOpen;
275 int m_dirtyToolboxIndex;
276 bool m_wasSidebarVisible;
277 bool m_wasSidebarCollapsed;
278 bool m_fileWasRemoved;
282 QStringList m_searchHistory;
288 KAction *m_beginningOfDocument;
289 KAction *m_endOfDocument;
290 KAction *m_historyBack;
291 KAction *m_historyNext;
292 KAction *m_addBookmark;
293 KAction *m_renameBookmark;
294 KAction *m_prevBookmark;
295 KAction *m_nextBookmark;
297 KAction *m_selectAll;
302 KAction *m_saveCopyAs;
303 KAction *m_printPreview;
304 KAction *m_showProperties;
305 KAction *m_showEmbeddedFiles;
307 QAction *m_exportAsText;
308 QAction *m_exportAsDocArchive;
309 KAction *m_showPresentation;
310 KToggleAction* m_showMenuBarAction;
311 KToggleAction* m_showLeftPanel;
312 KToggleAction* m_showBottomBar;
313 KToggleFullScreenAction* m_showFullScreenAction;
314 KAction *m_aboutBackend;
316 QMenu *m_exportAsMenu;
317 KAction *m_closeFindBar;
319 bool m_actionsSearched;
323 QList<QAction*> m_bookmarkActions;
324 bool m_cliPresentation;
326 QString m_addBookmarkText;
327 QIcon m_addBookmarkIcon;
334 FileKeeper *m_keeper;
337 void slotAnnotationPreferences();
338 void slotHandleActivatedSourceReference(const QString& absFileName,
int line,
int col,
bool *handled);
350 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.