2006-11-29 00:02:19 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
|
|
|
* Copyright (C) 2006 by Holger 'zecke' Freyther <freyther@kde.org> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
2006-12-08 21:24:08 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
2006-11-29 00:02:19 +00:00
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _DOLPHIN_APPLICATION_H
|
|
|
|
#define _DOLPHIN_APPLICATION_H
|
|
|
|
|
2007-02-18 17:01:36 +00:00
|
|
|
#include <kuniqueapplication.h>
|
2006-11-29 00:02:19 +00:00
|
|
|
|
|
|
|
class DolphinMainWindow;
|
|
|
|
|
|
|
|
/**
|
2007-02-08 20:46:49 +00:00
|
|
|
* @brief Holds the application data which can be accessed.
|
2006-11-29 00:02:19 +00:00
|
|
|
* At first this will hold a list of DolphinMainWindows which
|
2007-02-08 20:46:49 +00:00
|
|
|
* we will delete on application exit.
|
2006-11-29 00:02:19 +00:00
|
|
|
*/
|
|
|
|
|
2007-02-18 17:01:36 +00:00
|
|
|
class DolphinApplication : public KUniqueApplication
|
2007-02-08 20:46:49 +00:00
|
|
|
{
|
2006-11-29 00:02:19 +00:00
|
|
|
Q_OBJECT
|
2007-02-18 17:01:36 +00:00
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.dolphin.Application")
|
2006-11-29 00:02:19 +00:00
|
|
|
friend class DolphinMainWindow;
|
2007-02-08 20:46:49 +00:00
|
|
|
|
2006-11-29 00:02:19 +00:00
|
|
|
public:
|
|
|
|
DolphinApplication();
|
2007-02-08 20:46:49 +00:00
|
|
|
virtual ~DolphinApplication();
|
2006-11-29 00:02:19 +00:00
|
|
|
|
|
|
|
static DolphinApplication* app();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new mainwindow which is owned
|
|
|
|
* by the application.
|
|
|
|
*/
|
|
|
|
DolphinMainWindow* createMainWindow();
|
|
|
|
void refreshMainWindows();
|
|
|
|
|
2007-02-18 17:01:36 +00:00
|
|
|
public slots:
|
|
|
|
int openWindow(const QString& url);
|
|
|
|
|
2006-11-29 00:02:19 +00:00
|
|
|
protected:
|
2007-02-08 20:46:49 +00:00
|
|
|
/** Called by the DolphinMainWindow to deregister. */
|
|
|
|
void removeMainWindow(DolphinMainWindow* mainWindow);
|
2006-11-29 00:02:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QList<DolphinMainWindow*> m_mainWindows;
|
2007-02-18 17:01:36 +00:00
|
|
|
int m_lastId;
|
2006-11-29 00:02:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|