<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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"
  xsi:type="MailApp">

  <Id>4a2f92f9-e926-4fb5-8a59-a17450ad950e</Id>
  <Version>1.0.11</Version>
  <ProviderName>Ziviso (Pty) Ltd</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Ambient Signatures"/>
  <Description DefaultValue="Automatically applies corporate email signatures to outgoing mail."/>
  <IconUrl DefaultValue="https://addin.ziviso.africa/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://addin.ziviso.africa/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://www.ziviso.africa"/>

  <AppDomains>
    <AppDomain>addin.ziviso.africa</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://addin.ziviso.africa/src/taskpane/index.html"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteMailbox</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </Rule>

  <!-- V1_0 is an empty wrapper; all content lives in V1_1 below -->
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">

      <Requirements>
        <bt:Sets DefaultMinVersion="1.12">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>

      <Hosts>
        <Host xsi:type="MailHost">

          <Runtimes>
            <!-- HTML page used by Outlook on the web, Mac, and new Outlook on Windows -->
            <Runtime resid="WebViewRuntime.Url">
              <!-- JS-only bundle used by classic Outlook on Windows -->
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>

          <DesktopFormFactor>

            <!-- Ribbon button: compose window -->
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="ambientSignatureGroup">
                  <Label resid="GroupLabel"/>
                  <Control xsi:type="Button" id="ambientOpenPaneButton">
                    <Label resid="TaskpaneButton.Label"/>
                    <Supertip>
                      <Title resid="TaskpaneButton.Label"/>
                      <Description resid="TaskpaneButton.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16x16"/>
                      <bt:Image size="32" resid="Icon.32x32"/>
                      <bt:Image size="80" resid="Icon.80x80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>

            <!-- Event-based activation -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnNewMessageCompose" FunctionName="on-new-compose"/>
                <LaunchEvent Type="OnMessageFromChanged" FunctionName="on-from-changed"/>
                <LaunchEvent Type="OnMessageSend" FunctionName="on-message-send" SendMode="SoftBlock"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>

          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://addin.ziviso.africa/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://addin.ziviso.africa/assets/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://addin.ziviso.africa/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://addin.ziviso.africa/commands.html"/>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://addin.ziviso.africa/assets/commands.js"/>
          <bt:Url id="Taskpane.Url" DefaultValue="https://addin.ziviso.africa/src/taskpane/index.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="Ambient"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="Signature"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="View your corporate signature status and settings"/>
        </bt:LongStrings>
      </Resources>

      <!-- SSO: Replace Id with your Azure AD Application (client) ID after app registration -->
      <WebApplicationInfo>
        <Id>4a2f92f9-e926-4fb5-8a59-a17450ad950e</Id>
        <Resource>api://addin.ziviso.africa/4a2f92f9-e926-4fb5-8a59-a17450ad950e</Resource>
        <Scopes>
          <Scope>profile</Scope>
          <Scope>openid</Scope>
          <Scope>offline_access</Scope>
        </Scopes>
      </WebApplicationInfo>

    </VersionOverrides>
  </VersionOverrides>

</OfficeApp>
