/*
 * EngineContext.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 Eagle._Attributes;
using Eagle._Components.Public;

#if DEBUGGER
using Eagle._Components.Public.Delegates;
#endif

using Eagle._Containers.Private;
using Eagle._Containers.Public;
using Eagle._Interfaces.Public;

namespace Eagle._Interfaces.Private
{
    [ObjectId("b665807e-3edf-4c13-967d-44692fa0a8d3")]
    internal interface IEngineContext : IThreadContext
    {
        int Levels { get; set; }
        int PreviousLevels { get; set; }
        int ParserLevels { get; set; }
        int ExpressionLevels { get; set; }
        int UnknownLevels { get; set; }
        int TraceLevels { get; set; }

#if DEBUGGER
        int WatchpointLevels { get; set; }
        IDebugger Debugger { get; set; }
        InteractiveLoopCallback InteractiveLoopCallback { get; set; }
#endif

#if SHELL
        EvaluateScriptCallback EvaluateScriptCallback { get; set; }
        EvaluateFileCallback EvaluateFileCallback { get; set; }
        EvaluateEncodedFileCallback EvaluateEncodedFileCallback { get; set; }
        ArgumentCallback ArgumentCallback { get; set; }
#endif

#if NOTIFY || NOTIFY_OBJECT
        int NotifyLevels { get; set; }
        NotifyType NotifyTypes { get; set; }
        NotifyFlags NotifyFlags { get; set; }
#endif

        int PolicyLevels { get; set; }
        int TestLevels { get; set; }

        bool StackOverflow { get; set; }

#if PREVIOUS_RESULT
        Result PreviousResult { get; set; }
#endif

        EngineFlags EngineFlags { get; set; }

        IParseState ParseState { get; set; }

        ReturnCode ReturnCode { get; set; }

        int ErrorLine { get; set; }
        string ErrorCode { get; set; }
        string ErrorInfo { get; set; }
        int ErrorFrames { get; set; }

        IScriptLocation ScriptLocation { get; set; }
        StackList<IScriptLocation> ScriptLocations { get; set; }

        int PreviousProcessId { get; set; }

        ArraySearchDictionary ArraySearches { get; set; }

#if HISTORY
        IHistoryFilter HistoryEngineFilter { get; set; }
        ClientDataList History { get; set; }
#endif

        string Complaint { get; set; }

        EngineFlags BeginExternalExecution();
        int EndExternalExecution(EngineFlags savedEngineFlags);

        int BeginNestedExecution();
        void EndNestedExecution(int savedPreviousLevels);
    }
}
