| 1 | // 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. |
| 2 | |
| 3 | namespace WixToolset.Extensibility |
| 4 | { |
| 5 | using WixToolset.Data; |
| 6 | using WixToolset.Extensibility.Data; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// Interface all Burn backend extensions implement. |
| 10 | /// </summary> |
| 11 | public interface IBurnBackendBinderExtension |
| 12 | { |
| 13 | /// <summary> |
| 14 | /// Called before binding occurs. |
| 15 | /// </summary> |
| 16 | void PreBackendBind(IBindContext context); |
| 17 | |
| 18 | /// <summary> |
| 19 | /// Called to find a file related to another source in the authoring. For example, most often used |
| 20 | /// to find cabinets and uncompressed files for an MSI package. |
| 21 | /// </summary> |
| 22 | /// <param name="source">Path to the source package.</param> |
| 23 | /// <param name="relatedSource">Expected path to the related file.</param> |
| 24 | /// <param name="type">Type of related file, such as "File" or "Cabinet"</param> |
| 25 | /// <param name="sourceLineNumbers">Source line number of source package.</param> |
| 26 | /// <returns><c>IResolveFileResult</c> if the related file was found, or null for default handling.</returns> |
| 27 | IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers); |
| 28 | |
| 29 | /// <summary> |
| 30 | /// Called right before the output is bound into its final format. |
| 31 | /// </summary> |
| 32 | /// <param name="section">The finalized intermediate section.</param> |
| 33 | void SymbolsFinalized(IntermediateSection section); |
| 34 | |
| 35 | /// <summary> |
| 36 | /// Called to customize the DownloadUrl provided in source cde. |
| 37 | /// </summary> |
| 38 | /// <param name="url">The value from the source code. May not actually be a URL.</param> |
| 39 | /// <param name="fallbackUrl">The default URL if the extension does not return a value.</param> |
| 40 | /// <param name="packageId">Identifier of the package.</param> |
| 41 | /// <param name="payloadId">Identifier of the payload.</param> |
| 42 | /// <param name="fileName">Filename of the payload.</param> |
| 43 | /// <returns>Url to override, or null to use default value.</returns> |
| 44 | string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); |
| 45 | |
| 46 | /// <summary> |
| 47 | /// Called for each extension symbol that hasn't been handled yet. |
| 48 | /// Use IBurnBackendHelper to add data. |
| 49 | /// </summary> |
| 50 | /// <param name="section">The linked section.</param> |
| 51 | /// <param name="symbol">The current symbol.</param> |
| 52 | /// <returns> |
| 53 | /// True if the extension handled the symbol, false otherwise. |
| 54 | /// The Burn backend will warn on all unhandled symbols. |
| 55 | /// </returns> |
| 56 | bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol); |
| 57 | |
| 58 | /// <summary> |
| 59 | /// Called after output is bound into its final format. |
| 60 | /// </summary> |
| 61 | /// <param name="result"></param> |
| 62 | void PostBackendBind(IBindResult result); |
| 63 | } |
| 64 | } |