<?xml version="1.0" encoding="UTF-8"?>
<!--
  Termin-Kennung - Outlook Add-in (Add-in-only Manifest / XML)
  Bereitstellung: Microsoft 365 Admin Center > Einstellungen > Integrierte Apps > Benutzerdefinierte Apps hochladen
  WICHTIG: Alle URLs unten muessen auf einen oeffentlich erreichbaren HTTPS-Host zeigen.
           Umstellen mit:  node scripts/set-url.mjs https://mein-host.example.com
-->
<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/1.0"
    xsi:type="MailApp">

  <Id>02631450-298c-45f3-a069-5c04cb7a49e8</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Wenzel</ProviderName>
  <DefaultLocale>de-DE</DefaultLocale>
  <DisplayName DefaultValue="Termin-Kennung"/>
  <Description DefaultValue="Haengt beim Speichern bzw. Senden eines Termins automatisch eine konfigurierbare Kennung an den Titel an, z. B. 'Demo Titel ; toby.gallenkamp'."/>
  <IconUrl DefaultValue="https://terminaddin.gfi-ernst.com/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://terminaddin.gfi-ernst.com/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://terminaddin.gfi-ernst.com/"/>

  <AppDomains>
    <AppDomain>https://terminaddin.gfi-ernst.com</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <Requirements>
    <Sets DefaultMinVersion="1.3">
      <Set Name="Mailbox"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://terminaddin.gfi-ernst.com/src/taskpane/taskpane.html"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit"/>
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
  </Rule>

  <DisableEntityHighlighting>false</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">

      <Requirements>
        <bt:Sets DefaultMinVersion="1.12">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>

      <Hosts>
        <Host xsi:type="MailHost">

          <!-- Runtime fuer die ereignisbasierte Aktivierung.
               WebViewRuntime.Url = Outlook im Web / neues Outlook (HTML-Runtime)
               JSRuntime.Url      = klassisches Outlook fuer Windows (JS-only-Runtime) -->
          <Runtimes>
            <Runtime resid="WebViewRuntime.Url">
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>

          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url"/>

            <!-- Menuepunkt im Termin-Formular (Organisator) -->
            <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="wzGroupOrganizer">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Menu" id="wzMenuOrganizer">
                    <Label resid="Menu.Label"/>
                    <Supertip>
                      <Title resid="Menu.Label"/>
                      <Description resid="Menu.Tip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16"/>
                      <bt:Image size="32" resid="Icon.32"/>
                      <bt:Image size="80" resid="Icon.80"/>
                    </Icon>
                    <Items>
                      <Item id="wzMenuOrganizerSettings">
                        <Label resid="Settings.Label"/>
                        <Supertip>
                          <Title resid="Settings.Label"/>
                          <Description resid="Settings.Tip"/>
                        </Supertip>
                        <Icon>
                          <bt:Image size="16" resid="Icon.16"/>
                          <bt:Image size="32" resid="Icon.32"/>
                          <bt:Image size="80" resid="Icon.80"/>
                        </Icon>
                        <Action xsi:type="ShowTaskpane">
                          <SourceLocation resid="Taskpane.Url"/>
                        </Action>
                      </Item>
                      <Item id="wzMenuOrganizerApply">
                        <Label resid="Apply.Label"/>
                        <Supertip>
                          <Title resid="Apply.Label"/>
                          <Description resid="Apply.Tip"/>
                        </Supertip>
                        <Icon>
                          <bt:Image size="16" resid="Icon.16"/>
                          <bt:Image size="32" resid="Icon.32"/>
                          <bt:Image size="80" resid="Icon.80"/>
                        </Icon>
                        <Action xsi:type="ExecuteFunction">
                          <FunctionName>applyKennungNow</FunctionName>
                        </Action>
                      </Item>
                    </Items>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>

            <!-- Menuepunkt im Posteingang, damit die Einstellungen ohne offenen Termin erreichbar sind -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="wzGroupRead">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Button" id="wzButtonReadSettings">
                    <Label resid="Settings.Label"/>
                    <Supertip>
                      <Title resid="Settings.Label"/>
                      <Description resid="Settings.Tip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16"/>
                      <bt:Image size="32" resid="Icon.32"/>
                      <bt:Image size="80" resid="Icon.80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>

            <!-- Ereignisbasierte Aktivierung -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <!-- Neuer Termin wird angelegt: Titel wird beobachtet und die Kennung angehaengt.
                     Fallback, weil Outlook fuer "Speichern & schliessen" kein Ereignis anbietet. -->
                <LaunchEvent Type="OnNewAppointmentOrganizer" FunctionName="onNewAppointmentOrganizerHandler"/>
                <!-- Besprechung mit Teilnehmern wird gesendet -->
                <LaunchEvent Type="OnAppointmentSend" FunctionName="onAppointmentSendHandler" SendMode="SoftBlock"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>

          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16" DefaultValue="https://terminaddin.gfi-ernst.com/assets/icon-16.png"/>
          <bt:Image id="Icon.32" DefaultValue="https://terminaddin.gfi-ernst.com/assets/icon-32.png"/>
          <bt:Image id="Icon.80" DefaultValue="https://terminaddin.gfi-ernst.com/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Taskpane.Url" DefaultValue="https://terminaddin.gfi-ernst.com/src/taskpane/taskpane.html"/>
          <bt:Url id="Commands.Url" DefaultValue="https://terminaddin.gfi-ernst.com/src/commands/commands.html"/>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://terminaddin.gfi-ernst.com/src/launchevent/launchevent.html"/>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://terminaddin.gfi-ernst.com/src/launchevent/launchevent.js"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="Group.Label" DefaultValue="Termin-Kennung"/>
          <bt:String id="Menu.Label" DefaultValue="Termin-Kennung"/>
          <bt:String id="Settings.Label" DefaultValue="Einstellungen"/>
          <bt:String id="Apply.Label" DefaultValue="Kennung jetzt anhaengen"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="Menu.Tip" DefaultValue="Automatik aktivieren und Namen festlegen, der an den Termintitel angehaengt wird."/>
          <bt:String id="Settings.Tip" DefaultValue="Automatik ein- oder ausschalten und den Namen festlegen, z. B. toby.gallenkamp."/>
          <bt:String id="Apply.Tip" DefaultValue="Haengt die konfigurierte Kennung sofort an den Titel dieses Termins an."/>
        </bt:LongStrings>
      </Resources>

    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
