• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.4 API Reference
  • KDE Home
  • Contact Us
 

Interfaces

Public Member Functions
TerminalInterface Class Reference

#include <kde_terminal_interface.h>

Inheritance diagram for TerminalInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~TerminalInterface ()
virtual void sendInput (const QString &text)=0
virtual void showShellInDir (const QString &dir)=0
virtual void startProgram (const QString &program, const QStringList &args)=0

Detailed Description

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 QObject, 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..

Use it like this:

// 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.
Author:
Dominique Devriese devri.nosp@m.ese@.nosp@m.kde.o.nosp@m.rg

Definition at line 84 of file kde_terminal_interface.h.


Constructor & Destructor Documentation

virtual TerminalInterface::~TerminalInterface ( )
inlinevirtual

Definition at line 87 of file kde_terminal_interface.h.


Member Function Documentation

virtual void TerminalInterface::sendInput ( const QString &  text)
pure virtual

This sends.

Parameters:
textas input to the currently running program..
virtual void TerminalInterface::showShellInDir ( const QString &  dir)
pure virtual
virtual void TerminalInterface::startProgram ( const QString &  program,
const QStringList &  args 
)
pure virtual

This starts program, with arguments args.


The documentation for this class was generated from the following file:
  • kde_terminal_interface.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue Jul 17 2012 07:43:59 by doxygen 1.8.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Interfaces

Skip menu "Interfaces"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdelibs-4.8.4 API Reference

Skip menu "kdelibs-4.8.4 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal