aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/mainUI.h
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/mainUI.h84
1 files changed, 36 insertions, 48 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h
index 87d2a4e4..2d23b402 100644
--- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h
+++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h
@@ -17,8 +17,12 @@
#include <QDebug>
#include <QWheelEvent>
#include <QApplication>
+#include <QMenu>
-#include <poppler-qt5.h>
+#include <poppler/qt5/poppler-qt5.h>
+#include "PresentationLabel.h"
+#include "propDialog.h"
+#include "PrintWidget.h"
namespace Ui{
class MainUI;
@@ -32,20 +36,22 @@ public:
void loadFile(QString path);
-
private:
Poppler::Document *DOC;
- QPrintPreviewWidget *WIDGET;
+ PrintWidget *WIDGET;
Ui::MainUI *ui;
- QPrinter* Printer;
+ PropDialog *PROPDIALOG;
QPrintDialog *PrintDLG;
-
QString lastdir;
+ bool matchCase;
+ QMap<Poppler::TextBox*, int> results;
+ int currentHighlight;
//Other Interface elements
QProgressBar *progress;
QAction *progAct; //action associated with the progressbar
QTimer *clockTimer;
+ QMenu *contextMenu;
//QFrame *frame_presenter;
QLabel *label_clock;
QAction *clockAct;
@@ -57,7 +63,7 @@ private:
void loadPage(int num, Poppler::Document *doc, MainUI *obj, QSize dpi, QSizeF page);
//Functions/variables for the presentation mode
- QLabel *presentationLabel;
+ PresentationLabel *presentationLabel;
QScreen *getScreen(bool current, bool &cancelled);
int CurrentPage;
void startPresentation(bool atStart);
@@ -65,11 +71,24 @@ private:
void endPresentation();
private slots:
- void startLoadingPages(QPrinter *printer);
+ void startLoadingPages();
void slotPageLoaded(int);
- void slotStartPresentation(QAction *act);
+ //void slotStartPresentation(QAction *act);
+
+ //Simplification routines
+ void nextPage(){ ShowPage( WIDGET->currentPage() ); } //currentPage() starts at 1 rather than 0
+ void prevPage(){ ShowPage( WIDGET->currentPage()-2 ); } //currentPage() starts at 1 rather than 0
+ void firstPage(){ ShowPage(0); }
+ void lastPage(){ ShowPage(numPages-1); }
+ void startPresentationHere(){ startPresentation(false); }
+ void startPresentationBeginning(){ startPresentation(true); }
+ void closePresentation(){ endPresentation(); }
+
+ void showInformation();
+ void find(QString text, bool forward);
+ void enableFind();
+ void showBookmarks();
- void paintOnWidget(QPrinter *PRINTER);
void paintToPrinter(QPrinter *PRINTER);
//Button Slots
@@ -77,49 +96,18 @@ private slots:
//Other interface slots
void updateClock();
+ void showContextMenu(const QPoint&){ contextMenu->popup(QCursor::pos()); }
+ void updateContextMenu();
+
+ void setScroll(bool);
+ void rotate(bool);
signals:
void PageLoaded(int);
protected:
- void keyPressEvent(QKeyEvent *event){
- //See if this is one of the special hotkeys and act appropriately
- //qDebug() << "Got Key Press:";
- bool inPresentation = (presentationLabel!=0);
- if(!inPresentation){
- //Alternate functionality when **not** in presentation mode
- /*if(event->key()==Qt::Key_Down){
- qDebug() << "Send Wheel Event";
- QWheelEvent event( WIDGET->mapFromGlobal(QCursor::pos()), QCursor::pos(),QPoint(0,0), QPoint(0,30), 0, Qt::Vertical, Qt::LeftButton, Qt::NoModifier);
- QApplication::sendEvent(WIDGET, &event);
- //WIDGET->scrollDown();
- return;
- }else if(event->key()==Qt::Key_Up){
- return;
- }*/
- }
-
- if( event->key()==Qt::Key_Escape || event->key()==Qt::Key_Backspace){
- //qDebug() << " - Escape/Backspace";
- endPresentation();
- }else if(event->key()==Qt::Key_Right || event->key()==Qt::Key_Down || event->key()==Qt::Key_Space || event->key()==Qt::Key_PageDown){
- //qDebug() << " - Right/Down/Spacebar" << inPresentation;
- ShowPage( WIDGET->currentPage() ); //currentPage() starts at 1 rather than 0
- }else if(event->key()==Qt::Key_Left || event->key()==Qt::Key_Up || event->key()==Qt::Key_PageUp){
- //qDebug() << " - Left/Up";
- ShowPage( WIDGET->currentPage()-2 ); //currentPage() starts at 1 rather than 0
- }else if(event->key()==Qt::Key_Home){
- //qDebug() << " - Home";
- ShowPage(0); //go to the first page
- }else if(event->key()==Qt::Key_End){
- //qDebug() << " - End";
- ShowPage( numPages-1 ); //go to the last page
- }else if(event->key()==Qt::Key_F11){
- //qDebug() << " - F11";
- endPresentation();
- }else{
- QMainWindow::keyPressEvent(event);
- }
- }
+ void keyPressEvent(QKeyEvent*);
+ void wheelEvent(QWheelEvent*);
+ void resizeEvent(QResizeEvent*);
};
#endif
bgstack15