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

#ifndef __MATECOMPONENT_ACTIVATION_TYPES_IDL__
#define __MATECOMPONENT_ACTIVATION_TYPES_IDL__

#ifndef  __MateComponent_Activation_types_COMPILATION
#ifdef   __MATECORBA_IDL__
%{
#pragma include_defs matecomponent-activation/MateComponent_Activation_types.h
%}
#pragma inhibit push
#endif
#endif

module MateComponent {
	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:
                MateComponent::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:
                MateComponent::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  __MateComponent_Activation_types_COMPILATION
#ifdef   __MATECORBA_IDL__
#pragma inhibit pop
#endif
#endif

#endif
