--------------------------------------------------------------------------------
-- <auto-generated>                                                           --
--     This code was generated by a tool.                                     --
--                                                                            --
--     Changes to this file may cause incorrect behavior and will be lost if  --
--     the code is regenerated.                                               --
-- </auto-generated>                                                          --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                                                                            --
--    Copyright(c) 2018 Alexander Gamper, All Rights Reserved.                --
--                                                                            --
--    Ada-WinRT                                                               --
--                                                                            --
-- This program is free software: you can redistribute it and / or modify     --
-- it under the terms of the GNU Lesser General Public License as published by--
-- the Free Software Foundation, either version 3 of the License, or          --
-- (at your option) any later version.                                        --
--                                                                            --
-- This program is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               --
-- GNU Lesser General Public License for more details.                        --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public License   --
-- along with this program.If not, see http://www.gnu.org/licenses            --
--                                                                            --
--------------------------------------------------------------------------------
with Windows.Storage.Streams;
with Windows.UI;
with Ada.Unchecked_Conversion;
--------------------------------------------------------------------------------
package body Windows.UI.Text is

   ------------------------------------------------------------------------
   -- Create functions (for activatable classes)
   ------------------------------------------------------------------------
   
   function Create return Windows.UI.Text.IContentLinkInfo is
      Hr            : Windows.HResult := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.ContentLinkInfo");
      Instance      : aliased IInspectable := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased IUnknown := null;
      function Convert is new Ada.Unchecked_Conversion(IUnknown , Windows.UI.Text.IContentLinkInfo) with inline;
   begin
      Hr := RoActivateInstance(m_hString, Instance'Address);
      if Hr = 0 then
         Hr := Instance.QueryInterface(Windows.UI.Text.IID_IContentLinkInfo'Access, RetVal'access);
         RefCount := Instance.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return Convert(RetVal);
   end;
   
   ------------------------------------------------------------------------
   -- Override Implementations
   ------------------------------------------------------------------------
   
   ------------------------------------------------------------------------
   -- Static procedures/functions
   ------------------------------------------------------------------------
   
   function get_Black
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Black(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_Bold
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Bold(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_ExtraBlack
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_ExtraBlack(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_ExtraBold
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_ExtraBold(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_ExtraLight
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_ExtraLight(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_Light
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Light(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_Medium
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Medium(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_Normal
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Normal(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_SemiBold
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_SemiBold(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_SemiLight
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_SemiLight(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_Thin
   return Windows.UI.Text.FontWeight is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.FontWeights");
      m_Factory     : IFontWeightsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontWeight;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_IFontWeightsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_Thin(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_AutoColor
   return Windows.UI.Color is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Color;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_AutoColor(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_MaxUnitCount
   return Windows.Int32 is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.Int32;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_MaxUnitCount(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_MinUnitCount
   return Windows.Int32 is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.Int32;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_MinUnitCount(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_UndefinedColor
   return Windows.UI.Color is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Color;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_UndefinedColor(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_UndefinedFloatValue
   return Windows.Single is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.Single;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_UndefinedFloatValue(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_UndefinedFontStretch
   return Windows.UI.Text.FontStretch is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontStretch;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_UndefinedFontStretch(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_UndefinedFontStyle
   return Windows.UI.Text.FontStyle is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.UI.Text.FontStyle;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_UndefinedFontStyle(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
   function get_UndefinedInt32Value
   return Windows.Int32 is
      Hr            : Windows.HRESULT := S_OK;
      m_hString     : Windows.String := To_String("Windows.UI.Text.TextConstants");
      m_Factory     : ITextConstantsStatics := null;
      RefCount      : Windows.UInt32 := 0;
      RetVal        : aliased Windows.Int32;
   begin
      Hr := RoGetActivationFactory(m_hString, IID_ITextConstantsStatics'Access , m_Factory'Address);
      if Hr = 0 then
         Hr := m_Factory.get_UndefinedInt32Value(RetVal'Access);
         RefCount := m_Factory.Release;
      end if;
      Hr := WindowsDeleteString(m_hString);
      return RetVal;
   end;
   
end;
