// {{{ 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 __APPLICATIONHANDLE_H
#define __APPLICATIONHANDLE_H

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


namespace iwear{
    namespace uiservices{

// Forward declarations
class Application;
class ApplicationService;


class ApplicationHandle : 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> on dynamically loaded object instances.
     */
    Application* create_application(ApplicationService* application_service,
				    bool have_switch_button = true,
				    bool have_quit_button = true,
				    bool have_up_button = true);

    /**
     * Function which handles the destruction of a dynamically
     * loaded application -- Note: This method is used instead
     * of delete on dynamically loaded object instances!
     */
    void destroy_application( Application* );

    /**
     * Getter for the application name
     */
    const char* get_application_name( void );

    /**
     * Getter for a more or less detailed description of the
     * application's purpose
     */
    const char* get_application_description( void );

    /**
     * Getter for the a version descriptor for the application
     */
    const char* get_application_version( void );

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

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

 protected:

 private:

    Application* (*c_a)( ApplicationService*, const std::string&, const std::string& );

    void (*d_s)( Application* );

    const char* (*s_n)( void );

    const char* (*s_d)( void );

    const char* (*s_v)( void );

};

    } // namespace uiservices
} // namespace iwear

#endif // __APPLICATIONHANDLE_H


