• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • interfaces
 

interfaces

Public Member Functions | List of all members
TerminalInterface Class Referenceabstract

#include <kde_terminal_interface.h>

Public Member Functions

virtual void startProgram (const TQString &program, const TQStrList &args)=0
 
virtual void showShellInDir (const TQString &dir)=0
 
virtual void sendInput (const TQString &text)=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 TQObject, which TerminalInterface is not. These are the signals you can connect to: void processExited( TDEProcess *process ); void receivedData( const TQString& s ); See the example code below for how to connect to these..

The process provided by processExited() is obviously exited, and is only guaranteed to be valid until you return from the slot connected to it!

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", "TQObject",
"KParts::ReadOnlyPart" ) );
assert( p );
setCentralWidget( p->widget() );
// cast the part to the TerminalInterface..
TerminalInterface* t = ::tqt_cast<TerminalInterface*>( p );
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( TQDir::home().path() );
// or:
// TQStrList l;
// l.append( "python" );
// t->startProgram( TQString::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 TQObject,
// and as such cannot have signals..:
// connect( p, TQ_SIGNAL( processExited( int ) ),
// this, TQ_SLOT( shellExited( int ) ) );
// etc.
KLibFactory
KLibFactory::create
TQObject * create(TQObject *parent=0, const char *name=0, const char *classname="TQObject", const TQStringList &args=TQStringList())
KLibLoader::self
static KLibLoader * self()
KLibLoader::factory
KLibFactory * factory(const char *libname)
KParts::Part
KParts::Part::widget
virtual TQWidget * widget()
TerminalInterface
TerminalInterface is an interface implemented by KonsolePart to allow developers access to the Konsol...
Definition: kde_terminal_interface.h:92
Since
3.2
Author
Dominique Devriese devri.nosp@m.ese@.nosp@m.kde.o.nosp@m.rg

Definition at line 91 of file kde_terminal_interface.h.

Member Function Documentation

◆ sendInput()

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

This sends.

Parameters
textas input to the currently running program..

◆ showShellInDir()

virtual void TerminalInterface::showShellInDir ( const TQString &  dir)
pure virtual

If a shell is currently shown, this sends it a cd command.

Otherwise, this starts a shell, and sends it a cd command too...

◆ startProgram()

virtual void TerminalInterface::startProgram ( const TQString &  program,
const TQStrList &  args 
)
pure virtual

This starts program, with arguments args.


The documentation for this class was generated from the following file:
  • kde_terminal_interface.h

interfaces

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

interfaces

Skip menu "interfaces"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for interfaces by doxygen 1.9.4
This website is maintained by Timothy Pearson.