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

Interfaces

Public Member Functions | List of all members
TerminalInterface Class Referenceabstract

#include <kde_terminal_interface.h>

Inheritance diagram for TerminalInterface:
Inheritance graph
[legend]

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 some signals you can connect to: void currentDirectoryChanged(const QString& dir);

See the example code below for how to connect to these.

Use it like this:

//query the .desktop file to get service information about konsolepart
KService::Ptr service = KService::serviceByDesktopName("konsolepart");
if (!service)
{
QMessageBox::critical(this, tr("Konsole not installed"), tr("Please install the kde konsole and try again!"), QMessageBox::Ok);
return ;
}
// create one instance of konsolepart
KParts::ReadOnlyPart* p = service->createInstance<KParts::ReadOnlyPart>(parent, parentWidget, QVariantList());
if (!p)
{
return;
}
// cast the konsolepart to the TerminalInterface..
TerminalInterface* t = qobject_cast<TerminalInterface*>(p);
if (!t)
{
return;
}
// now use the interface in all sorts of ways, e.g.
// t->showShellInDir( QDir::home().path() );
// or:
// QStringList 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(currentDirectoryChanged(QString)),
// this, SLOT(currentDirectoryChanged(QString)));
// etc.
Author
Dominique Devriese devri.nosp@m.ese@.nosp@m.kde.o.nosp@m.rg

Definition at line 85 of file kde_terminal_interface.h.

Constructor & Destructor Documentation

virtual TerminalInterface::~TerminalInterface ( )
inlinevirtual

Definition at line 88 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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Interfaces

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

kdelibs API Reference

Skip menu "kdelibs 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

Search



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