<?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"
           xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
           xsi:type="TaskPaneApp">

  <Id>a1b2c3d4-5e6f-7890-abcd-ef1234567890</Id>
  <Version>0.5.1.0</Version>
  <ProviderName>Forecastle</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Forecastle" />
  <Description DefaultValue="Pull Forecastle cube data into Excel and write changes back to the cube." />
  <IconUrl DefaultValue="https://www.forecastle.app/excel_addin/assets/icon-32.png" />
  <HighResolutionIconUrl DefaultValue="https://www.forecastle.app/excel_addin/assets/icon-80.png" />
  <SupportUrl DefaultValue="https://www.forecastle.app/" />

  <AppDomains>
    <AppDomain>https://www.forecastle.app</AppDomain>
  </AppDomains>

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

  <!-- Declare the Custom Functions runtime so Excel loads
       functions.json, registers FORECASTLE.READ / .WRITE, and
       exposes IntelliSense (function-name dropdown + parameter
       tooltips on open-paren). Without this, some Excel hosts
       register the functions but silently skip the metadata-
       driven hints. -->
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="CustomFunctionsRuntime" MinVersion="1.1" />
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://www.forecastle.app/excel_addin/taskpane.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <!-- Custom-functions runtime declaration. Excel hosts a
             second, headless page (functions.html) alongside the
             taskpane; functions.js registers the FORECASTLE.READ
             and FORECASTLE.WRITE functions against the metadata
             in functions.json. -->
        <Runtimes>
          <Runtime resid="Forecastle.Functions.Runtime.Url" lifetime="long" />
        </Runtimes>
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title" />
            <Description resid="GetStarted.Description" />
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl" />
          </GetStarted>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="Forecastle.Group1">
                <Label resid="Forecastle.GroupLabel" />
                <Icon>
                  <bt:Image size="16" resid="Forecastle.Icon16" />
                  <bt:Image size="32" resid="Forecastle.Icon32" />
                  <bt:Image size="80" resid="Forecastle.Icon80" />
                </Icon>
                <Control xsi:type="Button" id="Forecastle.TaskpaneButton">
                  <Label resid="Forecastle.TaskpaneButton.Label" />
                  <Supertip>
                    <Title resid="Forecastle.TaskpaneButton.Label" />
                    <Description resid="Forecastle.TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Forecastle.Icon16" />
                    <bt:Image size="32" resid="Forecastle.Icon32" />
                    <bt:Image size="80" resid="Forecastle.Icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Forecastle.Taskpane.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
          <!-- Wires =FORECASTLE.READ() / =FORECASTLE.WRITE() into
               the workbook. Namespace becomes the function prefix
               so users see them as FORECASTLE.READ rather than a
               bare READ that collides with built-in functions. -->
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Forecastle.Functions.Script.Url" />
            </Script>
            <Page>
              <SourceLocation resid="Forecastle.Functions.Page.Url" />
            </Page>
            <Metadata>
              <SourceLocation resid="Forecastle.Functions.Metadata.Url" />
            </Metadata>
            <Namespace resid="Forecastle.Functions.Namespace" />
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Forecastle.Icon16" DefaultValue="https://www.forecastle.app/excel_addin/assets/icon-16.png" />
        <bt:Image id="Forecastle.Icon32" DefaultValue="https://www.forecastle.app/excel_addin/assets/icon-32.png" />
        <bt:Image id="Forecastle.Icon80" DefaultValue="https://www.forecastle.app/excel_addin/assets/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://www.forecastle.app/" />
        <bt:Url id="Forecastle.Taskpane.Url" DefaultValue="https://www.forecastle.app/excel_addin/taskpane.html" />
        <bt:Url id="Forecastle.Functions.Runtime.Url" DefaultValue="https://www.forecastle.app/excel_addin/functions.html" />
        <bt:Url id="Forecastle.Functions.Page.Url" DefaultValue="https://www.forecastle.app/excel_addin/functions.html" />
        <bt:Url id="Forecastle.Functions.Script.Url" DefaultValue="https://www.forecastle.app/excel_addin/functions.js" />
        <bt:Url id="Forecastle.Functions.Metadata.Url" DefaultValue="https://www.forecastle.app/excel_addin/functions.json" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GetStarted.Title" DefaultValue="Forecastle add-in loaded" />
        <bt:String id="Forecastle.GroupLabel" DefaultValue="Forecastle" />
        <bt:String id="Forecastle.TaskpaneButton.Label" DefaultValue="FP&amp;A" />
        <bt:String id="Forecastle.Functions.Namespace" DefaultValue="FORECASTLE" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="Pull FP&amp;A cube data into Excel and write changes back." />
        <bt:String id="Forecastle.TaskpaneButton.Tooltip" DefaultValue="Open the Forecastle task pane." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
