kextprocess
KExtProcess::ProcessFactory Class Reference
#include <processfactory.h>

Detailed Description
ProcessFactory - Create a process based on the name.This class is a singleton.
FIXME: Why did I choose the singleton pattern over simple static methods? There's no need for a factory OBJECT, just a CLASS would suffice...
- Martijn
Definition at line 60 of file processfactory.h.
Public Member Functions | |
| ExtProcess * | createProcess (Profile *profile, QObject *parent=0, const char *name=0) |
| ExtProcess * | createProcess (const QString &processType, QObject *parent=0, const char *name=0) |
| QWidget * | createProcessConfigWidget (const ProfileStep &step, QWidget *parentWidget=0, const char *name=0) |
| const ProcessTypeInfoList | processTypes () const |
| virtual | ~ProcessFactory () |
Static Public Member Functions | |
| static ProcessFactory * | self () |
Constructor & Destructor Documentation
| KExtProcess::ProcessFactory::~ProcessFactory | ( | ) | [virtual] |
Member Function Documentation
| ExtProcess * KExtProcess::ProcessFactory::createProcess | ( | Profile * | profile, | |
| QObject * | parent = 0, |
|||
| const char * | name = 0 | |||
| ) |
Create an ExtProcess defined by a Profile.
Returns a null pointer if creation fails (i.e. unknown process type).
When the profile specifies more than one step all additional steps are created as child objects of eachother. The first ProfileStep is the starting point, but not the ExtProcess that actually controls the application that ultimately has to be run. Thus it's the deepest object in the hierarchy and the LAST ProfileStep is the returned ExtProcess.
Example: 1. SSH to me@myserver 2. Su to root
The returned process is an SuProcess which has a SSHProcess as child.
- Parameters:
-
profile is the profile for which to create a KExtProcess, the other parameters are passed to the top-level QObject constructor. parent parent object name name of this object
Definition at line 104 of file processfactory.cpp.
| ExtProcess * KExtProcess::ProcessFactory::createProcess | ( | const QString & | processType, | |
| QObject * | parent = 0, |
|||
| const char * | name = 0 | |||
| ) |
Create an ExtProcess defined by the specified name.
- Parameters:
-
processType is the type of process to be created, e.g. LocalProcess or SuProcess. The value is case sensitive and corresponds to the class name that will be created. parent is the parent of the object, passed to the QObject constructor name is the name of the object, passed to the QObject constructor
- Returns:
- The new ExtProcess object, or a null pointer if creation fails (i.e. unknown process type)
Definition at line 82 of file processfactory.cpp.
| QWidget * KExtProcess::ProcessFactory::createProcessConfigWidget | ( | const ProfileStep & | step, | |
| QWidget * | parentWidget = 0, |
|||
| const char * | name = 0 | |||
| ) |
Create a configuration widget for an ExtProcess defined by the specified name.
- Parameters:
-
step is the type of process for which the config widget is to be created parentWidget is the parent QWidget of the config widget, passed to the QWidget constructor name is the parent QWidget of the config widget, passed to the QWidget constructor
- Returns:
- The configuration widget or a null pointer if creation fails (i.e. unknown process type).
Definition at line 184 of file processfactory.cpp.
| const ProcessTypeInfoList KExtProcess::ProcessFactory::processTypes | ( | ) | const |
Get a list of all available process types that can be created.
Note that NullProcess is not in the list, since it is a builtin that is created in certain error conditions, but not explicitly available for creation.
Definition at line 155 of file processfactory.cpp.
| ProcessFactory * KExtProcess::ProcessFactory::self | ( | ) | [static] |
Get our singleton instance.
Creates a new instance if none exists yet.
Definition at line 74 of file processfactory.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference