/*
 * EngineHost.cs --
 *
 * Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: $
 */

using System.IO;
using System.Threading;
using Eagle._Attributes;
using Eagle._Components.Public;

namespace Eagle._Interfaces.Public
{
    [ObjectId("c6cdeda4-46b0-4cf6-9a21-ea1393c1a049")]
    public interface IEngineHost : IInteractiveHost
    {
        bool CanExit { get; set; }
        bool CanForceExit { get; set; }
        bool Exiting { get; set; }

        HostStreamFlags StreamFlags { get; set; }

        ReturnCode CreateThread(ThreadStart start, int maxStackSize,
            bool userInterface, bool isBackground, ref Thread thread,
            ref Result error);

        ReturnCode CreateThread(ParameterizedThreadStart start,
            int maxStackSize, bool userInterface, bool isBackground,
            ref Thread thread, ref Result error);

        ReturnCode QueueWorkItem(WaitCallback callback, object state,
            ref Result error);

        ReturnCode GetStream(string path, FileMode mode, FileAccess access,
            FileShare share, int bufferSize, FileOptions options,
            ref HostStreamFlags flags, ref string fullPath, ref Stream stream,
            ref Result error);

        ReturnCode GetScript(string name, ref ScriptFlags flags,
            ref Result result);

        bool Sleep(int milliseconds);
        bool Yield();
    }
}
