Main window of application. More...
#include <pdfeditwindow.h>
Public Slots | |
| void | pageDeleteSelection () |
| void | setSelection (std::vector< boost::shared_ptr< PdfOperator > > vec) |
| void | setSelection (std::vector< boost::shared_ptr< CAnnotation > > vec) |
| void | changeRevision (int revision) |
| void | receiveHelpText (const QString &message) |
Signals | |
| void | itemDeleted (boost::shared_ptr< IProperty > it) |
| void | selfDestruct () |
| void | documentChanged (boost::shared_ptr< pdfobjects::CPdf > newDocument) |
| void | revisionChanged (int revision) |
Public Member Functions | |
| PdfEditWindow (const QString &fName=QString::null, QWidget *parent=0, const char *name=0) | |
| ~PdfEditWindow () | |
| void | addColorTool (ColorTool *tool) |
| void | addEditTool (EditTool *tool) |
| void | addNumberTool (NumberTool *tool) |
| void | addSelectTool (SelectTool *tool) |
| bool | modified () |
| QString | filename () |
| void | saveVisibility (QWidget *w, const QString &name) |
| void | loadVisibility (QWidget *w, const QString &name) |
| void | saveWindowState () |
| void | restoreWindowState () |
| bool | save (bool newRevision=false) |
| bool | saveCopy (const QString &name) |
| bool | closeFile (bool askSave, bool onlyAsk=false) |
| bool | openFile (const QString &name, bool askPassword=true) |
| void | exitApp () |
| void | closeWindow () |
| int | pageNumber () |
| void | bigPixmap () |
| PageSpace * | getPageSpace () const |
| void | run (const QString &scriptName) |
| void | runFile (const QString &scriptName) |
| void | eval (const QString &code) |
| QStringList | allUnits () |
| QStringList | allUnitIds () |
| boost::shared_ptr < pdfobjects::utils::ProgressObserver > | getProgressObserver () |
| QProgressBar * | getProgressBar () |
Static Public Member Functions | |
| static PdfEditWindow * | create (const QString &fName=QString::null) |
Protected Slots | |
| void | pageChange (const QSPage &pg, int numberOfPage) |
| void | treeClicked (int button, QListViewItem *item) |
| void | menuActivated (int id) |
| void | setObject () |
Protected Member Functions | |
| virtual void | closeEvent (QCloseEvent *e) |
Private Slots | |
| void | unsetObjectIf (TreeItem *ipItem) |
| void | unsetObjectIf (TreeItemAbstract *theItem) |
| void | pagePopup (const QPoint &globalPos) |
| void | settingUpdate (QString key) |
| void | runScript (QString script) |
Private Member Functions | |
| void | setTitle (int revision=0) |
| void | addObjectDialogI (boost::shared_ptr< IProperty > ip) |
| void | setFileName (const QString &name) |
| void | destroyFile () |
| void | emptyFile () |
Private Attributes | |
| boost::shared_ptr < pdfobjects::utils::ProgressObserver > | progressObserver |
| QProgressBar * | progressBar |
| CommandWindow * | cmdLine |
| MultiTreeWindow * | tree |
| PropertyEditor * | prop |
| boost::shared_ptr< CPdf > | document |
| boost::shared_ptr< CPage > | selectedPage |
| int | selectedPageNumber |
| boost::shared_ptr< IProperty > | selectedProperty |
| boost::shared_ptr< PdfOperator > | selectedOperator |
| TreeItemAbstract * | selectedTreeItem |
| QSplitter * | spl |
| QSplitter * | splCmd |
| QSplitter * | splProp |
| QString | fileName |
| QString | baseName |
| Menu * | menuSystem |
| PageSpace * | pagespc |
| BaseGUI * | base |
| StatusBar * | status |
Friends | |
| class | BaseGUI |
Main window of application.
PdfEditWindow - class handling main application window
| gui::PdfEditWindow::PdfEditWindow | ( | const QString & | fName = QString::null, |
|
| QWidget * | parent = 0, |
|||
| const char * | name = 0 | |||
| ) |
constructor of PdfEditWindow, creates window and fills it with elements
| parent | parent widget containing this control | |
| name | name of widget (currently unused) | |
| fName | Name of file to open in this window. If empty or null, no file will be opened |
| gui::PdfEditWindow::~PdfEditWindow | ( | ) |
default destructor
| void gui::PdfEditWindow::addColorTool | ( | ColorTool * | tool | ) |
Add color selection tool to list of "known color selection tools"
| tool | Tool to add |
References create().
Referenced by gui::ToolFactory::specialItem().
| void gui::PdfEditWindow::addEditTool | ( | EditTool * | tool | ) |
Add line edit tool to list of "known line edit tools"
| tool | Tool to add |
Referenced by gui::ToolFactory::specialItem().
| void gui::PdfEditWindow::addNumberTool | ( | NumberTool * | tool | ) |
Add number edit tool to list of "known number edit tools"
| tool | Tool to add |
References gui::BaseGUI::addColorTool(), and base.
Referenced by gui::ToolFactory::specialItem().
| void gui::PdfEditWindow::addObjectDialogI | ( | boost::shared_ptr< IProperty > | ip | ) | [private] |
Show dialog for adding objects into given container.
Container must be Dict or Array, otherwise the dialog is not created. After creating, dialog is shown and usable and this function immediately returns.
| ip | Dict or Array into which objects will be added |
| void gui::PdfEditWindow::addSelectTool | ( | SelectTool * | tool | ) |
Add select text tool to list of "known select text tools"
| tool | Tool to add |
References gui::BaseGUI::addEditTool(), and base.
Referenced by gui::ToolFactory::specialItem().
| QStringList gui::PdfEditWindow::allUnitIds | ( | ) |
Return list of available length unit identifiers Identifiers are 1:1 with units returned by allUnits
| QStringList gui::PdfEditWindow::allUnits | ( | ) |
Return list of available length units
| void gui::PdfEditWindow::bigPixmap | ( | ) |
Load and apply current value of "Use big pixmap" setting
| void gui::PdfEditWindow::changeRevision | ( | int | revision | ) | [slot] |
Change currently active revision in document
| revision | New revision |
| void gui::PdfEditWindow::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
This is called on attempt to close window. If there is unsaved work, dialog asking to save it would appear, otherwise the windows is closed.
| e | Close event |
| bool gui::PdfEditWindow::closeFile | ( | bool | askSave, | |
| bool | onlyAsk = false | |||
| ) |
Closes file currently opened in editor.
| askSave | Ask about saving changes? | |
| onlyAsk | Only ask about closing/saving work, do not actually close file |
Referenced by create().
| void gui::PdfEditWindow::closeWindow | ( | ) |
Close the window itself
| PdfEditWindow * gui::PdfEditWindow::create | ( | const QString & | fName = QString::null |
) | [static] |
Creates new windows and displays it.
| fName | Name of file to open in new window. If no file specified, new window is initially empty |
References closeFile(), saveWindowState(), and gui::windowCount.
Referenced by addColorTool().
| void gui::PdfEditWindow::destroyFile | ( | ) | [private] |
Closes file currently opened in editor, without opening new empty one
| void gui::PdfEditWindow::documentChanged | ( | boost::shared_ptr< pdfobjects::CPdf > | newDocument | ) | [signal] |
Signal emitted when active document is changed Reference to newly opened document is sent. If document is closed without opening a new file, NULL is sent instead.
| newDocument | Pointer to new document |
| void gui::PdfEditWindow::emptyFile | ( | ) | [private] |
Opens new empty file in editor.
Referenced by pageDeleteSelection().
| void gui::PdfEditWindow::eval | ( | const QString & | code | ) |
Run given script code
| code | Code to evaluate |
References base, and gui::Base::run().
Referenced by runCmdScripts().
| void gui::PdfEditWindow::exitApp | ( | ) |
application exit handler invoked when "Quit" is selected in menu/toolbar/etc ...
References debug::DBG_INFO, guiPrintDbg, q_App, and gui::windowCount.
| QString gui::PdfEditWindow::filename | ( | ) |
Return name of file loaded in editor. Return empty string if the document have no name (if it is not loaded from disk and have not yet been saved)
| PageSpace * gui::PdfEditWindow::getPageSpace | ( | ) | const |
Return reference to pagespace (needed for example by ZoomTool)
Referenced by gui::ToolFactory::specialItem().
| QProgressBar * gui::PdfEditWindow::getProgressBar | ( | ) |
Returns common progress bar.
Note that this progress bar is shared and so user should keep in mind that someone is using same progress bar while he starts to use it.
| boost::shared_ptr< pdfobjects::utils::ProgressObserver > gui::PdfEditWindow::getProgressObserver | ( | ) |
Returns progress observer. This progress observer holds qt progress bar (progressBar field) stored in status bar. It can be registered on ObserverHandler to display progress.
| void gui::PdfEditWindow::itemDeleted | ( | boost::shared_ptr< IProperty > | it | ) | [signal] |
Signal emitted whenever any IProperty object is deleted
| it | Property that was deleted |
| void gui::PdfEditWindow::loadVisibility | ( | QWidget * | w, | |
| const QString & | name | |||
| ) |
Restore window visibility state from application settings
| w | Widget to restore | |
| name | Name of key in settings |
| void gui::PdfEditWindow::menuActivated | ( | int | id | ) | [protected, slot] |
Signal handler invoked on menu activation
| id | Menu ID of clicked item |
References gui::BaseGUI::addNumberTool(), and base.
| bool gui::PdfEditWindow::modified | ( | ) |
Check whether currently opened document was modified since it was opened or last saved
| bool gui::PdfEditWindow::openFile | ( | const QString & | name, | |
| bool | askPassword = true | |||
| ) |
Open file in editor.
| name | Name of file to open | |
| askPassword | Ask user directly for password? If not, password have to be set other ways if necessary (via script for example) |
| void gui::PdfEditWindow::pageChange | ( | const QSPage & | pg, | |
| int | numberOfPage | |||
| ) | [protected, slot] |
Slot called on changing the page in preview window
| pg | New page that was just changed to | |
| numberOfPage | Number of page |
| void gui::PdfEditWindow::pageDeleteSelection | ( | ) | [slot] |
Slot called when deleteSelection from pagespace is emitted. Script callback function is invoked.
References base, gui::BaseCore::call(), and emptyFile().
| int gui::PdfEditWindow::pageNumber | ( | ) |
Return currently selected page number
References gui::QSPage::get(), and selectedPage.
Referenced by gui::ToolFactory::specialItem().
| void gui::PdfEditWindow::pagePopup | ( | const QPoint & | globalPos | ) | [private, slot] |
Slot called when right-clicked in current page
| globalPos | Position of mouse cursor |
| void gui::PdfEditWindow::receiveHelpText | ( | const QString & | message | ) | [slot] |
Signal called when receiving help message. Show it in statusbar
| message | Help message |
| void gui::PdfEditWindow::restoreWindowState | ( | ) |
Restores window state from application settings
| void gui::PdfEditWindow::revisionChanged | ( | int | revision | ) | [signal] |
Signal emitted when user changes the current revision in any way (script, revision tool ...)
| revision | number of selected revision |
| void gui::PdfEditWindow::run | ( | const QString & | scriptName | ) |
Runs script from given file, looking in script path first
| scriptName | name of file with QT Script to run |
Referenced by runCmdScripts().
| void gui::PdfEditWindow::runFile | ( | const QString & | scriptName | ) |
Runs script from given file
| scriptName | name of file with QT Script to run |
Referenced by runCmdScripts().
| void gui::PdfEditWindow::runScript | ( | QString | script | ) | [private, slot] |
Runs given script code
| script | QT Script code to run |
| bool gui::PdfEditWindow::save | ( | bool | newRevision = false |
) |
Save currently edited document to disk If the document have no name (newly opened/generated document), it is solicited from used via dialog.
| newRevision | If true, create new revision while saving |
| bool gui::PdfEditWindow::saveCopy | ( | const QString & | name | ) |
Save currently edited document to disk, using provided filename
| name | New filename to save document under |
References fileName.
| void gui::PdfEditWindow::saveVisibility | ( | QWidget * | w, | |
| const QString & | name | |||
| ) |
Saves window visibility state to application settings
| w | Widget to save | |
| name | Name of key in settings |
| void gui::PdfEditWindow::saveWindowState | ( | ) |
Saves window state to application settings
Referenced by create().
| void gui::PdfEditWindow::selfDestruct | ( | ) | [signal] |
Signal emitted when closing a file or editor window. All helper editor widgets opened from this window that are subclasses of SelfDestructiveWidget will close themselves
| void gui::PdfEditWindow::setFileName | ( | const QString & | name | ) | [private] |
Assign given filename for document in editor. Also updates window title, etc ...
| name | New filename for document |
References base, and gui::Base::setError().
| void gui::PdfEditWindow::setObject | ( | ) | [protected, slot] |
Called upon selecting some item in treeview
| void gui::PdfEditWindow::setSelection | ( | std::vector< boost::shared_ptr< CAnnotation > > | vec | ) | [slot] |
Slot called on selecting something from page -> display it in the tree
| vec | Vector with annotations |
| void gui::PdfEditWindow::setSelection | ( | std::vector< boost::shared_ptr< PdfOperator > > | vec | ) | [slot] |
Slot called on selecting something from page -> display it in the tree
| vec | Vector with operators |
References base, gui::BaseCore::call(), prop, selectedProperty, and gui::PropertyEditor::setObject().
| void gui::PdfEditWindow::settingUpdate | ( | QString | key | ) | [private, slot] |
Called when any settings are updated (in script, option editor, etc ...)
| key | Key of setting that was updated |
| void gui::PdfEditWindow::setTitle | ( | int | revision = 0 |
) | [private] |
Set window title, according to stored baseName and active revision number, and also some other facts (if document is linearized, etc ...)
| revision | Revision number |
References APP_NAME, baseName, and PDFEDIT_VERSION.
| void gui::PdfEditWindow::treeClicked | ( | int | button, | |
| QListViewItem * | item | |||
| ) | [protected, slot] |
Called when clicked anywhere in tree windows
| button | Button used to click (1=left, 2=right, 4=middle, 8=doubleclick with left) | |
| item | Item that was clicked on, if clicked outside item, NULL is sent |
| void gui::PdfEditWindow::unsetObjectIf | ( | TreeItemAbstract * | theItem | ) | [private, slot] |
Unset selected object if it is the one given in parameter (because it is about to be deleted)
| theItem | object to check (and possibly unselect) |
| void gui::PdfEditWindow::unsetObjectIf | ( | TreeItem * | ipItem | ) | [private, slot] |
Function called when deleting tree item of type TreeItem
| ipItem | object to check (and possibly unselect) |
References debug::DBG_DBG, guiPrintDbg, prop, and gui::PropertyEditor::setObject().
friend class BaseGUI [friend] |
Base should be allowed to access everything in PdfEditWindow
BaseGUI* gui::PdfEditWindow::base [private] |
Base used to host scripts
Referenced by addNumberTool(), addSelectTool(), eval(), menuActivated(), pageDeleteSelection(), setFileName(), and setSelection().
QString gui::PdfEditWindow::baseName [private] |
Name of file loaded in editor without path
Referenced by setTitle().
CommandWindow* gui::PdfEditWindow::cmdLine [private] |
Commandline window
Referenced by gui::BaseGUI::~BaseGUI().
boost::shared_ptr<CPdf> gui::PdfEditWindow::document [private] |
Edited PDF document
QString gui::PdfEditWindow::fileName [private] |
Name of file loaded in editor
Referenced by saveCopy().
Menu* gui::PdfEditWindow::menuSystem [private] |
Menus and toolbars
PageSpace* gui::PdfEditWindow::pagespc [private] |
Page space - page view Widget
Referenced by gui::BaseGUI::~BaseGUI().
QProgressBar* gui::PdfEditWindow::progressBar [private] |
Progressbar widget
boost::shared_ptr<pdfobjects::utils::ProgressObserver> gui::PdfEditWindow::progressObserver [private] |
Progress observer which holds progress bar. Value is initialized in constructor. Wrapped qt progress bar instance is allocated in constructor but deallocating by qt.
PropertyEditor* gui::PdfEditWindow::prop [private] |
Property editor
Referenced by setSelection(), and unsetObjectIf().
boost::shared_ptr<PdfOperator> gui::PdfEditWindow::selectedOperator [private] |
Currently selected PdfOperator (in editor)
boost::shared_ptr<CPage> gui::PdfEditWindow::selectedPage [private] |
Currently selected page (for scripting)
Referenced by pageNumber().
int gui::PdfEditWindow::selectedPageNumber [private] |
Currently selected page number
boost::shared_ptr<IProperty> gui::PdfEditWindow::selectedProperty [private] |
Currently selected IProperty (in editor)
Referenced by setSelection().
Currently selected tree item (for scripting)
QSplitter* gui::PdfEditWindow::spl [private] |
Horizontal splitter between (Preview + Commandline) and (Treeview + Property editor)
QSplitter* gui::PdfEditWindow::splCmd [private] |
Vertical splitter between command line and preview window
QSplitter* gui::PdfEditWindow::splProp [private] |
Vertical splitter between treeview and property editor
StatusBar* gui::PdfEditWindow::status [private] |
Status bar on bottmo of application
MultiTreeWindow* gui::PdfEditWindow::tree [private] |
Object treeview