/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
 *  Bonobo_ActivationContext.idl:
 *
 *  Copyright (C) 1999, 2000 Red Hat, Inc.
 *  Copyright (C) 1999, 2000 Eazel, Inc.
 *
 *  This library 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; either version 2 of the
 *  License, or (at your option) any later version.
 *
 *  This library 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 this library; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Authors: Elliot Lee <sopwith@redhat.com>,
 *           Maciej Stachowiak <mjs@noisehavoc.org>
 *
 */

#ifndef __BONOBO_ACTIVATION_CONTEXT_IDL__
#define __BONOBO_ACTIVATION_CONTEXT_IDL__

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

#include <Bonobo_Unknown.idl>
#include <Bonobo_Activation_types.idl>

/* ObjectDirectory needs a forward declaration of ActivationContext */
module Bonobo {
        interface ActivationContext;
        interface ActivationClient;
};

#include <Bonobo_ObjectDirectory.idl>

module Bonobo {
        interface ActivationClient : Bonobo::Unknown {
                oneway void resetCache ();
                long getVersion ();
        };

        typedef sequence<ObjectDirectory> ObjectDirectoryList;

        interface ActivationContext : Bonobo::Unknown {
                readonly attribute ObjectDirectoryList directories;
                readonly attribute ServerInfoList      servers;

                oneway void addClient (in ActivationClient client,
                                       in string           locales);

                void addDirectory    (in ObjectDirectory dir) raises (Bonobo::Activation::AlreadyListed);
                void removeDirectory (in ObjectDirectory dir) raises (Bonobo::Activation::NotListed);

                ServerInfoList query (in string             requirements,
                                      in Bonobo::StringList selection_order)
                        raises (Bonobo::Activation::ParseFailed,
                                Bonobo::Activation::IncompleteContext)
                        context ("username", "hostname");

                ActivationResult activateMatching (in string                        requirements,
                                                   in Bonobo::StringList            selection_order,
                                                   in Bonobo::ActivationEnvironment environment,
                                                   in ActivationFlags               flags)
                        raises (Bonobo::Activation::ParseFailed,
                                Bonobo::Activation::IncompleteContext,
                                Bonobo::GeneralError)
                        context ("username", "hostname");
                ActivationResult activateMatchingFull (in string                        requirements,
                                                       in Bonobo::StringList            selection_order,
                                                       in Bonobo::ActivationEnvironment environment,
                                                       in ActivationFlags               flags,
                                                       in ActivationClient              client)
                        raises (Bonobo::Activation::ParseFailed,
                                Bonobo::Activation::IncompleteContext,
                                Bonobo::GeneralError)
                        context ("username", "hostname");

                ActivationResult activateFromAid (in ActivationID    aid,
                                                  in ActivationFlags flags)
                        raises (Bonobo::Activation::ParseFailed,
                                Bonobo::Activation::IncompleteContext,
                                Bonobo::GeneralError)
                        context ("username", "hostname");
                ActivationResult activateFromAidFull (in ActivationID     aid,
                                                      in ActivationFlags  flags,
                                                      in ActivationClient client)
                        raises (Bonobo::Activation::ParseFailed,
                                Bonobo::Activation::IncompleteContext,
                                Bonobo::GeneralError)
                        context ("username", "hostname");

                long getVersion ();
        };
};

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

#endif
