summaryrefslogtreecommitdiff
authorzecke <zecke>2005-03-17 23:59:00 (UTC)
committer zecke <zecke>2005-03-17 23:59:00 (UTC)
commitc3ba7d98dc7d13132a75a14fce2cdaac6631dd26 (patch) (side-by-side diff)
tree5732025b302537adf518bd3d5f8b36a8e18f84cc
parentc87b38dc7b0acc53f5c92ac5e53f40cfff15d956 (diff)
downloadopie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.zip
opie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.tar.gz
opie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.tar.bz2
Update the API Documentation for OProcess and OApplicationFactory
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oapplicationfactory.h2
-rw-r--r--libopie2/opiecore/oprocess.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/oapplicationfactory.h b/libopie2/opiecore/oapplicationfactory.h
index cabaf79..8516565 100644
--- a/libopie2/opiecore/oapplicationfactory.h
+++ b/libopie2/opiecore/oapplicationfactory.h
@@ -162,129 +162,129 @@ struct OPrivate {
}
};
template <>
struct OPrivate<Opie::Core::NullType > {
inline static QWidget* multiFactory ( const QString& , QWidget* ,
const char* , Qt::WFlags ) {
return 0l;
}
inline static QStringList multiString( const QStringList& _list ) {
return _list;
}
};
/*
template <>
struct OPrivate <Opie::NullType, Opie::NullType > {
inline static QWidget* multiFactory( const QString& , QWidget* ,
const char* , Qt::WFlags ) {
return 0l;
}
inline static QStringList multiString( const QStringList& _list ) {
return _list;
}
};
*/
template <class Product, class ProductListTail>
struct OPrivate< Opie::Core::Typelist<Product, ProductListTail> > {
inline static QWidget* multiFactory( const QString& appName, QWidget* parent,
const char* name, Qt::WFlags fl) {
QWidget* wid = OPrivate<Product>::multiFactory( appName, parent, name, fl );
if (!wid )
wid = OPrivate<ProductListTail>::multiFactory( appName, parent, name, fl );
return wid;
}
inline static QStringList multiString( const QStringList& _list ) {
QStringList list = _list;
list = OPrivate<Product>::multiString( list );
list = OPrivate<ProductListTail>::multiString( list );
return list;
}
};
/* Internal END */
/*
* If you want to export more than one Widget use that function
* Make sure all your Widgets provide the appName() static method
* otherwise you'll get a compiler error
*
- * typedef Opie::MakeTypeList<MyWidget, MyDialog, MyMediaPlayer >::Result MyTypes;
+ * typedef Opie::Core::MakeTypelist<MyWidget, MyDialog, MyMediaPlayer >::Result MyTypes;
* OPIE_EXPORT_APP( OApplicationFactory<MyTypes> )
*/
template<class Product, class ProductListTail>
struct OApplicationFactory< Opie::Core::Typelist<Product, ProductListTail > >
: ApplicationInterface {
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
*iface = 0;
if ( uuid == IID_QUnknown ) *iface = this;
else if ( uuid ==IID_QtopiaApplication ) *iface = this;
else return QS_FALSE;
(*iface)->addRef();
return QS_OK;
}
QWidget* createMainWindow ( const QString& appName, QWidget* parent,
const char* name, Qt::WFlags fl ) {
qWarning("StringList is %s", applications().join(":").latin1() );
return OPrivate< Opie::Core::Typelist<Product, ProductListTail > >::multiFactory( appName, parent, name, fl );
}
QStringList applications()const {
QStringList _list;
return OPrivate< Opie::Core::Typelist<Product, ProductListTail> >::multiString( _list );
}
Q_REFCOUNT
};
}
}
/* If the library version should be build */
#ifdef OPIE_APP_INTERFACE
#define OPIE_EXPORT_APP( factory ) Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( factory ) }
#else
#include <qpe/qpeapplication.h>
#define OPIE_EXPORT_APP( Factory ) \
int main( int argc, char **argv ) { \
QPEApplication a(argc, argv ); \
QWidget *mw = 0;\
\
/* method from TT */ \
QString executableName = QString::fromLatin1( argv[0] ); \
executableName = executableName.right(executableName.length() \
- executableName.findRev('/') - 1); \
\
Factory f; \
QStringList list = f.applications(); \
if (list.contains(executableName) ) \
mw = f.createMainWindow(executableName, 0, 0, 0 ); \
else \
mw = f.createMainWindow( list[0], 0, 0, 0 ); \
\
if( mw ) { \
if ( mw->metaObject()->slotNames().contains("setDocument(const QString&)" ) ) \
a.showMainDocumentWidget( mw ); \
else \
a.showMainWidget( mw ); \
\
int rv = a.exec(); \
delete mw; \
diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h
index ac6be98..23e9b10 100644
--- a/libopie2/opiecore/oprocess.h
+++ b/libopie2/opiecore/oprocess.h
@@ -40,129 +40,129 @@ _;:,     .>    :=|. This program is free software; you can
#include <sys/types.h> // for pid_t
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
class QSocketNotifier;
namespace Opie {
namespace Core {
namespace Internal {
class OProcessController;
class OProcessPrivate;
}
/**
* Child process invocation, monitoring and control.
*
* @par General usage and features
*
*This class allows a KDE and OPIE application to start child processes without having
*to worry about UN*X signal handling issues and zombie process reaping.
*
*@see KProcIO
*
*Basically, this class distinguishes three different ways of running
*child processes:
*
*@li OProcess::DontCare -- The child process is invoked and both the child
*process and the parent process continue concurrently.
*
*Starting a DontCare child process means that the application is
*not interested in any notification to determine whether the
*child process has already exited or not.
*
*@li OProcess::NotifyOnExit -- The child process is invoked and both the
*child and the parent process run concurrently.
*
*When the child process exits, the OProcess instance
*corresponding to it emits the Qt signal @ref processExited().
*
*Since this signal is @em not emitted from within a UN*X
*signal handler, arbitrary function calls can be made.
*
*Be aware: When the OProcess objects gets destructed, the child
*process will be killed if it is still running!
*This means in particular, that you cannot use a OProcess on the stack
*with OProcess::NotifyOnExit.
*
*@li OProcess::Block -- The child process starts and the parent process
*is suspended until the child process exits. (@em Really not recommended
*for programs with a GUI.)
*
*OProcess also provides several functions for determining the exit status
*and the pid of the child process it represents.
*
*Furthermore it is possible to supply command-line arguments to the process
*in a clean fashion (no null -- terminated stringlists and such...)
*
*A small usage example:
*<pre>
*OProcess *proc = new OProcess;
*
**proc << "my_executable";
**proc << "These" << "are" << "the" << "command" << "line" << "args";
- *QApplication::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)),
+ *QObject::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)),
* pointer_to_my_object, SLOT(my_objects_slot(Opie::Core::OProcess *)));
*proc->start();
*</pre>
*
*This will start "my_executable" with the commandline arguments "These"...
*
*When the child process exits, the respective Qt signal will be emitted.
*
*@par Communication with the child process
*
*OProcess supports communication with the child process through
*stdin/stdout/stderr.
*
*The following functions are provided for getting data from the child
*process or sending data to the child's stdin (For more information,
*have a look at the documentation of each function):
*
*@li bool @ref writeStdin(char *buffer, int buflen);
*@li -- Transmit data to the child process's stdin.
*
*@li bool @ref closeStdin();
*@li -- Closes the child process's stdin (which causes it to see an feof(stdin)).
*Returns false if you try to close stdin for a process that has been started
*without a communication channel to stdin.
*
*@li bool @ref closeStdout();
*@li -- Closes the child process's stdout.
*Returns false if you try to close stdout for a process that has been started
*without a communication channel to stdout.
*
*@li bool @ref closeStderr();
*@li -- Closes the child process's stderr.
*Returns false if you try to close stderr for a process that has been started
*without a communication channel to stderr.
*
*
*@par QT signals:
*
*@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen);
*@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen);
*@li -- Indicates that new data has arrived from either the
*child process's stdout or stderr.
*
*@li void @ref wroteStdin(OProcess *proc);
*@li -- Indicates that all data that has been sent to the child process
*by a prior call to @ref writeStdin() has actually been transmitted to the
*client .
*
*@author Christian Czezakte e9025461@student.tuwien.ac.at
*@author Holger Freyther (Opie Port)
*
**/
class OProcess : public QObject
{
Q_OBJECT
public:
/**
* Modes in which the communication channel can be opened.
*
* If communication for more than one channel is required,
* the values have to be or'ed together, for example to get
* communication with stdout as well as with stdin, you would