/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
 * Bonobo_Activation_types.idl: Basic object factory interface, based on CORBA
 * LifeCycle version
 */

#ifndef __BONOBO_ACTIVATION_TYPES_IDL__
#define __BONOBO_ACTIVATION_TYPES_IDL__

#ifndef  __Bonobo_Activation_types_COMPILATION
#ifdef   __ORBIT_IDL__
%{
#pragma include_defs bonobo-activation/Bonobo_Activation_types.h
%}
#pragma inhibit push
#endif
#endif

module Bonobo {
	typedef sequence<string> StringList;

        exception GeneralError { 
                string description; 
        };

        module Activation {
                exception NotListed {};
                exception AlreadyListed {};
                exception IncompleteContext {};
                exception ParseFailed { 
                        string description; 
                };
        };

        typedef string ImplementationID;
        typedef string ActivationID;

        typedef long ActivationFlags;
        const ActivationFlags ACTIVATION_FLAG_NO_LOCAL = 1<<0; // No shared libraries
        const ActivationFlags ACTIVATION_FLAG_PRIVATE = 1<<1; // start a new server and don't register it
        const ActivationFlags ACTIVATION_FLAG_EXISTING_ONLY = 1<<2; // don't start the server if not started
        typedef long RegistrationFlags;
        const RegistrationFlags REGISTRATION_FLAG_NO_SERVERINFO = 1<<0; // no .server file

        const long ACTIVATION_ENV_FLAG_UNSET = 1<<0;
	struct ActivationEnvValue {
		string  name;
		string  value;
                long    flags;
	};

	typedef sequence<ActivationEnvValue> ActivationEnvironment;

        /* ActivationResult */
        enum ActivationResultType { 
                ACTIVATION_RESULT_OBJECT, 
                ACTIVATION_RESULT_SHLIB, 
                ACTIVATION_RESULT_NONE 
        };

        union ActivationResultData switch (ActivationResultType) {
        case ACTIVATION_RESULT_OBJECT:
                Object res_object;
        case ACTIVATION_RESULT_SHLIB:
                Bonobo::StringList res_shlib;
        };

        struct ActivationResult {
                string aid;
                ActivationResultData res;
        };

        /* ActivationProperty */
        enum ActivationPropertyType { 
                ACTIVATION_P_STRING, 
                ACTIVATION_P_NUMBER, 
                ACTIVATION_P_BOOLEAN, 
                ACTIVATION_P_STRINGV 
        };

        union ActivationPropertyValue switch (ActivationPropertyType) {
        case ACTIVATION_P_STRING:
                string value_string;
        case ACTIVATION_P_NUMBER:
                double value_number;
        case ACTIVATION_P_BOOLEAN:
                boolean value_boolean;
        case ACTIVATION_P_STRINGV:
                Bonobo::StringList value_stringv;
        };

        struct ActivationProperty {
                string name;
                ActivationPropertyValue v;
        };

        /* Server */
        struct ServerInfo {
                ImplementationID iid;
                
                string server_type;
                string location_info;
                string username, hostname, domain;
		
                sequence<ActivationProperty> props;
        };

        typedef sequence<ServerInfo> ServerInfoList;

        enum RegistrationResult { 
                ACTIVATION_REG_SUCCESS, 
                ACTIVATION_REG_NOT_LISTED, 
                ACTIVATION_REG_ALREADY_ACTIVE, 
                ACTIVATION_REG_ERROR 
        };

        enum DynamicPathLoadResult
        {
               DYNAMIC_LOAD_SUCCESS,
               DYNAMIC_LOAD_ERROR,
               DYNAMIC_LOAD_NOT_LISTED,
               DYNAMIC_LOAD_ALREADY_LISTED
        };
};


#ifndef  __Bonobo_Activation_types_COMPILATION
#ifdef   __ORBIT_IDL__
#pragma inhibit pop
#endif
#endif

#endif
