scope.bitbucket.org / scope / services / DocumentManager / DocumentManager_1_0.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>DocumentManager 1.0 &mdash; Scope Interface v1 documentation</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" media="print" href="../../_static/print.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="copyright" title="Copyright" href="../../copyright.html" />
    <link rel="top" title="Scope Interface v1 documentation" href="../../index.html" />
    <link rel="up" title="DocumentManager" href="../DocumentManager.html" />
    <link rel="next" title="DocumentManager 1.1" href="DocumentManager_1_1.html" />
    <link rel="prev" title="DocumentManager" href="../DocumentManager.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="DocumentManager_1_1.html" title="DocumentManager 1.1"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../DocumentManager.html" title="DocumentManager"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">Scope Interface v1 documentation</a> &raquo;</li>
          <li><a href="../DocumentManager.html" accesskey="U">DocumentManager</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="documentmanager-1-0">
<h1>DocumentManager 1.0<a class="headerlink" href="#documentmanager-1-0" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Generated:</th><td class="field-body">hob rst-doc</td>
</tr>
<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.0</td>
</tr>
<tr class="field"><th class="field-name">Status:</th><td class="field-body">Published</td>
</tr>
</tbody>
</table>
<div class="section" id="service">
<h2>Service<a class="headerlink" href="#service" title="Permalink to this headline"></a></h2>
<p><strong>DocumentManager</strong> provides a way to monitor, and interact with
individual documents/frames in a document tree (whether they have
an ECMASCript environment or not).</p>
<p>Example functionality includes loading URLs in a certain frame, and
enumerating all the documents in a certain Window.</p>
<div class="section" id="id-fields">
<h3>ID fields<a class="headerlink" href="#id-fields" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Frame IDs represent the entity that contains the document. When a new
URL is loaded in a frame, the document ID will change, but the frame ID
will not. This makes it possible to monitor the document history for
individual frames. (Please note that the document ID will not change when
a frame is <a href="#id1"><span class="problematic" id="id2">*</span></a>re*loaded).</li>
<li>Document ID represent the actual document. This is recreated when a new
URL is loaded in its parent frame.</li>
</ul>
</div>
<div class="section" id="external-id-fields">
<h3>External ID fields<a class="headerlink" href="#external-id-fields" title="Permalink to this headline"></a></h3>
<p>Some IDs used in this service originate (and can be used with) other
services.</p>
<ul class="simple">
<li>Window IDs are the same in all services, and can be used interchangeably
everywhere. See <em>WindowManager</em> for window-centric commands and events.</li>
<li>Resource IDs in this service are compatible with resource ID fields found
in <em>ResourceManager</em>.</li>
</ul>
<div class="highlight-c"><div class="highlight"><pre><span class="n">service</span> <span class="n">DocumentManager</span>
<span class="p">{</span>
  <span class="n">option</span> <span class="p">(</span><span class="n">version</span><span class="p">)</span> <span class="o">=</span> <span class="s">&quot;1.0&quot;</span><span class="p">;</span>


  <span class="n">command</span> <span class="n">ListDocuments</span><span class="p">(</span><span class="n">ListDocumentsArg</span><span class="p">)</span>   <span class="n">returns</span> <span class="p">(</span><span class="n">DocumentList</span><span class="p">)</span>        <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">command</span> <span class="n">LoadDocument</span><span class="p">(</span><span class="n">LoadDocumentArg</span><span class="p">)</span>     <span class="n">returns</span> <span class="p">(</span><span class="n">Default</span><span class="p">)</span>             <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
  <span class="n">command</span> <span class="n">ReloadDocument</span><span class="p">(</span><span class="n">ReloadDocumentArg</span><span class="p">)</span> <span class="n">returns</span> <span class="p">(</span><span class="n">Default</span><span class="p">)</span>             <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
  <span class="n">event</span>   <span class="n">OnAboutToLoadDocument</span>             <span class="n">returns</span> <span class="p">(</span><span class="n">AboutToLoadDocument</span><span class="p">)</span> <span class="o">=</span> <span class="mi">4</span><span class="p">;</span>
  <span class="n">event</span>   <span class="n">OnDocumentLoaded</span>                  <span class="n">returns</span> <span class="p">(</span><span class="n">DocumentLoaded</span><span class="p">)</span>      <span class="o">=</span> <span class="mi">5</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="commands">
<h2>Commands<a class="headerlink" href="#commands" title="Permalink to this headline"></a></h2>
<div class="section" id="listdocuments">
<span id="index-0"></span><h3><tt class="docutils literal"><span class="pre">ListDocuments</span></tt><a class="headerlink" href="#listdocuments" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>command ListDocuments(ListDocumentsArg) returns (DocumentList) = 1;</pre>
</div>
<p>Get the document tree for a Window, or for all Windows.</p>
<p>argument:</p>
<div class="highlight-c" id="index-1"><div class="highlight"><pre><span class="n">message</span> <span class="n">ListDocumentsArg</span>
<span class="p">{</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">windowID</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>returns:</p>
<div class="highlight-c" id="index-2"><div class="highlight"><pre><span class="n">message</span> <span class="n">DocumentList</span>
<span class="p">{</span>
  <span class="n">repeated</span> <span class="n">Document</span> <span class="n">documentList</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>references:</p>
<div class="highlight-c" id="index-3"><div class="highlight"><pre><span class="n">message</span> <span class="n">Document</span>
<span class="p">{</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">windowID</span>         <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">frameID</span>          <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">documentID</span>       <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The parent frame, present only if the frame is not the</span>
<span class="cm">   * top level frame.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">parentFrameID</span>    <span class="o">=</span> <span class="mi">4</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * Present unless this document is the top-level document</span>
<span class="cm">   * in the Window.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">parentDocumentID</span> <span class="o">=</span> <span class="mi">5</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The current URL of the document.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">string</span> <span class="n">url</span>              <span class="o">=</span> <span class="mi">6</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The resource used to generate this document.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">resourceID</span>       <span class="o">=</span> <span class="mi">7</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The value of the name attribute of the HTMLFrameElement. If the</span>
<span class="cm">   * frame does not have a name, or this document is not associated with</span>
<span class="cm">   * a HTMLFrameElement, this will field will not be present.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">string</span> <span class="n">frameElementName</span> <span class="o">=</span> <span class="mi">8</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The value of the id attribute of the HTMLFrameElement. If the</span>
<span class="cm">   * frame does not have an id, or this document is not associated with</span>
<span class="cm">   * a HTMLFrameElement, this will field will not be present.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">string</span> <span class="n">frameElementID</span>   <span class="o">=</span> <span class="mi">9</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="loaddocument">
<span id="index-4"></span><h3><tt class="docutils literal"><span class="pre">LoadDocument</span></tt><a class="headerlink" href="#loaddocument" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>command LoadDocument(LoadDocumentArg) returns (Default) = 2;</pre>
</div>
<p>Load a URL in a specified frame.</p>
<p>argument:</p>
<div class="highlight-c" id="index-5"><div class="highlight"><pre><span class="n">message</span> <span class="n">LoadDocumentArg</span>
<span class="p">{</span>
  <span class="cm">/**</span>
<span class="cm">   * The window containing the frame.</span>
<span class="cm">   */</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">windowID</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">frameID</span>  <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">string</span> <span class="n">url</span>      <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="reloaddocument">
<span id="index-6"></span><h3><tt class="docutils literal"><span class="pre">ReloadDocument</span></tt><a class="headerlink" href="#reloaddocument" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>command ReloadDocument(ReloadDocumentArg) returns (Default) = 3;</pre>
</div>
<p>Reload the current URL for a specified frame.</p>
<p>argument:</p>
<div class="highlight-c" id="index-7"><div class="highlight"><pre><span class="n">message</span> <span class="n">ReloadDocumentArg</span>
<span class="p">{</span>
  <span class="cm">/**</span>
<span class="cm">   * The window containing the frame.</span>
<span class="cm">   */</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">windowID</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">frameID</span>  <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="events">
<h2>Events<a class="headerlink" href="#events" title="Permalink to this headline"></a></h2>
<div class="section" id="onabouttoloaddocument">
<span id="index-8"></span><h3><tt class="docutils literal"><span class="pre">OnAboutToLoadDocument</span></tt><a class="headerlink" href="#onabouttoloaddocument" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>event OnAboutToLoadDocument returns (AboutToLoadDocument) = 4;</pre>
</div>
<p>Fired when a document is about to be loaded (regardless
of whether the load actually succeeds).</p>
<p>message:</p>
<div class="highlight-c" id="index-9"><div class="highlight"><pre><span class="n">message</span> <span class="n">AboutToLoadDocument</span>
<span class="p">{</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">windowID</span>         <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">frameID</span>          <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The resource that is about to get loaded.</span>
<span class="cm">   */</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">resourceID</span>       <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * Milliseconds since Unix Epoch.</span>
<span class="cm">   */</span>
  <span class="n">required</span> <span class="kt">double</span> <span class="n">time</span>             <span class="o">=</span> <span class="mi">4</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The parent document, present only if the frame is not the</span>
<span class="cm">   * top level frame.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">parentDocumentID</span> <span class="o">=</span> <span class="mi">5</span><span class="p">;</span>
  <span class="cm">/**</span>
<span class="cm">   * The parent frame, present only if the frame is not the</span>
<span class="cm">   * top level frame.</span>
<span class="cm">   */</span>
  <span class="n">optional</span> <span class="n">uint32</span> <span class="n">parentFrameID</span>    <span class="o">=</span> <span class="mi">6</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="ondocumentloaded">
<span id="index-10"></span><h3><tt class="docutils literal"><span class="pre">OnDocumentLoaded</span></tt><a class="headerlink" href="#ondocumentloaded" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>event OnDocumentLoaded returns (DocumentLoaded) = 5;</pre>
</div>
<p>Fired when a document is fully loaded (after DOM event
&#8216;load&#8217; has finished).</p>
<p>message:</p>
<div class="highlight-c" id="index-11"><div class="highlight"><pre><span class="n">message</span> <span class="n">DocumentLoaded</span>
<span class="p">{</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">windowID</span>   <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">frameID</span>    <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
  <span class="n">required</span> <span class="n">uint32</span> <span class="n">documentID</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/Opera-logo-PNG.png" alt="Logo"/>
            </a></p>
            <h3><a href="../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference internal" href="#">DocumentManager 1.0</a><ul>
<li><a class="reference internal" href="#service">Service</a><ul>
<li><a class="reference internal" href="#id-fields">ID fields</a></li>
<li><a class="reference internal" href="#external-id-fields">External ID fields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#commands">Commands</a><ul>
<li><a class="reference internal" href="#listdocuments"><tt class="docutils literal"><span class="pre">ListDocuments</span></tt></a></li>
<li><a class="reference internal" href="#loaddocument"><tt class="docutils literal"><span class="pre">LoadDocument</span></tt></a></li>
<li><a class="reference internal" href="#reloaddocument"><tt class="docutils literal"><span class="pre">ReloadDocument</span></tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#events">Events</a><ul>
<li><a class="reference internal" href="#onabouttoloaddocument"><tt class="docutils literal"><span class="pre">OnAboutToLoadDocument</span></tt></a></li>
<li><a class="reference internal" href="#ondocumentloaded"><tt class="docutils literal"><span class="pre">OnDocumentLoaded</span></tt></a></li>
</ul>
</li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="../DocumentManager.html"
                                  title="previous chapter">DocumentManager</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="DocumentManager_1_1.html"
                                  title="next chapter">DocumentManager 1.1</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../../_sources/services/DocumentManager/DocumentManager_1_0.txt"
                     rel="nofollow">Show Source</a></li>
             <li><a href="./pdf/ScopeInterface.pdf" rel="nofollow">Download as PDF</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          
          <script type="text/javascript">$('#searchbox').show(0);</script>
          <h3><a href="glossary.html">Glossary</a></h3>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
    © Copyright 2006-2010, Opera Software ASA. 
    <a href="./index.html#license">Licensed under Apache License, Version 2.0.</a>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.6.
    </div>
  </body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.