.TH "TerminalInterface" kde3 "11 Jun 2005" "Version Version 3.4.1" "interfaces Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
TerminalInterface \- TerminalInterface is an interface implemented by KonsolePart to allow developers access to the KonsolePart in ways that are not possible through the normal KPart interface.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kde_terminal_interface.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBstartProgram\fP (const \fBQString\fP &program, const \fBQStrList\fP &args)=0"
.br
.ti -1c
.RI "virtual void \fBshowShellInDir\fP (const \fBQString\fP &dir)=0"
.br
.ti -1c
.RI "virtual void \fBsendInput\fP (const \fBQString\fP &text)=0"
.br
.in -1c
.SH "Detailed Description"
.PP 
TerminalInterface is an interface implemented by KonsolePart to allow developers access to the KonsolePart in ways that are not possible through the normal KPart interface. 

Note that besides the functions below here, KonsolePart also has some signals you can connect to. They aren't in this class cause we can't have signals without having a \fBQObject\fP, which TerminalInterface is not. These are the signals you can connect to: void processExited( int status ); void receivedData( const QString& s ); See the example code below for how to connect to these..
.PP
Use it like this: 
.PP
.nf
  // fetch the Library..
  KLibFactory* factory = KLibLoader::self()->factory( 'libkonsolepart' );
  if ( factory == 0L )
  {
    // inform the user that he should install konsole..
    return;
  };
  // fetch the part..
  KParts::Part* p = static_cast<KParts::Part*>(
      factory->create( this, 'tralala', 'QObject',
                       'KParts::ReadOnlyPart' ) );
  assert( p );
  setCentralWidget( p->widget() );

  // cast the part to the TerminalInterface..
  TerminalInterface* t = static_cast<TerminalInterface*>( p->qt_cast( 'TerminalInterface' ) );
  if( ! t )
  {
    // This probably happens because the konsole that is installed
    // comes from before KDE 3.2 , and the TerminalInterface is not
    // available..  What you can do here is either inform the user
    // that he needs a more recent konsole, or try to deliver the
    // functionality in some other way...
    return;
  };
  // now use the interface in all sorts of ways, e.g.
  //    t->showShellInDir( QDir::home().path() );
  // or:
  //    QStrList l;
  //    l.append( 'python' );
  //    t->startProgram( QString::fromUtf8( '/usr/bin/python' ), l);
  // or connect to one of the signals.  Connect to the Part object,
  // not to the TerminalInterface, since the latter is no QObject,
  // and as such cannot have signals..:
  //    connect( p, SIGNAL( processExited( int ) ),
  //             this, SLOT( shellExited( int ) ) );
  // etc.

.fi
.PP
.PP
\fBSince:\fP
.RS 4
3.2
.RE
.PP
\fBAuthor:\fP
.RS 4
Dominique Devriese <devriese@kde.org> 
.RE
.PP

.PP
Definition at line 85 of file kde_terminal_interface.h.
.SH "Member Function Documentation"
.PP 
.SS "virtual void TerminalInterface::startProgram (const \fBQString\fP & program, const \fBQStrList\fP & args)\fC [pure virtual]\fP"
.PP
This starts \fCprogram\fP, with arguments \fCargs\fP. 
.PP
.SS "virtual void TerminalInterface::showShellInDir (const \fBQString\fP & dir)\fC [pure virtual]\fP"
.PP
If a shell is currently shown, this sends it a cd command. 
.PP
Otherwise, this starts a shell, and sends it a cd command too... 
.SS "virtual void TerminalInterface::sendInput (const \fBQString\fP & text)\fC [pure virtual]\fP"
.PP
This sends. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP as input to the currently running program.. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for interfaces Library from the source code.
