2004-08-26 21:17:24 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
|
|
|
|
* Copyright (C) 2003 by Benjamin Meyer <benjamin@csh.rit.edu> *
|
|
|
|
* Copyright (C) 2003 by Laurent Montel <montel@kde.org> *
|
|
|
|
* Copyright (C) 2003 by Luboš Luňák <l.lunak@kde.org> *
|
|
|
|
* Copyright (C) 2004 by Christophe Devriese *
|
|
|
|
* <Christophe.Devriese@student.kuleuven.ac.be> *
|
|
|
|
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
2004-01-15 05:42:12 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_SHELL_H_
|
|
|
|
#define _OKULAR_SHELL_H_
|
2002-09-02 20:21:47 +00:00
|
|
|
|
|
|
|
#include <kparts/mainwindow.h>
|
2006-05-08 19:26:45 +00:00
|
|
|
|
2007-01-04 00:20:50 +00:00
|
|
|
class KCmdLineArgs;
|
2006-05-08 19:26:45 +00:00
|
|
|
class KRecentFilesAction;
|
|
|
|
class KToggleAction;
|
2003-09-15 12:12:53 +00:00
|
|
|
|
2007-01-04 00:20:50 +00:00
|
|
|
class KDocumentViewer;
|
2005-07-15 17:17:13 +00:00
|
|
|
class Part;
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the application "Shell". It has a menubar and a toolbar
|
|
|
|
* but relies on the "Part" to do all the real work.
|
|
|
|
*
|
|
|
|
* @short Application Shell
|
|
|
|
* @author Wilco Greven <greven@kde.org>
|
|
|
|
* @version 0.1
|
|
|
|
*/
|
|
|
|
class Shell : public KParts::MainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
2007-01-04 00:20:50 +00:00
|
|
|
* Constructor
|
2006-09-21 08:45:36 +00:00
|
|
|
*/
|
2007-04-15 19:11:10 +00:00
|
|
|
explicit Shell(KCmdLineArgs* args = 0, const KUrl &url = KUrl());
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default Destructor
|
|
|
|
*/
|
|
|
|
virtual ~Shell();
|
2009-01-17 13:39:21 +00:00
|
|
|
|
|
|
|
QSize sizeHint() const;
|
2006-09-21 08:45:36 +00:00
|
|
|
public slots:
|
|
|
|
void slotQuit();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* This method is called when it is time for the app to save its
|
|
|
|
* properties for session management purposes.
|
|
|
|
*/
|
2007-02-20 15:48:18 +00:00
|
|
|
void saveProperties(KConfigGroup&);
|
2006-09-21 08:45:36 +00:00
|
|
|
|
2002-09-02 20:21:47 +00:00
|
|
|
/**
|
2006-09-21 08:45:36 +00:00
|
|
|
* This method is called when this app is restored. The KConfig
|
|
|
|
* object points to the session management config file that was saved
|
|
|
|
* with @ref saveProperties
|
2002-09-02 20:21:47 +00:00
|
|
|
*/
|
2007-02-21 15:12:57 +00:00
|
|
|
void readProperties(const KConfigGroup&);
|
2006-09-21 08:45:36 +00:00
|
|
|
void readSettings();
|
|
|
|
void writeSettings();
|
|
|
|
void setFullScreen( bool );
|
|
|
|
|
2008-12-18 22:08:39 +00:00
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
private slots:
|
|
|
|
void fileOpen();
|
|
|
|
|
|
|
|
void slotUpdateFullScreen();
|
|
|
|
void slotShowMenubar();
|
|
|
|
|
2007-01-04 00:20:50 +00:00
|
|
|
void openUrl( const KUrl & url, uint page = 0 );
|
2006-09-21 08:45:36 +00:00
|
|
|
void delayedOpen();
|
|
|
|
|
|
|
|
signals:
|
2007-02-21 15:12:57 +00:00
|
|
|
void restoreDocument(const KConfigGroup &group);
|
2007-02-20 15:48:18 +00:00
|
|
|
void saveDocumentRestoreInfo(KConfigGroup &group);
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setupAccel();
|
|
|
|
void setupActions();
|
|
|
|
void init();
|
2007-02-07 17:25:51 +00:00
|
|
|
QStringList fileFormats() const;
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
private:
|
2007-01-04 00:20:50 +00:00
|
|
|
KCmdLineArgs* m_args;
|
2006-09-21 08:45:36 +00:00
|
|
|
KParts::ReadOnlyPart* m_part;
|
2007-01-04 00:20:50 +00:00
|
|
|
KDocumentViewer* m_doc;
|
2006-09-21 08:45:36 +00:00
|
|
|
KRecentFilesAction* m_recent;
|
2007-02-07 17:25:51 +00:00
|
|
|
QStringList m_fileformats;
|
2007-07-29 21:36:02 +00:00
|
|
|
bool m_fileformatsscanned;
|
2006-09-21 08:45:36 +00:00
|
|
|
KAction* m_printAction;
|
|
|
|
KToggleAction* m_fullScreenAction;
|
|
|
|
KToggleAction* m_showMenuBarAction;
|
|
|
|
bool m_menuBarWasShown, m_toolBarWasShown;
|
|
|
|
KUrl m_openUrl;
|
|
|
|
};
|
2002-09-02 20:21:47 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// vim:ts=2:sw=2:tw=78:et
|