<?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>65e690cb-693c-4046-a044-387146008dd7</Id>
  <Version>1.0.1.0</Version>

  <ProviderName>Conbool</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>

  <DisplayName DefaultValue="Conbool SecureMail"/>
  <Description DefaultValue="Choose encryption method for outgoing emails: S/MIME, PGP, PDF Password, or Message Portal."/>

  <IconUrl DefaultValue="https://conbool.com/office-addins/securemail/icons/icon-80.png"/>
  <HighResolutionIconUrl DefaultValue="https://conbool.com/office-addins/securemail/icons/icon-80.png"/>
  <SupportUrl DefaultValue="https://conbool.com/contact"/>

  <AppDomains>
    <AppDomain>https://conbool.com</AppDomain>
    <AppDomain>https://bxzohwecoqijjqefenfj.supabase.co</AppDomain>
    <AppDomain>https://login.microsoftonline.com</AppDomain>
    <AppDomain>https://outlook.office.com</AppDomain>
    <AppDomain>https://outlook.office365.com</AppDomain>
  </AppDomains>

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

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.13"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://conbool.com/office-addins/securemail/taskpane.html"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </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.13">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>

      <Hosts>
        <Host xsi:type="MailHost">
          <Runtimes>
            <Runtime resid="WebViewRuntime.Url" lifetime="short">
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>

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

            <!-- Compose mode only -->
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="smComposeGroup">
                  <Label resid="GroupLabel"/>
                  <Control xsi:type="Button" id="smComposeOpenPaneButton">
                    <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="onComposeHandler"/>
                <LaunchEvent Type="OnMessageRecipientsChanged" FunctionName="onRecipientsChangedHandler"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>

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

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://conbool.com/office-addins/securemail/icons/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://conbool.com/office-addins/securemail/icons/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://conbool.com/office-addins/securemail/icons/icon-80.png"/>
        </bt:Images>

        <bt:Urls>
          <bt:Url id="Commands.Url" DefaultValue="https://conbool.com/office-addins/securemail/commands.html"/>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://conbool.com/office-addins/securemail/commands.html"/>
          <bt:Url id="Taskpane.Url" DefaultValue="https://conbool.com/office-addins/securemail/taskpane.html"/>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://conbool.com/office-addins/securemail/commands.js"/>
        </bt:Urls>

        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="SecureMail"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="SecureMail"/>
        </bt:ShortStrings>

        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Choose encryption method for this email."/>
        </bt:LongStrings>
      </Resources>

      <WebApplicationInfo>
        <Id>6b101597-cb44-4013-8f23-c12acfeba80e</Id>
        <Resource>api://conbool.com/6b101597-cb44-4013-8f23-c12acfeba80e</Resource>
        <Scopes>
          <Scope>openid</Scope>
          <Scope>profile</Scope>
          <Scope>email</Scope>
          <Scope>offline_access</Scope>
          <Scope>User.Read</Scope>
        </Scopes>
      </WebApplicationInfo>

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