~ubuntu-branches/ubuntu/raring/juffed/raring

« back to all changes in this revision

Viewing changes to plugins/terminal/qtermwidget/lib/qtermwidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2011-04-30 13:43:26 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110430134326-0bnvvo5z2medbdxi
Tags: 0.9.1137-1
* New upstream release.
* Remove debian/juffed.1, added upstream (in debian.in).
* Remove debian/patches/static.patch: we can now bundle the .so after
  upstream has resolved soname issues.
* debian/control:
  - Bump Standards-Version to 0.9.2.
  - Update homepage.
  - Do not build-depend on chrpath, not needed anymore.
* debian/rules:
  - Remove chrpath rule, not needed anymore.
* Add juffed-dev and juffed-plugins packages.
* Do not install the libkeybindings.so plugin: causes a segfault on my
  amd64 machine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  Copyright (C) 2008 e_k (e_k@users.sourceforge.net)
 
2
    
 
3
    This library is free software; you can redistribute it and/or
 
4
    modify it under the terms of the GNU Library General Public
 
5
    License as published by the Free Software Foundation; either
 
6
    version 2 of the License, or (at your option) any later version.
 
7
                    
 
8
    This library is distributed in the hope that it will be useful,
 
9
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
    Library General Public License for more details.
 
12
                            
 
13
    You should have received a copy of the GNU Library General Public License
 
14
    along with this library; see the file COPYING.LIB.  If not, write to
 
15
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
16
    Boston, MA 02110-1301, USA.
 
17
*/
 
18
                                                    
 
19
 
 
20
#ifndef _Q_TERM_WIDGET
 
21
#define _Q_TERM_WIDGET
 
22
 
 
23
#include <QtGui>
 
24
 
 
25
struct TermWidgetImpl;
 
26
 
 
27
enum COLOR_SCHEME {     COLOR_SCHEME_WHITE_ON_BLACK     = 1,
 
28
                        COLOR_SCHEME_GREEN_ON_BLACK,
 
29
                        COLOR_SCHEME_BLACK_ON_LIGHT_YELLOW };
 
30
 
 
31
class QTermWidget : public QWidget
 
32
{
 
33
    Q_OBJECT
 
34
public:
 
35
    
 
36
    enum ScrollBarPosition
 
37
    {
 
38
        /** Do not show the scroll bar. */
 
39
        NoScrollBar=0,
 
40
        /** Show the scroll bar on the left side of the display. */
 
41
        ScrollBarLeft=1,
 
42
        /** Show the scroll bar on the right side of the display. */
 
43
        ScrollBarRight=2
 
44
    };
 
45
 
 
46
 
 
47
    //Creation of widget
 
48
    QTermWidget(int startnow = 1, //start shell programm immediatelly
 
49
                QWidget *parent = 0);
 
50
    ~QTermWidget();
 
51
 
 
52
    //start shell program if it was not started in constructor
 
53
    void startShellProgram();
 
54
    
 
55
    //look-n-feel, if you don`t like defaults
 
56
 
 
57
    //  Terminal font
 
58
    // Default is application font with family Monospace, size 10
 
59
    // USE ONLY FIXED-PITCH FONT!
 
60
    // otherwise symbols' position could be incorrect
 
61
    void setTerminalFont(QFont &font); 
 
62
    
 
63
    //environment
 
64
    void setEnvironment(const QStringList& environment);
 
65
 
 
66
    //  Shell program, default is /bin/bash
 
67
    void setShellProgram(const QString &progname);
 
68
    
 
69
    //working directory
 
70
    void setWorkingDirectory(const QString& dir);
 
71
 
 
72
    // Shell program args, default is none
 
73
    void setArgs(QStringList &args);
 
74
    
 
75
    //Text codec, default is UTF-8
 
76
    void setTextCodec(QTextCodec *codec);
 
77
 
 
78
    //Color scheme, default is white on black
 
79
    void setColorScheme(int scheme);
 
80
    
 
81
    //set size
 
82
    void setSize(int h, int v);
 
83
    
 
84
    // History size for scrolling 
 
85
    void setHistorySize(int lines); //infinite if lines < 0
 
86
 
 
87
    // Presence of scrollbar
 
88
    void setScrollBarPosition(ScrollBarPosition);
 
89
    
 
90
    // Send some text to terminal
 
91
    void sendText(QString &text);
 
92
 
 
93
    // Sets whether flow control is enabled
 
94
    void setFlowControlEnabled(bool enabled);
 
95
 
 
96
    // Returns whether flow control is enabled
 
97
    bool flowControlEnabled(void);
 
98
 
 
99
    /**
 
100
     * Sets whether the flow control warning box should be shown
 
101
     * when the flow control stop key (Ctrl+S) is pressed.
 
102
     */
 
103
    void setFlowControlWarningEnabled(bool enabled);
 
104
            
 
105
signals:
 
106
    void finished();
 
107
 
 
108
public slots:
 
109
    // Paste clipboard content to terminal
 
110
    void copyClipboard();
 
111
    
 
112
     // Copies selection to clipboard
 
113
    void pasteClipboard();
 
114
        
 
115
protected: 
 
116
    virtual void resizeEvent(QResizeEvent *);
 
117
    
 
118
protected slots:
 
119
    void sessionFinished();        
 
120
    
 
121
private:
 
122
    void init();    
 
123
    TermWidgetImpl *m_impl;
 
124
};
 
125
 
 
126
 
 
127
//Maybe useful, maybe not
 
128
 
 
129
#ifdef __cplusplus
 
130
extern "C"
 
131
#endif
 
132
void *createTermWidget(int startnow, void *parent); 
 
133
 
 
134
#endif
 
135