<?xml version="1.0" encoding="UTF-8"?>
<!--
  ScanHawk task pane add-in for Word, Excel, PowerPoint and OneNote —
  the ADD-IN ONLY (XML) manifest.

  Why this file exists when manifest.json already covers Word/Excel/PowerPoint:

    * OneNote add-ins cannot use the unified manifest at all. This is the only
      route to OneNote, and OneNote add-ins run on OneNote on the web only.
    * The unified manifest needs Microsoft 365 subscription builds (Word/Excel/
      PowerPoint on Windows 2501+, Mac 16.103+, or the web). Perpetual Office
      installs — Office 2019, 2021, 2024 — cannot install it. This manifest can.

  So: ship manifest.json as the primary route, and this one for OneNote and for
  tenants still on perpetual Office. It carries its OWN <Id>, deliberately, so a
  tenant that installs both does not end up with two apps fighting over one id.
  See MANIFEST.md.

  Validate before sideloading:
    npx office-addin-manifest validate manifest.office.xml
  GENERATED by test/serve.mjs for https://addin.scanhawk.app — edit manifest.office.xml, not this file. Icons live in /assets (generated by assets/generate.mjs).
-->
<OfficeApp
  xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
  xsi:type="TaskPaneApp">

  <Id>bed82742-98d9-45de-a0e1-f82e835763c0</Id>
  <Version>1.1.0.0</Version>
  <ProviderName>TwentyPin</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="ScanHawk — Link Safety" />
  <Description DefaultValue="Check where the links in this file really go before you click." />
  <IconUrl DefaultValue="https://addin.scanhawk.app/assets/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://addin.scanhawk.app/assets/icon-128.png" />
  <SupportUrl DefaultValue="https://scanhawk.io/support" />

  <Hosts>
    <Host Name="Document" />
    <Host Name="Workbook" />
    <Host Name="Presentation" />
    <Host Name="Notebook" />
  </Hosts>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://addin.scanhawk.app/src/taskpane.html" />
  </DefaultSettings>

  <!--
    Least privilege for a scanner that only ever reads. ReadDocument covers
    Word's body.getHtml(), Excel's used-range and hyperlink reads, PowerPoint's
    shape text and OneNote's page walk. WriteDocument / ReadWriteDocument would
    let the add-in change the user's file, which it never does.
  -->
  <Permissions>ReadDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <!--
        One ribbon button per host, all opening the same task pane. The pane
        works out which application it is in at runtime (src/hosts.js) and reads
        the content the way that application allows.
      -->
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="getStartedTitle" />
            <Description resid="getStartedDesc" />
            <LearnMoreUrl resid="learnMoreUrl" />
          </GetStarted>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="shGroup">
                <Label resid="groupLabel" />
                <Icon>
                  <bt:Image size="16" resid="icon16" />
                  <bt:Image size="32" resid="icon32" />
                  <bt:Image size="80" resid="icon80" />
                </Icon>
                <Control xsi:type="Button" id="shScanDocument">
                  <Label resid="btnLabel" />
                  <Supertip>
                    <Title resid="btnLabel" />
                    <Description resid="btnTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ScanHawkPane</TaskpaneId>
                    <SourceLocation resid="taskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>

      <Host xsi:type="Workbook">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="getStartedTitle" />
            <Description resid="getStartedDesc" />
            <LearnMoreUrl resid="learnMoreUrl" />
          </GetStarted>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="shGroup">
                <Label resid="groupLabel" />
                <Icon>
                  <bt:Image size="16" resid="icon16" />
                  <bt:Image size="32" resid="icon32" />
                  <bt:Image size="80" resid="icon80" />
                </Icon>
                <Control xsi:type="Button" id="shScanWorkbook">
                  <Label resid="btnLabel" />
                  <Supertip>
                    <Title resid="btnLabel" />
                    <Description resid="btnTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ScanHawkPane</TaskpaneId>
                    <SourceLocation resid="taskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>

      <Host xsi:type="Presentation">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="getStartedTitle" />
            <Description resid="getStartedDesc" />
            <LearnMoreUrl resid="learnMoreUrl" />
          </GetStarted>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="shGroup">
                <Label resid="groupLabel" />
                <Icon>
                  <bt:Image size="16" resid="icon16" />
                  <bt:Image size="32" resid="icon32" />
                  <bt:Image size="80" resid="icon80" />
                </Icon>
                <Control xsi:type="Button" id="shScanPresentation">
                  <Label resid="btnLabel" />
                  <Supertip>
                    <Title resid="btnLabel" />
                    <Description resid="btnTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ScanHawkPane</TaskpaneId>
                    <SourceLocation resid="taskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>

      <!--
        OneNote add-ins run on OneNote on the web only, and OneNote gives an
        add-in a paragraph's text without the hyperlink behind it — so on this
        host the pane checks the addresses written on the page and says so
        (see oneNoteAdapter in src/hosts.js). That caveat is deliberate: a green
        "looks safe" over content we could only half read is the failure mode.
      -->
      <Host xsi:type="Notebook">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="shGroup">
                <Label resid="groupLabel" />
                <Icon>
                  <bt:Image size="16" resid="icon16" />
                  <bt:Image size="32" resid="icon32" />
                  <bt:Image size="80" resid="icon80" />
                </Icon>
                <Control xsi:type="Button" id="shScanPage">
                  <Label resid="btnLabel" />
                  <Supertip>
                    <Title resid="btnLabel" />
                    <Description resid="btnTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ScanHawkPane</TaskpaneId>
                    <SourceLocation resid="taskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://addin.scanhawk.app/assets/icon-16.png" />
        <bt:Image id="icon32" DefaultValue="https://addin.scanhawk.app/assets/icon-32.png" />
        <bt:Image id="icon80" DefaultValue="https://addin.scanhawk.app/assets/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="taskpaneUrl" DefaultValue="https://addin.scanhawk.app/src/taskpane.html" />
        <bt:Url id="learnMoreUrl" DefaultValue="https://scanhawk.io/support" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="ScanHawk" />
        <bt:String id="btnLabel" DefaultValue="Scan links" />
        <bt:String id="getStartedTitle" DefaultValue="ScanHawk is ready" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="btnTip" DefaultValue="Check where the links in this file really go before you click." />
        <bt:String id="getStartedDesc" DefaultValue="Open the ScanHawk pane from the Home tab to check every link in this file before you click one." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
