2
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24
#include <KUniqueApplication>
39
* The Konsole Application.
41
* The application consists of one or more main windows and a set of factories to create
42
* new sessions and views.
44
* To create a new main window with a default terminal session, call the newInstance() method.
45
* Empty main windows can be created using newMainWindow().
47
* The factory used to create new terminal sessions can be retrieved using the sessionManager() accessor.
49
class Application : public KUniqueApplication
54
/** Constructs a new Konsole application. */
57
virtual ~Application();
59
/** Creates a new main window and opens a default terminal session */
60
virtual int newInstance();
63
* Creates a new, empty main window and connects to its newSessionRequest()
64
* and newWindowRequest() signals to trigger creation of new sessions or
65
* windows when then they are emitted.
67
MainWindow* newMainWindow();
69
/** Returns the Application instance */
70
static Application* self();
73
Session* createSession(Profile::Ptr profile, const QString& directory , ViewManager* view);
74
Session* createSSHSession(Profile::Ptr profile, const KUrl& url, ViewManager* view);
75
void createWindow(Profile::Ptr profile , const QString& directory);
76
void detachView(Session* session);
78
void toggleBackgroundInstance();
82
void listAvailableProfiles();
83
void startBackgroundMode(MainWindow* window);
84
bool processHelpArgs(KCmdLineArgs* args);
85
MainWindow* processWindowArgs(KCmdLineArgs* args);
86
void processProfileSelectArgs(KCmdLineArgs* args,MainWindow* window);
87
void processProfileChangeArgs(KCmdLineArgs* args,MainWindow* window);
88
void processTabsFromFileArgs(KCmdLineArgs* args, MainWindow* window);
89
void createTabFromArgs(KCmdLineArgs* args, MainWindow* window, const QHash<QString, QString>&);
91
KCmdLineArgs* _arguments;
92
ProfileList* _sessionList;
94
MainWindow* _backgroundInstance;
98
#endif //APPLICATION_H