next up previous contents
Next: Makefile.am and KDE build Up: The general conduit framework Previous: How conduits work in   Contents

A conduit is a KDE shared library

From your system's point of view, a conduit is a shared library which is loaded on demand by KPilot. This means that as long as you don't do a sync, the conduit will not be in memory. Once a hotsync is initiated, kpilotDaemon (the process running in the background that does the actual sync) loads the conduit, let's say its name is "malconduit" and it is installed as /opt/kde3/lib/kde3/libmalconduit.so. It then calls the function init_libmalconduit (the name after init_ is the filename of the library), which needs to return a pointer to an instance of a KLibFactory subclass.

extern "C" {

void *init_libmalconduit() {
    return new MALConduitFactory;
}

};

Whenever the conduit needs to do some action (show the configure dialog or do a sync), the createObject(...) method of this instance is called with the appropriate values to specify the action. It either returns an instance of a ConduitConfig subclass to show the configuration dialog, or an instance of an ConduitAction subclass which will later do the actual sync with the handheld. Figure 1 shows this as a diagram:

Figure 1: The general structure of a conduit
\includegraphics[width=13cm]{ConduitStructure}


next up previous contents
Next: Makefile.am and KDE build Up: The general conduit framework Previous: How conduits work in   Contents
Reinhold Kainhofer 2003-01-13