~ubuntu-branches/ubuntu/utopic/kdebase/utopic

« back to all changes in this revision

Viewing changes to konsole/src/Application.h

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers, José Manuel Santamaría Lema, Modestas Vainius
  • Date: 2011-05-26 02:53:50 UTC
  • mfrom: (0.7.7 upstream) (0.4.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 296.
  • Revision ID: james.westby@ubuntu.com-20110526025350-7o10g65yegec2rnq
Tags: 4:4.6.3-1
* New upstream release.

[ José Manuel Santamaría Lema ]
* Bump kde-sc-dev-latest build dependency to 4:4.6.3.
* Bump Standards-Version to 3.9.2; no changes needed.

[ Modestas Vainius ]
* Enable DLRestrictions for libraries in this package. Requires
  libdlrestrictions-dev 0.14 and kdelibs5-dev 4:4.6.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
    02110-1301  USA.
 
18
*/
 
19
 
 
20
#ifndef APPLICATION_H
 
21
#define APPLICATION_H
 
22
 
 
23
// KDE 
 
24
#include <KUniqueApplication>
 
25
 
 
26
// Konsole
 
27
#include "Profile.h"
 
28
 
 
29
class KCmdLineArgs;
 
30
 
 
31
namespace Konsole
 
32
{
 
33
class ProfileList;
 
34
class ViewManager;
 
35
class MainWindow;
 
36
class Session;
 
37
 
 
38
/**
 
39
 * The Konsole Application.
 
40
 *
 
41
 * The application consists of one or more main windows and a set of factories to create 
 
42
 * new sessions and views.
 
43
 *
 
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().
 
46
 *
 
47
 * The factory used to create new terminal sessions can be retrieved using the sessionManager() accessor.
 
48
 */
 
49
class Application : public KUniqueApplication
 
50
{
 
51
Q_OBJECT
 
52
 
 
53
public:
 
54
    /** Constructs a new Konsole application. */
 
55
    Application();
 
56
    
 
57
    virtual ~Application();
 
58
 
 
59
    /** Creates a new main window and opens a default terminal session */
 
60
    virtual int newInstance();
 
61
 
 
62
    /** 
 
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.  
 
66
     */
 
67
    MainWindow* newMainWindow();
 
68
 
 
69
    /** Returns the Application instance */
 
70
    static Application* self();
 
71
 
 
72
private slots:
 
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);
 
77
 
 
78
    void toggleBackgroundInstance();
 
79
 
 
80
private:
 
81
    void init();
 
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>&);
 
90
 
 
91
    KCmdLineArgs*   _arguments;
 
92
    ProfileList*    _sessionList;
 
93
    
 
94
    MainWindow* _backgroundInstance;
 
95
};
 
96
 
 
97
}
 
98
#endif //APPLICATION_H