diff options
Diffstat (limited to 'kpdf/shell/shell.h')
-rw-r--r-- | kpdf/shell/shell.h | 84 |
1 files changed, 65 insertions, 19 deletions
diff --git a/kpdf/shell/shell.h b/kpdf/shell/shell.h index 560be8fd..d1ace108 100644 --- a/kpdf/shell/shell.h +++ b/kpdf/shell/shell.h @@ -21,6 +21,17 @@ #endif #include <tdeparts/mainwindow.h> +#include "dcop.h" + +class TQToolButton; +class TQPopupMenu; +class KTabWidget; + +namespace KParts +{ + class Factory; + class PartManager; +} namespace KPDF { @@ -33,10 +44,9 @@ namespace KPDF * @author Wilco Greven <greven@kde.org> * @version 0.1 */ - class Shell : public KParts::MainWindow + class Shell : public KParts::MainWindow, virtual public KPDFShellDCOPIface { - Q_OBJECT - + TQ_OBJECT public: /** @@ -54,6 +64,18 @@ namespace KPDF */ virtual ~Shell(); + enum TabContextMenuItem + { + TabDuplicate = 100, + TabBreakOff, + TabMoveLeft, + TabMoveRight, + TabRemove, + TabRemoveOther + }; + + const KURL currentTabURL(); + protected: /** * This method is called when it is time for the app to save its @@ -72,6 +94,13 @@ namespace KPDF void setFullScreen( bool ); public slots: + void reconfigure(); + + void openURL(const KURL & url); + void addTab(); + void removeTab(); + + void slotPrint(); void slotQuit(); private slots: @@ -81,33 +110,50 @@ namespace KPDF void applyNewToolbarConfig(); void slotUpdateFullScreen(); void slotShowMenubar(); - - void openURL( const KURL & url ); void delayedOpen(); + void slotCloseTabRequest(TQWidget *w); + void slotChangeTab(KParts::Part *part); + void slotTabContextMenu(const TQPoint &pos); + void slotTabContextMenu(TQWidget *w, const TQPoint &pos); + + void slotDuplicateTab(); + void slotBreakOffTab(); + void slotMoveTabLeft(); + void slotMoveTabRight(); + void slotRemoveOtherTabs(); + void slotSetTabCaption(const TQString &caption); + void slotSetPrintActionEnabled(bool enabled); + signals: - void restoreDocument(TDEConfig* config); - void saveDocumentRestoreInfo(TDEConfig* config); - - + void restoreDocument(TDEConfig* config); + void saveDocumentRestoreInfo(TDEConfig* config); + + private: void setupAccel(); void setupActions(); void init(); + void initTabContextMenu(); + KParts::ReadOnlyPart *createTab(); + KParts::ReadOnlyPart *findPartForTab(int tabIndex); + void moveTabForward(int tabIndex); + void moveTabBackward(int tabIndex); private: - KParts::ReadOnlyPart* m_part; - TDERecentFilesAction* m_recent; - TDEAction* m_printAction; - TDEToggleAction* m_fullScreenAction; - TDEToggleAction* m_showMenuBarAction; - TDEToggleAction* m_showToolBarAction; - bool m_menuBarWasShown, m_toolBarWasShown; - KURL m_openUrl; + KTabWidget *m_tabs; + KParts::Factory *m_factory; + KParts::PartManager *m_manager; + TDERecentFilesAction* m_recent; + TDEAction *m_printAction, *m_addTabAction, *m_closeTabAction; + TDEToggleAction *m_fullScreenAction, *m_showMenuBarAction, *m_showToolBarAction; + TQToolButton *m_addTabButton, *m_removeTabButton; + TQPopupMenu *m_tabsContextMenu; + bool m_menuBarWasShown, m_toolBarWasShown; + KURL m_openUrl; // delayed open + int m_workingTab; }; } #endif - -// vim:ts=2:sw=2:tw=78:et |