upper
[kdegraphics.git] / okular / shell / shell.h
blobed6238db93e9bbe2a8486bdd9ecf9db9ab9449df
1 /***************************************************************************
2 * Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
3 * Copyright (C) 2003 by Benjamin Meyer <benjamin@csh.rit.edu> *
4 * Copyright (C) 2003 by Laurent Montel <montel@kde.org> *
5 * Copyright (C) 2003 by Luboš Luňák <l.lunak@kde.org> *
6 * Copyright (C) 2004 by Christophe Devriese *
7 * <Christophe.Devriese@student.kuleuven.ac.be> *
8 * Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
9 * *
10 * This program 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 ***************************************************************************/
16 #ifndef _OKULAR_SHELL_H_
17 #define _OKULAR_SHELL_H_
19 #include <kparts/mainwindow.h>
21 class KCmdLineArgs;
22 class KRecentFilesAction;
23 class KToggleAction;
25 class KDocumentViewer;
26 class Part;
28 /**
29 * This is the application "Shell". It has a menubar and a toolbar
30 * but relies on the "Part" to do all the real work.
32 * @short Application Shell
33 * @author Wilco Greven <greven@kde.org>
34 * @version 0.1
36 class Shell : public KParts::MainWindow
38 Q_OBJECT
40 public:
41 /**
42 * Constructor
44 explicit Shell(KCmdLineArgs* args = 0, const KUrl &url = KUrl());
46 /**
47 * Default Destructor
49 virtual ~Shell();
50 public slots:
51 void slotQuit();
53 protected:
54 /**
55 * This method is called when it is time for the app to save its
56 * properties for session management purposes.
58 void saveProperties(KConfigGroup&);
60 /**
61 * This method is called when this app is restored. The KConfig
62 * object points to the session management config file that was saved
63 * with @ref saveProperties
65 void readProperties(const KConfigGroup&);
66 void readSettings();
67 void writeSettings();
68 void setFullScreen( bool );
70 private slots:
71 void fileOpen();
73 void slotUpdateFullScreen();
74 void slotShowMenubar();
76 void openUrl( const KUrl & url, uint page = 0 );
77 void delayedOpen();
79 signals:
80 void restoreDocument(const KConfigGroup &group);
81 void saveDocumentRestoreInfo(KConfigGroup &group);
83 private:
84 void setupAccel();
85 void setupActions();
86 void init();
87 QStringList fileFormats() const;
89 private:
90 KCmdLineArgs* m_args;
91 KParts::ReadOnlyPart* m_part;
92 KDocumentViewer* m_doc;
93 KRecentFilesAction* m_recent;
94 QStringList m_fileformats;
95 bool m_fileformatsscanned;
96 KAction* m_printAction;
97 KToggleAction* m_fullScreenAction;
98 KToggleAction* m_showMenuBarAction;
99 KToggleAction* m_showToolBarAction;
100 bool m_menuBarWasShown, m_toolBarWasShown;
101 KUrl m_openUrl;
104 #endif
106 // vim:ts=2:sw=2:tw=78:et