content/xul/document/src/nsForwardReference.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsForwardReference_h__
     7 #define nsForwardReference_h__
     9 class nsForwardReference
    10 {
    11 protected:
    12     nsForwardReference() {}
    14 public:
    15     virtual ~nsForwardReference() {}
    17     /**
    18      * Priority codes returned from GetPhase()
    19      */
    20     enum Phase {
    21         /** A dummy marker, used to indicate unstarted resolution */
    22         eStart,
    24         /** The initial pass, after which the content model will be
    25             fully built */
    26         eConstruction,
    28         /** A second pass, after which all 'magic attribute' hookup
    29             will have been performed */
    30         eHookup,
    32         /** A dummy marker, used in kPasses to indicate termination */
    33         eDone
    34     };
    36     /**
    37      * Forward references are categorized by 'priority', and all
    38      * forward references in a higher priority are resolved before any
    39      * reference in a lower priority. This variable specifies this
    40      * ordering. The last Priority is guaranteed to be eDone.
    41      */
    42     static const Phase kPasses[];
    44     /**
    45      * Get the state in which the forward reference should be resolved.
    46      * 'eConstruction' references are all resolved before 'eHookup' references
    47      * are resolved.
    48      *
    49      * @return the Phase in which the reference needs to be resolved
    50      */
    51     virtual Phase GetPhase() = 0;
    53     /**
    54      * Result codes returned from Resolve()
    55      */
    56     enum Result {
    57         /** Resolution succeeded, I'm done. */
    58         eResolve_Succeeded,
    60         /** Couldn't resolve, but try me later. */
    61         eResolve_Later,
    63         /** Something bad happened, don't try again. */
    64         eResolve_Error
    65     };
    67     /**
    68      * Attempt to resolve the forward reference.
    69      *
    70      * @return a Result that tells the resolver how to treat
    71      * the reference.
    72      */
    73     virtual Result Resolve() = 0;
    74 };
    76 #endif // nsForwardReference_h__

mercurial