[1f4adec] | 1 | /* |
---|
| 2 | |
---|
| 3 | Copyright 2014 S. Razi Alavizadeh |
---|
| 4 | Copyright 2012-2015 Adam Reichold |
---|
| 5 | Copyright 2012 Michał Trybus |
---|
| 6 | Copyright 2012 Alexander Volkov |
---|
| 7 | |
---|
| 8 | This file is part of qpdfview. |
---|
| 9 | |
---|
| 10 | qpdfview is free software: you can redistribute it and/or modify |
---|
| 11 | it under the terms of the GNU General Public License as published by |
---|
| 12 | the Free Software Foundation, either version 2 of the License, or |
---|
| 13 | (at your option) any later version. |
---|
| 14 | |
---|
| 15 | qpdfview is distributed in the hope that it will be useful, |
---|
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 18 | GNU General Public License for more details. |
---|
| 19 | |
---|
| 20 | You should have received a copy of the GNU General Public License |
---|
| 21 | along with qpdfview. If not, see <http://www.gnu.org/licenses/>. |
---|
| 22 | |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | #ifndef MAINWINDOW_H |
---|
| 26 | #define MAINWINDOW_H |
---|
| 27 | |
---|
| 28 | #include <QMainWindow> |
---|
| 29 | |
---|
| 30 | #include <QPointer> |
---|
| 31 | |
---|
| 32 | #ifdef WITH_DBUS |
---|
| 33 | |
---|
| 34 | #include <QDBusAbstractAdaptor> |
---|
| 35 | #include <QListWidget> |
---|
| 36 | #include <QStandardItemModel> |
---|
| 37 | |
---|
[35bdadc] | 38 | //__________________________________ |
---|
| 39 | #include <QHBoxLayout> |
---|
| 40 | #include <QVBoxLayout> |
---|
| 41 | #include <QLabel> |
---|
| 42 | #include <QLineEdit> |
---|
| 43 | #include <QPushButton> |
---|
| 44 | #include <QDialog> |
---|
[63dadfc] | 45 | #include <QUrl> |
---|
| 46 | #include <QNetworkReply> |
---|
| 47 | #include <QUrlQuery> |
---|
| 48 | |
---|
[35bdadc] | 49 | #include "cryptotoken.h" |
---|
[db91752] | 50 | |
---|
| 51 | #include <QFile> |
---|
| 52 | #include <QFileInfo> |
---|
| 53 | #include <QDir> |
---|
[35bdadc] | 54 | //__________________________________ |
---|
| 55 | |
---|
[1f4adec] | 56 | #endif // WITH_DBUS |
---|
| 57 | |
---|
| 58 | class QCheckBox; |
---|
| 59 | class QDateTime; |
---|
| 60 | class QGraphicsView; |
---|
| 61 | class QFileInfo; |
---|
| 62 | class QModelIndex; |
---|
| 63 | class QShortcut; |
---|
| 64 | class QTableView; |
---|
| 65 | class QTreeView; |
---|
| 66 | class QWidgetAction; |
---|
| 67 | |
---|
| 68 | #include "renderparam.h" |
---|
| 69 | |
---|
| 70 | namespace qpdfview |
---|
| 71 | { |
---|
| 72 | |
---|
| 73 | class Settings; |
---|
| 74 | class DocumentView; |
---|
| 75 | class TabWidget; |
---|
| 76 | class TreeView; |
---|
| 77 | class ComboBox; |
---|
| 78 | class MappingSpinBox; |
---|
| 79 | class SearchLineEdit; |
---|
| 80 | class SearchableMenu; |
---|
| 81 | class RecentlyUsedMenu; |
---|
| 82 | class RecentlyClosedMenu; |
---|
| 83 | class BookmarkModel; |
---|
| 84 | class Database; |
---|
| 85 | class ShortcutHandler; |
---|
| 86 | class HelpDialog; |
---|
| 87 | |
---|
| 88 | class MainWindow : public QMainWindow |
---|
| 89 | { |
---|
| 90 | Q_OBJECT |
---|
| 91 | |
---|
| 92 | friend class MainWindowAdaptor; |
---|
[db91752] | 93 | QNetworkReply *reply; |
---|
[1f4adec] | 94 | |
---|
| 95 | public: |
---|
| 96 | explicit MainWindow(QWidget* parent = 0); |
---|
| 97 | |
---|
| 98 | QSize sizeHint() const; |
---|
| 99 | QMenu* createPopupMenu(); |
---|
| 100 | |
---|
[db91752] | 101 | |
---|
[1f4adec] | 102 | public slots: |
---|
| 103 | void show(); |
---|
| 104 | |
---|
| 105 | bool open(const QString& filePath, int page = -1, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 106 | bool openInNewTab(const QString& filePath, int page = -1, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 107 | |
---|
| 108 | bool jumpToPageOrOpenInNewTab(const QString& filePath, int page = -1, bool refreshBeforeJump = false, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 109 | |
---|
| 110 | void startSearch(const QString& text); |
---|
| 111 | |
---|
[35bdadc] | 112 | //void on_gestionar_PIN(); |
---|
| 113 | |
---|
| 114 | //void closeDialog(QDialog *ventana); |
---|
| 115 | |
---|
[1f4adec] | 116 | protected slots: |
---|
| 117 | |
---|
| 118 | void on_tabWidget_currentChanged(int index); |
---|
| 119 | void on_tabWidget_tabCloseRequested(int index); |
---|
| 120 | void on_tabWidget_tabContextMenuRequested(const QPoint& globalPos, int index); |
---|
| 121 | |
---|
| 122 | void on_currentTab_documentChanged(); |
---|
| 123 | void on_currentTab_documentModified(); |
---|
| 124 | |
---|
| 125 | void on_currentTab_numberOfPagesChaned(int numberOfPages); |
---|
| 126 | void on_currentTab_currentPageChanged(int currentPage); |
---|
| 127 | |
---|
| 128 | void on_currentTab_canJumpChanged(bool backward, bool forward); |
---|
| 129 | |
---|
| 130 | void on_currentTab_continuousModeChanged(bool continuousMode); |
---|
| 131 | void on_currentTab_layoutModeChanged(LayoutMode layoutMode); |
---|
| 132 | void on_currentTab_rightToLeftModeChanged(bool rightToLeftMode); |
---|
| 133 | void on_currentTab_scaleModeChanged(ScaleMode scaleMode); |
---|
| 134 | void on_currentTab_scaleFactorChanged(qreal scaleFactor); |
---|
| 135 | void on_currentTab_rotationChanged(Rotation rotation); |
---|
| 136 | |
---|
| 137 | void on_currentTab_linkClicked(int page); |
---|
| 138 | void on_currentTab_linkClicked(bool newTab, const QString& filePath, int page); |
---|
| 139 | |
---|
| 140 | void on_currentTab_renderFlagsChanged(qpdfview::RenderFlags renderFlags); |
---|
| 141 | |
---|
| 142 | void on_currentTab_invertColorsChanged(bool invertColors); |
---|
| 143 | void on_currentTab_convertToGrayscaleChanged(bool convertToGrayscale); |
---|
| 144 | void on_currentTab_trimMarginsChanged(bool trimMargins); |
---|
| 145 | |
---|
| 146 | void on_currentTab_compositionModeChanged(CompositionMode compositionMode); |
---|
| 147 | |
---|
| 148 | void on_currentTab_highlightAllChanged(bool highlightAll); |
---|
| 149 | void on_currentTab_rubberBandModeChanged(RubberBandMode rubberBandMode); |
---|
| 150 | |
---|
| 151 | void on_currentTab_searchFinished(); |
---|
| 152 | void on_currentTab_searchProgressChanged(int progress); |
---|
| 153 | |
---|
| 154 | void on_currentTab_customContextMenuRequested(const QPoint& pos); |
---|
| 155 | |
---|
| 156 | void on_currentPage_editingFinished(); |
---|
| 157 | void on_currentPage_returnPressed(); |
---|
| 158 | |
---|
| 159 | void on_scaleFactor_activated(int index); |
---|
| 160 | void on_scaleFactor_editingFinished(); |
---|
| 161 | void on_scaleFactor_returnPressed(); |
---|
| 162 | |
---|
| 163 | void on_open_triggered(); |
---|
| 164 | void on_openInNewTab_triggered(); |
---|
| 165 | void on_openCopyInNewTab_triggered(); |
---|
| 166 | void on_openContainingFolder_triggered(); |
---|
| 167 | void on_refresh_triggered(); |
---|
| 168 | void on_saveCopy_triggered(); |
---|
| 169 | void on_saveAs_triggered(); |
---|
| 170 | void on_print_triggered(); |
---|
| 171 | |
---|
| 172 | void on_recentlyUsed_openTriggered(const QString& filePath); |
---|
| 173 | |
---|
| 174 | void on_previousPage_triggered(); |
---|
| 175 | void on_nextPage_triggered(); |
---|
| 176 | void on_firstPage_triggered(); |
---|
| 177 | void on_lastPage_triggered(); |
---|
| 178 | |
---|
| 179 | void on_setFirstPage_triggered(); |
---|
| 180 | |
---|
| 181 | void on_jumpToPage_triggered(); |
---|
| 182 | |
---|
| 183 | void on_jumpBackward_triggered(); |
---|
| 184 | void on_jumpForward_triggered(); |
---|
| 185 | |
---|
| 186 | void on_search_triggered(); |
---|
| 187 | void on_findPrevious_triggered(); |
---|
| 188 | void on_findNext_triggered(); |
---|
| 189 | void on_cancelSearch_triggered(); |
---|
| 190 | |
---|
| 191 | void on_copyToClipboardMode_triggered(bool checked); |
---|
| 192 | void on_addAnnotationMode_triggered(bool checked); |
---|
| 193 | |
---|
| 194 | void on_settings_triggered(); |
---|
| 195 | |
---|
| 196 | void on_continuousMode_triggered(bool checked); |
---|
| 197 | void on_twoPagesMode_triggered(bool checked); |
---|
| 198 | void on_twoPagesWithCoverPageMode_triggered(bool checked); |
---|
| 199 | void on_multiplePagesMode_triggered(bool checked); |
---|
| 200 | |
---|
| 201 | void on_rightToLeftMode_triggered(bool checked); |
---|
| 202 | |
---|
| 203 | void on_zoomIn_triggered(); |
---|
| 204 | void on_zoomOut_triggered(); |
---|
| 205 | void on_originalSize_triggered(); |
---|
| 206 | |
---|
| 207 | void on_fitToPageWidthMode_triggered(bool checked); |
---|
| 208 | void on_fitToPageSizeMode_triggered(bool checked); |
---|
| 209 | |
---|
| 210 | void on_rotateLeft_triggered(); |
---|
| 211 | void on_rotateRight_triggered(); |
---|
| 212 | |
---|
| 213 | void on_invertColors_triggered(bool checked); |
---|
| 214 | void on_convertToGrayscale_triggered(bool checked); |
---|
| 215 | void on_trimMargins_triggered(bool checked); |
---|
| 216 | void on_darkenWithPaperColor_triggered(bool checked); |
---|
| 217 | void on_lightenWithPaperColor_triggered(bool checked); |
---|
| 218 | |
---|
| 219 | void on_fonts_triggered(); |
---|
| 220 | |
---|
| 221 | void on_fullscreen_triggered(bool checked); |
---|
| 222 | void on_presentation_triggered(); |
---|
| 223 | |
---|
| 224 | void on_previousTab_triggered(); |
---|
| 225 | void on_nextTab_triggered(); |
---|
| 226 | void on_closeTab_triggered(); |
---|
| 227 | void on_closeAllTabs_triggered(); |
---|
| 228 | void on_closeAllTabsButCurrentTab_triggered(); |
---|
| 229 | |
---|
| 230 | void on_restoreMostRecentlyClosedTab_triggered(); |
---|
| 231 | |
---|
| 232 | void on_recentlyClosed_tabActionTriggered(QAction* tabAction); |
---|
| 233 | |
---|
| 234 | void on_tabAction_triggered(); |
---|
| 235 | void on_tabShortcut_activated(); |
---|
| 236 | |
---|
| 237 | void on_previousBookmark_triggered(); |
---|
| 238 | void on_nextBookmark_triggered(); |
---|
| 239 | void on_addBookmark_triggered(); |
---|
| 240 | void on_removeBookmark_triggered(); |
---|
| 241 | void on_removeAllBookmarks_triggered(); |
---|
| 242 | |
---|
| 243 | void on_bookmarksMenu_aboutToShow(); |
---|
| 244 | |
---|
| 245 | void on_bookmark_openTriggered(const QString& absoluteFilePath); |
---|
| 246 | void on_bookmark_openInNewTabTriggered(const QString& absoluteFilePath); |
---|
| 247 | void on_bookmark_jumpToPageTriggered(const QString& absoluteFilePath, int page); |
---|
| 248 | void on_bookmark_removeBookmarkTriggered(const QString& absoluteFilePath); |
---|
| 249 | |
---|
| 250 | void on_contents_triggered(); |
---|
| 251 | void on_about_triggered(); |
---|
| 252 | |
---|
| 253 | void on_focusCurrentPage_activated(); |
---|
| 254 | void on_focusScaleFactor_activated(); |
---|
| 255 | |
---|
| 256 | void on_toggleToolBars_triggered(bool checked); |
---|
| 257 | void on_toggleMenuBar_triggered(bool checked); |
---|
| 258 | |
---|
| 259 | void on_searchInitiated(const QString& text, bool modified); |
---|
| 260 | void on_highlightAll_clicked(bool checked); |
---|
| 261 | |
---|
| 262 | void on_dock_dockLocationChanged(Qt::DockWidgetArea area); |
---|
| 263 | |
---|
| 264 | void on_outline_sectionCountChanged(); |
---|
| 265 | void on_outline_clicked(const QModelIndex& index); |
---|
| 266 | |
---|
| 267 | void on_properties_sectionCountChanged(); |
---|
| 268 | void on_detailsSignatureView_sectionCountChanged(); |
---|
| 269 | |
---|
| 270 | void on_thumbnails_dockLocationChanged(Qt::DockWidgetArea area); |
---|
| 271 | void on_thumbnails_verticalScrollBar_valueChanged(int value); |
---|
| 272 | |
---|
| 273 | void on_bookmarks_sectionCountChanged(); |
---|
| 274 | void on_bookmarks_clicked(const QModelIndex& index); |
---|
| 275 | void on_bookmarks_contextMenuRequested(const QPoint& pos); |
---|
| 276 | |
---|
| 277 | void on_search_sectionCountChanged(); |
---|
| 278 | void on_search_visibilityChanged(bool visible); |
---|
| 279 | void on_search_clicked(const QModelIndex& index); |
---|
| 280 | |
---|
| 281 | void on_saveDatabase_timeout(); |
---|
[35bdadc] | 282 | //_______________________________________________________________________________________________ |
---|
[1f4adec] | 283 | void on_verify_signature(); |
---|
[1487f05] | 284 | void on_signature(); |
---|
[35bdadc] | 285 | void on_windowCertificate(); |
---|
| 286 | void on_selectCertificate(); |
---|
[9840ac5] | 287 | void on_activateButtonCertificate(); |
---|
[db91752] | 288 | void on_uploadFile(); |
---|
[35bdadc] | 289 | |
---|
| 290 | void on_managePIN(); |
---|
| 291 | void on_windowPIN(int x); |
---|
| 292 | void on_currentChanged_selection(); |
---|
| 293 | void on_close_windowCertificate(); |
---|
| 294 | void on_close_windowPIN(); |
---|
[db91752] | 295 | void httpReadyRead(); |
---|
| 296 | void httpDownloadFinished(); |
---|
[1f4adec] | 297 | //QString verify_signature(); |
---|
| 298 | //QStringList verify_signature(); |
---|
| 299 | QStandardItemModel* verify_signature(); |
---|
| 300 | QStandardItemModel* view_table_verify_signature(); |
---|
[35bdadc] | 301 | //QList<QStringList> certificateInformationListN; |
---|
| 302 | //_______________________________________________________________________________________________ |
---|
[1f4adec] | 303 | |
---|
| 304 | protected: |
---|
| 305 | bool eventFilter(QObject* target, QEvent* event); |
---|
| 306 | |
---|
| 307 | void closeEvent(QCloseEvent* event); |
---|
| 308 | |
---|
| 309 | void dragEnterEvent(QDragEnterEvent* event); |
---|
| 310 | void dropEvent(QDropEvent* event); |
---|
[db91752] | 311 | QFile *file; //para descargar el archivo firmado |
---|
| 312 | QString _currentrest; //respuesta del servidor murachi |
---|
[63dadfc] | 313 | |
---|
| 314 | //_________________________________________Web services Methods______________________________________________________ |
---|
| 315 | |
---|
| 316 | QString executeRest(const QString &url, const QString &name = "admin", const QString &pass = "admin", |
---|
| 317 | const QString& postData = QString("")); |
---|
| 318 | |
---|
| 319 | QString privateExecuteRest(const QString &url, const QString &name = "admin", const QString &pass = "admin", |
---|
| 320 | QString method = "get", const QUrlQuery& postData = QUrlQuery("")); |
---|
| 321 | |
---|
| 322 | //_________________________________________Web services Methods______________________________________________________ |
---|
| 323 | //_________________________________________Web services Slots______________________________________________________ |
---|
| 324 | public Q_SLOTS: |
---|
| 325 | |
---|
| 326 | void handleNetworkData(QNetworkReply *networkReply); |
---|
| 327 | |
---|
| 328 | void slotError(QNetworkReply::NetworkError e); |
---|
| 329 | |
---|
[db91752] | 330 | void handleNetworkDataMP(QNetworkReply *networkReply); |
---|
| 331 | void handleDownloadFile(); |
---|
[63dadfc] | 332 | public: |
---|
| 333 | void setCurrentRest(const QString& r) { _currentrest = r;} |
---|
| 334 | QString getCurrentRest() { return _currentrest; } |
---|
| 335 | |
---|
| 336 | |
---|
| 337 | //_________________________________________Web services Methods______________________________________________________ |
---|
| 338 | |
---|
[1f4adec] | 339 | |
---|
[63dadfc] | 340 | void callMurachi(); |
---|
[db91752] | 341 | void downloadSignedFile(); |
---|
| 342 | |
---|
| 343 | QString executeRest(const QString &url, const QString &name, const QString &pass, QHttpMultiPart *postData); |
---|
[1f4adec] | 344 | private: |
---|
| 345 | Q_DISABLE_COPY(MainWindow) |
---|
| 346 | |
---|
| 347 | static Settings* s_settings; |
---|
| 348 | static Database* s_database; |
---|
| 349 | static ShortcutHandler* s_shortcutHandler; |
---|
| 350 | |
---|
| 351 | void prepareStyle(); |
---|
| 352 | |
---|
| 353 | TabWidget* m_tabWidget; |
---|
| 354 | |
---|
| 355 | DocumentView* currentTab() const; |
---|
| 356 | DocumentView* tab(int index) const; |
---|
| 357 | QList< DocumentView* > tabs() const; |
---|
| 358 | |
---|
| 359 | bool senderIsCurrentTab() const; |
---|
| 360 | |
---|
| 361 | int addTab(DocumentView* tab); |
---|
| 362 | void closeTab(DocumentView* tab); |
---|
| 363 | |
---|
| 364 | bool saveModifications(DocumentView* tab); |
---|
| 365 | |
---|
| 366 | void disconnectCurrentTabChanged(); |
---|
| 367 | void reconnectCurrentTabChanged(); |
---|
| 368 | |
---|
| 369 | void setWindowTitleForCurrentTab(); |
---|
| 370 | void setCurrentPageSuffixForCurrentTab(); |
---|
| 371 | |
---|
| 372 | BookmarkModel* bookmarkModelForCurrentTab(bool create = false); |
---|
| 373 | |
---|
| 374 | QAction* sourceLinkActionForCurrentTab(QObject* parent, const QPoint& pos); |
---|
| 375 | |
---|
| 376 | class RestoreTab; |
---|
| 377 | |
---|
| 378 | QTimer* m_saveDatabaseTimer; |
---|
| 379 | |
---|
| 380 | void prepareDatabase(); |
---|
| 381 | |
---|
| 382 | void scheduleSaveDatabase(); |
---|
| 383 | void scheduleSaveTabs(); |
---|
| 384 | void scheduleSaveBookmarks(); |
---|
| 385 | void scheduleSavePerFileSettings(); |
---|
| 386 | |
---|
| 387 | class TextValueMapper; |
---|
| 388 | |
---|
| 389 | MappingSpinBox* m_currentPageSpinBox; |
---|
| 390 | QWidgetAction* m_currentPageAction; |
---|
| 391 | |
---|
| 392 | ComboBox* m_scaleFactorComboBox; |
---|
| 393 | QWidgetAction* m_scaleFactorAction; |
---|
| 394 | |
---|
| 395 | SearchLineEdit* m_searchLineEdit; |
---|
| 396 | QCheckBox* m_matchCaseCheckBox; |
---|
| 397 | QCheckBox* m_wholeWordsCheckBox; |
---|
| 398 | QCheckBox* m_highlightAllCheckBox; |
---|
| 399 | |
---|
| 400 | void createWidgets(); |
---|
| 401 | |
---|
| 402 | QAction* m_openAction; |
---|
| 403 | QAction* m_openInNewTabAction; |
---|
| 404 | QAction* m_openCopyInNewTabAction; |
---|
| 405 | QAction* m_openContainingFolderAction; |
---|
| 406 | QAction* m_refreshAction; |
---|
| 407 | QAction* m_saveCopyAction; |
---|
| 408 | QAction* m_saveAsAction; |
---|
| 409 | QAction* m_printAction; |
---|
| 410 | QAction* m_exitAction; |
---|
| 411 | QAction* m_verify_signature; |
---|
| 412 | |
---|
| 413 | QAction* m_previousPageAction; |
---|
| 414 | QAction* m_nextPageAction; |
---|
| 415 | QAction* m_firstPageAction; |
---|
| 416 | QAction* m_lastPageAction; |
---|
| 417 | |
---|
| 418 | QAction* m_setFirstPageAction; |
---|
| 419 | |
---|
| 420 | QAction* m_jumpToPageAction; |
---|
| 421 | |
---|
| 422 | QAction* m_jumpBackwardAction; |
---|
| 423 | QAction* m_jumpForwardAction; |
---|
| 424 | |
---|
| 425 | QAction* m_searchAction; |
---|
| 426 | QAction* m_findPreviousAction; |
---|
| 427 | QAction* m_findNextAction; |
---|
| 428 | QAction* m_cancelSearchAction; |
---|
| 429 | |
---|
| 430 | QAction* m_copyToClipboardModeAction; |
---|
| 431 | QAction* m_addAnnotationModeAction; |
---|
| 432 | |
---|
| 433 | QAction* m_settingsAction; |
---|
| 434 | |
---|
| 435 | QAction* m_continuousModeAction; |
---|
| 436 | QAction* m_twoPagesModeAction; |
---|
| 437 | QAction* m_twoPagesWithCoverPageModeAction; |
---|
| 438 | QAction* m_multiplePagesModeAction; |
---|
| 439 | |
---|
| 440 | QAction* m_rightToLeftModeAction; |
---|
| 441 | |
---|
| 442 | QAction* m_zoomInAction; |
---|
| 443 | QAction* m_zoomOutAction; |
---|
| 444 | QAction* m_originalSizeAction; |
---|
| 445 | |
---|
| 446 | QAction* m_fitToPageWidthModeAction; |
---|
| 447 | QAction* m_fitToPageSizeModeAction; |
---|
| 448 | |
---|
| 449 | QAction* m_rotateLeftAction; |
---|
| 450 | QAction* m_rotateRightAction; |
---|
| 451 | |
---|
| 452 | QAction* m_invertColorsAction; |
---|
| 453 | QAction* m_convertToGrayscaleAction; |
---|
| 454 | QAction* m_trimMarginsAction; |
---|
| 455 | QAction* m_darkenWithPaperColorAction; |
---|
| 456 | QAction* m_lightenWithPaperColorAction; |
---|
| 457 | |
---|
| 458 | QAction* m_fontsAction; |
---|
| 459 | |
---|
| 460 | QAction* m_fullscreenAction; |
---|
| 461 | QAction* m_presentationAction; |
---|
| 462 | |
---|
| 463 | QAction* m_previousTabAction; |
---|
| 464 | QAction* m_nextTabAction; |
---|
| 465 | |
---|
| 466 | QAction* m_closeTabAction; |
---|
| 467 | QAction* m_closeAllTabsAction; |
---|
| 468 | QAction* m_closeAllTabsButCurrentTabAction; |
---|
| 469 | |
---|
| 470 | QAction* m_restoreMostRecentlyClosedTabAction; |
---|
| 471 | |
---|
| 472 | QShortcut* m_tabShortcuts[9]; |
---|
| 473 | |
---|
| 474 | QAction* m_previousBookmarkAction; |
---|
| 475 | QAction* m_nextBookmarkAction; |
---|
| 476 | |
---|
| 477 | QAction* m_addBookmarkAction; |
---|
| 478 | QAction* m_removeBookmarkAction; |
---|
| 479 | QAction* m_removeAllBookmarksAction; |
---|
| 480 | |
---|
| 481 | QAction* m_contentsAction; |
---|
| 482 | QAction* m_aboutAction; |
---|
| 483 | |
---|
| 484 | QAction* createAction(const QString& text, const QString& objectName, const QIcon& icon, const QList< QKeySequence >& shortcuts, const char* member, bool checkable = false, bool checked = false); |
---|
| 485 | QAction* createAction(const QString& text, const QString& objectName, const QIcon& icon, const QKeySequence& shortcut, const char* member, bool checkable = false, bool checked = false); |
---|
| 486 | QAction* createAction(const QString& text, const QString& objectName, const QString& iconName, const QList< QKeySequence >& shortcuts, const char* member, bool checkable = false, bool checked = false); |
---|
| 487 | QAction* createAction(const QString& text, const QString& objectName, const QString& iconName, const QKeySequence& shortcut, const char* member, bool checkable = false, bool checked = false); |
---|
| 488 | |
---|
| 489 | void createActions(); |
---|
| 490 | |
---|
| 491 | QToolBar* m_fileToolBar; |
---|
| 492 | QToolBar* m_editToolBar; |
---|
| 493 | QToolBar* m_viewToolBar; |
---|
| 494 | |
---|
| 495 | QShortcut* m_focusCurrentPageShortcut; |
---|
| 496 | QShortcut* m_focusScaleFactorShortcut; |
---|
| 497 | |
---|
| 498 | QToolBar* createToolBar(const QString& text, const QString& objectName, const QStringList& actionNames, const QList< QAction* >& actions); |
---|
| 499 | |
---|
| 500 | void createToolBars(); |
---|
| 501 | |
---|
| 502 | QDockWidget* m_outlineDock; |
---|
| 503 | TreeView* m_outlineView; |
---|
| 504 | |
---|
| 505 | QDockWidget* m_propertiesDock; |
---|
| 506 | QDockWidget* m_detailsSignatureDock; |
---|
| 507 | QTableView* m_propertiesView; |
---|
| 508 | QTableView* m_detailsSignatureView; |
---|
| 509 | //QListWidget* m_detailsSignatureView; |
---|
| 510 | QTableView* m_tableVerifySign; |
---|
| 511 | |
---|
| 512 | QDockWidget* m_thumbnailsDock; |
---|
| 513 | QGraphicsView* m_thumbnailsView; |
---|
| 514 | |
---|
| 515 | QDockWidget* m_bookmarksDock; |
---|
| 516 | QTableView* m_bookmarksView; |
---|
| 517 | |
---|
| 518 | QDockWidget* m_searchDock; |
---|
| 519 | QTreeView* m_searchView; |
---|
| 520 | QWidget* m_searchWidget; |
---|
| 521 | |
---|
| 522 | QDockWidget* createDock(const QString& text, const QString& objectName, const QKeySequence& toggleViewShortcut); |
---|
[35bdadc] | 523 | |
---|
[1f4adec] | 524 | |
---|
| 525 | |
---|
| 526 | void createSearchDock(); |
---|
| 527 | |
---|
| 528 | void createDocks(); |
---|
| 529 | |
---|
| 530 | QMenu* m_fileMenu; |
---|
| 531 | RecentlyUsedMenu* m_recentlyUsedMenu; |
---|
| 532 | QMenu* m_editMenu; |
---|
| 533 | QMenu* m_viewMenu; |
---|
| 534 | QMenu* m_compositionModeMenu; |
---|
| 535 | SearchableMenu* m_tabsMenu; |
---|
| 536 | RecentlyClosedMenu* m_recentlyClosedMenu; |
---|
| 537 | SearchableMenu* m_bookmarksMenu; |
---|
| 538 | QMenu* m_helpMenu; |
---|
[35bdadc] | 539 | |
---|
| 540 | //_______________________________________________________________________ |
---|
| 541 | |
---|
[1487f05] | 542 | QMenu* m_security; |
---|
| 543 | QAction* m_signature; |
---|
[35bdadc] | 544 | QDialog* m_pin; |
---|
| 545 | QHBoxLayout* m_layoutContrasenia; |
---|
| 546 | QHBoxLayout* m_layoutBotones; |
---|
| 547 | QVBoxLayout* m_layoutPrincipal; |
---|
| 548 | QVBoxLayout* m_layoutmesage; |
---|
| 549 | QLabel* m_mesage; |
---|
| 550 | QLabel* m_etiquetaContrasenia; |
---|
| 551 | QLineEdit* m_campoContrasenia; |
---|
| 552 | QPushButton* m_botonAceptar; |
---|
| 553 | QPushButton* m_botonCancelar; |
---|
| 554 | |
---|
| 555 | QDialog* m_certificate; |
---|
| 556 | QHBoxLayout* m_layoutmensaje; |
---|
| 557 | QHBoxLayout* m_ClayoutBotones; |
---|
| 558 | QHBoxLayout* m_layoutTableView; |
---|
| 559 | QVBoxLayout* m_ClayoutPrincipal; |
---|
| 560 | |
---|
| 561 | QLabel* m_mensaje; |
---|
| 562 | |
---|
| 563 | QTableView* m_listCertificate; |
---|
| 564 | QStandardItemModel* m_model; |
---|
| 565 | |
---|
| 566 | QPushButton* m_CbotonAceptar; |
---|
| 567 | QPushButton* m_CbotonCancelar; |
---|
| 568 | CryptoToken* m_nct; |
---|
| 569 | int certSelect; //indice del certificado seleccionado |
---|
[63dadfc] | 570 | QString certInHex; |
---|
[35bdadc] | 571 | QList<QStringList> certificateInformationListN; |
---|
| 572 | QString close_windowCertificate; |
---|
| 573 | QString close_PIN; |
---|
| 574 | |
---|
[5de5cc7] | 575 | QString currentHash; |
---|
[db91752] | 576 | QString fileId; |
---|
| 577 | QString signedfile; |
---|
[5de5cc7] | 578 | QNetworkCookieJar *cookiesJar; |
---|
| 579 | |
---|
| 580 | QNetworkAccessManager *manager; |
---|
[db91752] | 581 | QNetworkReply *response; |
---|
| 582 | QUrl url; |
---|
| 583 | QFile localFile; |
---|
| 584 | |
---|
[35bdadc] | 585 | //_______________________________________________________________________ |
---|
[1f4adec] | 586 | bool m_bookmarksMenuIsDirty; |
---|
| 587 | |
---|
| 588 | void createMenus(); |
---|
| 589 | |
---|
| 590 | int m_tabBarHadPolicy; |
---|
| 591 | |
---|
| 592 | bool m_fileToolBarWasVisible; |
---|
| 593 | bool m_editToolBarWasVisible; |
---|
| 594 | bool m_viewToolBarWasVisible; |
---|
| 595 | |
---|
| 596 | QAction* m_toggleToolBarsAction; |
---|
| 597 | QAction* m_toggleMenuBarAction; |
---|
| 598 | |
---|
| 599 | QPointer< HelpDialog > m_helpDialog; |
---|
| 600 | |
---|
| 601 | }; |
---|
| 602 | |
---|
| 603 | #ifdef WITH_DBUS |
---|
| 604 | |
---|
| 605 | class MainWindowAdaptor : public QDBusAbstractAdaptor |
---|
| 606 | { |
---|
| 607 | Q_OBJECT |
---|
| 608 | Q_CLASSINFO("D-Bus Interface", "local.qpdfview.MainWindow") |
---|
| 609 | |
---|
| 610 | public: |
---|
| 611 | explicit MainWindowAdaptor(MainWindow* mainWindow); |
---|
| 612 | |
---|
| 613 | public slots: |
---|
| 614 | Q_NOREPLY void raiseAndActivate(); |
---|
| 615 | |
---|
| 616 | bool open(const QString& absoluteFilePath, int page = -1, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 617 | bool openInNewTab(const QString& absoluteFilePath, int page = -1, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 618 | |
---|
| 619 | bool jumpToPageOrOpenInNewTab(const QString& absoluteFilePath, int page = -1, bool refreshBeforeJump = false, const QRectF& highlight = QRectF(), bool quiet = false); |
---|
| 620 | |
---|
| 621 | Q_NOREPLY void startSearch(const QString& text); |
---|
| 622 | |
---|
| 623 | |
---|
| 624 | Q_NOREPLY void previousPage(); |
---|
| 625 | Q_NOREPLY void nextPage(); |
---|
| 626 | Q_NOREPLY void firstPage(); |
---|
| 627 | Q_NOREPLY void lastPage(); |
---|
| 628 | |
---|
| 629 | Q_NOREPLY void previousBookmark(); |
---|
| 630 | Q_NOREPLY void nextBookmark(); |
---|
| 631 | |
---|
| 632 | bool jumpToBookmark(const QString& label); |
---|
| 633 | |
---|
| 634 | |
---|
| 635 | Q_NOREPLY void continuousModeAction(bool checked); |
---|
| 636 | Q_NOREPLY void twoPagesModeAction(bool checked); |
---|
| 637 | Q_NOREPLY void twoPagesWithCoverPageModeAction(bool checked); |
---|
| 638 | Q_NOREPLY void multiplePagesModeAction(bool checked); |
---|
| 639 | |
---|
| 640 | Q_NOREPLY void fitToPageWidthModeAction(bool checked); |
---|
| 641 | Q_NOREPLY void fitToPageSizeModeAction(bool checked); |
---|
| 642 | |
---|
| 643 | Q_NOREPLY void convertToGrayscaleAction(bool checked); |
---|
| 644 | Q_NOREPLY void invertColorsAction(bool checked); |
---|
| 645 | |
---|
| 646 | Q_NOREPLY void fullscreenAction(bool checked); |
---|
| 647 | Q_NOREPLY void presentationAction(); |
---|
| 648 | |
---|
| 649 | |
---|
| 650 | Q_NOREPLY void closeTab(); |
---|
| 651 | Q_NOREPLY void closeAllTabs(); |
---|
| 652 | Q_NOREPLY void closeAllTabsButCurrentTab(); |
---|
| 653 | |
---|
| 654 | bool closeTab(const QString& absoluteFilePath); |
---|
| 655 | |
---|
| 656 | private: |
---|
| 657 | MainWindow* mainWindow() const; |
---|
| 658 | |
---|
| 659 | }; |
---|
| 660 | |
---|
| 661 | #endif // WITH_DBUS |
---|
| 662 | |
---|
| 663 | } // qpdfview |
---|
| 664 | |
---|
| 665 | #endif // MAINWINDOW_H |
---|