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. */
56 Application(Display
* display
, Qt::HANDLE visual
, Qt::HANDLE colormap
);
59 /** Constructs a new Konsole application. */
62 virtual ~Application();
64 /** Creates a new main window and opens a default terminal session */
65 virtual int newInstance();
68 * Creates a new, empty main window and connects to its newSessionRequest()
69 * and newWindowRequest() signals to trigger creation of new sessions or
70 * windows when then they are emitted.
72 MainWindow
* newMainWindow();
74 /** Returns the Application instance */
75 static Application
* self();
78 Session
* createSession(Profile::Ptr profile
, const QString
& directory
, ViewManager
* view
);
79 void createWindow(Profile::Ptr profile
, const QString
& directory
);
80 void detachView(Session
* session
);
82 void toggleBackgroundInstance();
86 void listAvailableProfiles();
87 void startBackgroundMode(MainWindow
* window
);
88 bool processHelpArgs(KCmdLineArgs
* args
);
89 MainWindow
* processWindowArgs(KCmdLineArgs
* args
);
90 void processProfileSelectArgs(KCmdLineArgs
* args
,MainWindow
* window
);
91 void processProfileChangeArgs(KCmdLineArgs
* args
,MainWindow
* window
);
93 KCmdLineArgs
* _arguments
;
94 ProfileList
* _sessionList
;
96 MainWindow
* _backgroundInstance
;
100 #endif //APPLICATION_H