// {{{ the iWear header
/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Core Library
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
// }}} 

#ifndef __DAEMONHANDLE_H
#define __DAEMONHANDLE_H

#ifndef __PLUGINHANDLE_H
#include <iwear/pluginhandle.h>
#endif


namespace iwear{
    namespace uiservices{

// Forward declarations
class ApplicationService;
class Daemon;


class DaemonHandle : public PluginHandle{

public:

    /**
     * Factory method which upon success returns a pointer to
     * a new dynamic application. -- Note: This method is used instead
     * of <i>new</i> in dynamically loaded oject instances.
     * @param application_service pointer to the application_service
     */
    Daemon* create_daemon(ApplicationService* application_service);

    /**
     * Funtion which handles the destruction of a dynamically
     * loaded daemon -- Note: This method is used instead 
     * of delete on dynamically loaded object instances!
     */
    void destroy_daemon( Daemon* );

    /**
     * Getter for the daemon name
     */
    const char* get_daemon_name( void );

    /**
     * Getter for a short description of the daemon
     */
    const char* get_daemon_description( void );

    /**
     * Getter for the daemon version
     */
    const char* get_daemon_version( void );

    /**
     * The constructor
     */
    DaemonHandle( void );

    /**
     * The destructor
     */
    ~DaemonHandle( void );

protected:

private:

    /**
     * Pointer to the function that shall create the daemon.
     */
    Daemon* (*c_d)( ApplicationService*, const std::string& dn, const std::string& dd );

    void (*d_s)(Daemon*);

    const char* (*s_n)(void);

    const char* (*s_d)(void);

    const char* (*s_v)(void);

};

    } // namespace uiservices
} // namespace iwear 


#endif // __DAEMONHANDLE

