<?xml version="1.0" encoding="UTF-8"?>
<!--
  Add-in-only manifest (XML). Filled in per environment by scripts/build.mjs ({{…}} placeholders).
  Keep it deliberately stable: every change here requires another confirmation in the admin center.
  Logic, templates and rules change through the hosted files, not through this manifest.

  The visible strings below stay German on purpose - Outlook shows them to end users. The element
  ids (SignaturGroup, SignaturTaskpaneButton) are referenced from src/lib/office.js.
-->
<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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides"
  xsi:type="MailApp">
  <Id>f09745d4-15da-427f-bb59-beb7f26a463e</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>XBC</ProviderName>
  <DefaultLocale>de-DE</DefaultLocale>
  <DisplayName DefaultValue="XBC Mail-Signatur"/>
  <Description DefaultValue="Setzt die Firmensignatur automatisch beim Verfassen von E-Mails."/>
  <IconUrl DefaultValue="https://signatur.xbc-digital.com/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://signatur.xbc-digital.com/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://signatur.xbc-digital.com/support.html"/>
  <AppDomains>
    <AppDomain>https://signatur.xbc-digital.com</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="Mailbox"/>
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://signatur.xbc-digital.com/taskpane.html"/>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteItem</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </Rule>
  <DisableEntityHighlighting>true</DisableEntityHighlighting>

  <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">
      <Description resid="AppDescription"/>
      <!-- 1.5 so Outlook mobile reads the block; desktop clients need 1.10 for LaunchEvent itself. -->
      <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <Runtimes>
            <!-- HTML runtime: OWA, new Outlook, Mac, mobile. Override: JS-only runtime of classic Outlook. -->
            <Runtime resid="WebViewRuntime.Url">
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>

          <DesktopFormFactor>
            <FunctionFile resid="WebViewRuntime.Url"/>
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="SignaturGroup">
                  <Label resid="GroupLabel"/>
                  <Control xsi:type="Button" id="SignaturTaskpaneButton">
                    <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>

            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnNewMessageCompose" FunctionName="onNewMessageComposeHandler"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>
          </DesktopFormFactor>

          <!-- Mobile is declared so no manifest swap is needed later.
               It is enabled through features.mobile in addin.config.json (code deployment). -->
          <MobileFormFactor>
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnNewMessageCompose" FunctionName="onNewMessageComposeHandler"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>
          </MobileFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://signatur.xbc-digital.com/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://signatur.xbc-digital.com/assets/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://signatur.xbc-digital.com/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://signatur.xbc-digital.com/commands.html"/>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://signatur.xbc-digital.com/launchevent.js"/>
          <bt:Url id="Taskpane.Url" DefaultValue="https://signatur.xbc-digital.com/taskpane.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="XBC Mail-Signatur"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="Signatur"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="AppDescription" DefaultValue="Setzt die Firmensignatur automatisch beim Verfassen von E-Mails."/>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Vorschau anzeigen, anmelden und die Signatur neu einfügen."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
