aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Extensibility/ICompilerExtension.cs
blob: 55ef683a38b1a5cbd8285efa143aba32e6c4296f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Extensibility
{
    using System.Collections.Generic;
    using System.Xml.Linq;
    using WixToolset.Data;
    using WixToolset.Extensibility.Data;

    /// <summary>
    /// Interface all compiler extensions implement.
    /// </summary>
    public interface ICompilerExtension
    {
        /// <summary>
        /// Gets the schema namespace for this extension.
        /// </summary>
        /// <value>Schema namespace supported by this extension.</value>
        XNamespace Namespace { get; }

        /// <summary>
        /// Called at the beginning of the compilation of a source file.
        /// </summary>
        void PreCompile(ICompileContext context);

        /// <summary>
        /// Processes an attribute for the Compiler.
        /// </summary>
        /// <param name="intermediate">Parent intermediate.</param>
        /// <param name="section">Parent section.</param>
        /// <param name="parentElement">Parent element of attribute.</param>
        /// <param name="attribute">Attribute to process.</param>
        /// <param name="context">Extra information about the context in which this element is being parsed.</param>
        void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context);

        /// <summary>
        /// Processes an element for the Compiler.
        /// </summary>
        /// <param name="intermediate">Parent intermediate.</param>
        /// <param name="section">Parent section.</param>
        /// <param name="parentElement">Parent element of element to process.</param>
        /// <param name="element">Element to process.</param>
        /// <param name="context">Extra information about the context in which this element is being parsed.</param>
        void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context);

        /// <summary>
        /// Processes an element for the Compiler, with the ability to supply a component keypath.
        /// </summary>
        /// <param name="intermediate">Parent intermediate.</param>
        /// <param name="section">Parent section.</param>
        /// <param name="parentElement">Parent element of element to process.</param>
        /// <param name="element">Element to process.</param>
        /// <param name="context">Extra information about the context in which this element is being parsed.</param>
        IComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context);

        /// <summary>
        /// Called at the end of the compilation of a source file.
        /// </summary>
        void PostCompile(Intermediate intermediate);
    }
}