/* See license.txt for terms of usage */ #include "nsISupports.idl" interface jsdIStackFrame; interface jsdIScript; interface jsdIValue; interface jsdINestCallback; interface nsIDOMWindow; [scriptable, uuid(c8fd2c1c-060c-4c3b-b1e6-9e0e78425ae4)] interface nsIFireBugError : nsISupports { readonly attribute string message; readonly attribute string fileName; readonly attribute unsigned long line; readonly attribute unsigned long pos; readonly attribute unsigned long flags; readonly attribute unsigned long errnum; readonly attribute jsdIValue exc; }; [scriptable, uuid(c8bdf90d-483a-45b2-a3eb-c655c7084b2c)] interface nsIFireBugBreakpointProperties : nsISupports { readonly attribute boolean disabled; readonly attribute string condition; readonly attribute boolean onTrue; readonly attribute long hitCount; readonly attribute boolean onError; }; [scriptable, uuid(c329fbb0-cb7d-11da-a94d-0800200c9a66)] interface nsIFireBugDebugger : nsISupports { boolean supportsWindow(in nsIDOMWindow window); void onLock(in boolean state); unsigned long onBreak(in jsdIStackFrame frame, in unsigned long type); unsigned long onHalt(in jsdIStackFrame frame); unsigned long onThrow(in jsdIStackFrame frame, inout jsdIValue rv); void onCall(in jsdIStackFrame frame); /** * Called when jsd signals onError and the showStackTrace option is set. */ long onError(in jsdIStackFrame frame, in nsIFireBugError error); /** * A script created by an eval is created; * url is eval-level script url, * lineNo is first line of script relative to first line of url, * script is jsd object for script with fileName and baseLineNumber of old */ void onEvalScript(in string url, in unsigned long lineNo, in jsdIScript script); /** * A script created by compiling top-level is created; * url is top-level script url from onTopLevel * lineNo is first line of script relative to first line of url, * script is jsd object for script with fileName and baseLineNumber of old */ void onTopLevelScript(in string url, in unsigned long lineNo, in jsdIScript script); /** * Breakpoints changes notification callbacks */ void onToggleBreakpoint(in string url, in unsigned long lineNo, in boolean isSet, in nsIFireBugBreakpointProperties props); void onToggleErrorBreakpoint(in string url, in unsigned long lineNo, in boolean isSet); void onToggleMonitor(in string url, in unsigned long lineNo, in boolean isSet); }; [scriptable, uuid(A1278893-D7CD-4b6e-A652-9A03D22BF7D8)] interface nsIFireBugURLProvider : nsISupports { /** * Called when a eval-level function (script) it ready to run. * in frame from breakpoint hook in PC=0 of TopLevel script * out file name to bind to all scripts from this TopLevel */ string onEval(in jsdIStackFrame frame); /** * Called when a top-level function (script) it ready to run. * in frame from breakpoint hook in PC=0 of TopLevel script * out file name to bind to all scripts from this TopLevel */ string onTopLevel(in jsdIStackFrame frame); /** * Called when a browser-generated event script is created * in frame from breakpoint hook in PC=0 of eventLevel script * out file name to bind to all scripts from this eventLevel */ string onEventScript(in jsdIStackFrame frame); }; [scriptable, uuid(35acfa60-d2a0-11da-a94d-0800200c9a66)] interface nsIFireBugBreakpointCallback : nsISupports { void call(in string url, in unsigned long lineNo, in unsigned long startLineNo, in nsIFireBugBreakpointProperties props); }; [scriptable, uuid(61df57e0-4b77-11db-b0de-0800200c9a66)] interface nsIFireBugClient : nsISupports { void enable(); void disable(); }; [scriptable, uuid(96A63A4A-952D-4367-BB1A-8BA0356E529F)] interface nsIFireBugNetworkDebugger : nsISupports { void suspendActivity(); void resumeActivity(); }; [scriptable, uuid(F71F61B2-CB37-11DA-9B41-B622A1EF5492)] interface nsIFireBug : nsISupports { const unsigned long STEP_OVER = 1; const unsigned long STEP_INTO = 2; const unsigned long STEP_OUT = 3; readonly attribute nsIDOMWindow lastErrorWindow; readonly attribute boolean enabled; boolean countContext(in boolean on); void registerClient(in nsIFireBugClient client); void unregisterClient(in nsIFireBugClient client); void registerDebugger(in nsIFireBugDebugger debugger); void unregisterDebugger(in nsIFireBugDebugger debugger); /* * Lock the debugger so that only one client at a time can use it. */ readonly attribute boolean locked; void lockDebugger(); void unlockDebugger(); /** * JSD wrappers */ unsigned long enterNestedEventLoop (in jsdINestCallback callback); unsigned long exitNestedEventLoop (); /** * Halts execution immediately and calls debugger.onHalt(). */ void halt(in nsIFireBugDebugger debugger); /** * Starts stepping when the debugger resumes execution. */ void step(in unsigned long stepMode, in jsdIStackFrame startFrame); /** * Runs until execution hits a particular line when the debugger resumes execution. */ void runUntil(in string url, in unsigned long lineNo, in jsdIStackFrame startFrame); /** * Suspend execution on the next statement */ void suspend(); boolean setBreakpoint(in string url, in unsigned long lineNo, in nsIFireBugBreakpointProperties props); void clearBreakpoint(in string url, in unsigned long lineNo); void clearAllBreakpoints(in PRUint32 count, [array, size_is(count)] in string urls); void enableBreakpoint(in string url, in unsigned long lineNo); void disableBreakpoint(in string url, in unsigned long lineNo); boolean isBreakpointDisabled(in string url, in unsigned long lineNo); boolean hasBreakpoint(in jsdIScript script); void enumerateBreakpoints(in string url, in nsIFireBugBreakpointCallback cb); string getBreakpointCondition(in string url, in unsigned long lineNo); void setBreakpointCondition(in string url, in unsigned long lineNo, in string condition); void setErrorBreakpoint(in string url, in unsigned long lineNo); void clearErrorBreakpoint(in string url, in unsigned long lineNo); boolean hasErrorBreakpoint(in string url, in unsigned long lineNo); void enumerateErrorBreakpoints(in string url, in nsIFireBugBreakpointCallback cb); /** * Report all calls to the function through the "onCall" callback. */ void monitor(in jsdIScript script, in nsIFireBugDebugger debugger); void unmonitor(in jsdIScript script); boolean isMonitored(in jsdIScript script); void enumerateMonitors(in string url, in nsIFireBugBreakpointCallback cb); void enumerateScripts(out unsigned long length, [retval, array, size_is(length)] out jsdIScript scripts); readonly attribute boolean profiling; /** * Start profiling, or continue profiling if this has already been called. * Nested calls are allowed, but each call must be matched with a call to * stopProfiling. */ void startProfiling(); /** * Returns the number of milliseconds since profiling began, or -1 if * there are still more nested profilers active. */ long stopProfiling(); }; [scriptable, uuid(d00466f8-e616-4b81-9aa0-a8581c51209c)] interface nsIFireBugScriptListener : nsISupports { void onScriptCreated(in jsdIScript script, in string url, in unsigned long lineNo); void onScriptDestroyed(in jsdIScript script); };