~larryprice/acolyterm/release-0.1

« back to all changes in this revision

Viewing changes to src/plugin/qmltermwidget/src/ksession.h

  • Committer: Larry Price
  • Date: 2016-06-15 14:47:59 UTC
  • Revision ID: larry.price@canonical.com-20160615144759-6wopn0gxwgta3x1n
Updating QMLTermWidget and removing unnecessary konsole codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
{
36
36
    Q_OBJECT
37
37
    Q_PROPERTY(QString  kbScheme  READ  getKeyBindings WRITE setKeyBindings NOTIFY changedKeyBindings)
38
 
    Q_PROPERTY(QString  initialWorkingDirectory READ getInitialWorkingDirectory WRITE setInitialWorkingDirectory)
39
 
    Q_PROPERTY(QString  title READ getTitle NOTIFY titleChanged)
 
38
    Q_PROPERTY(QString  initialWorkingDirectory READ getInitialWorkingDirectory WRITE setInitialWorkingDirectory NOTIFY initialWorkingDirectoryChanged)
 
39
    Q_PROPERTY(QString  title READ getTitle WRITE setTitle NOTIFY titleChanged)
40
40
    Q_PROPERTY(QString  shellProgram WRITE setShellProgram)
 
41
    Q_PROPERTY(QStringList  shellProgramArgs WRITE setArgs)
 
42
    Q_PROPERTY(QString  history READ getHistory)
 
43
    Q_PROPERTY(bool hasActiveProcess READ hasActiveProcess)
 
44
    Q_PROPERTY(QString foregroundProcessName READ foregroundProcessName)
41
45
 
42
46
public:
43
47
    KSession(QObject *parent = 0);
44
48
    ~KSession();
45
 
    
 
49
 
46
50
public:
47
51
    //bool setup();
48
52
    void addView(TerminalDisplay *display);
60
64
    void setInitialWorkingDirectory(const QString & dir);
61
65
    QString getInitialWorkingDirectory();
62
66
 
63
 
    // Shell program args, default is none
64
 
    void setArgs(QStringList & args);
65
 
 
66
67
    //Text codec, default is UTF-8
67
68
    void setTextCodec(QTextCodec * codec);
68
69
 
69
70
    // History size for scrolling
70
71
    void setHistorySize(int lines); //infinite if lines < 0
 
72
    int historySize() const;
 
73
 
 
74
    QString getHistory() const;
71
75
 
72
76
    // Sets whether flow control is enabled
73
77
    void setFlowControlEnabled(bool enabled);
90
94
 
91
95
    QString getTitle();
92
96
 
 
97
    /**
 
98
     * Returns \c true if the session has an active subprocess running in it
 
99
     * spawned from the initial shell.
 
100
     */
 
101
    bool hasActiveProcess() const;
 
102
 
 
103
    /**
 
104
     * Returns the name of the terminal's foreground process.
 
105
     */
 
106
    QString foregroundProcessName();
 
107
 
93
108
signals:
 
109
    void started();
94
110
    void finished();
95
111
    void copyAvailable(bool);
96
112
 
103
119
 
104
120
    void titleChanged();
105
121
 
 
122
    void historySizeChanged();
 
123
 
 
124
    void initialWorkingDirectoryChanged();
 
125
 
 
126
    void matchFound(int startColumn, int startLine, int endColumn, int endLine);
 
127
    void noMatchFound();
106
128
 
107
129
public slots:
108
130
    /*! Set named key binding for given widget
112
134
 
113
135
    void startShellProgram();
114
136
 
 
137
    bool sendSignal(int signal);
 
138
 
115
139
    //  Shell program, default is /bin/bash
116
140
    void setShellProgram(const QString & progname);
117
141
 
 
142
    // Shell program args, default is none
 
143
    void setArgs(const QStringList &args);
 
144
 
118
145
    int getShellPID();
119
146
    void changeDir(const QString & dir);
120
147
 
123
150
    // Send some text to terminal
124
151
    void sendKey(int rep, int key, int mod) const;
125
152
 
 
153
    void clearScreen();
 
154
 
 
155
    // Search history
 
156
    void search(const QString &regexp, int startLine = 0, int startColumn = 0, bool forwards = true );
126
157
 
127
158
protected slots:
128
159
    void sessionFinished();