.. include:: headings.inc .. _FileTypeInfo: ========================================================================================================================================== |phoenix_title| **FileTypeInfo** ========================================================================================================================================== Container of information about :ref:`FileType`. This class simply stores information associated with the file type. It doesn't do anything on its own and is used only to allow constructing :ref:`FileType` from it (instead of specifying all the constituent pieces separately) and also with :meth:`MimeTypesManager.AddFallbacks` . | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **FileTypeInfo** .. raw:: html

Inheritance diagram of FileTypeInfo

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~FileTypeInfo.__init__` Default constructor creates an invalid file type info object. :meth:`~FileTypeInfo.AddExtension` Add another extension associated with this file type. :meth:`~FileTypeInfo.GetDescription` Get the long, user visible description. :meth:`~FileTypeInfo.GetExtensions` Get the array of all extensions. :meth:`~FileTypeInfo.GetExtensionsCount` Get the number of extensions. :meth:`~FileTypeInfo.GetIconFile` Get the icon filename. :meth:`~FileTypeInfo.GetIconIndex` Get the index of the icon within the icon file. :meth:`~FileTypeInfo.GetMimeType` Get the ``MIME`` type. :meth:`~FileTypeInfo.GetOpenCommand` Get the open command. :meth:`~FileTypeInfo.GetPrintCommand` Get the print command. :meth:`~FileTypeInfo.GetShortDesc` Get the short description (only used under Win32 so far). :meth:`~FileTypeInfo.SetDescription` Set the file type description. :meth:`~FileTypeInfo.SetIcon` Set the icon information. :meth:`~FileTypeInfo.SetOpenCommand` Set the command to be used for opening files of this type. :meth:`~FileTypeInfo.SetPrintCommand` Set the command to be used for printing files of this type. :meth:`~FileTypeInfo.SetShortDesc` Set the short description for the files of this type. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~FileTypeInfo.Description` See :meth:`~FileTypeInfo.GetDescription` and :meth:`~FileTypeInfo.SetDescription` :attr:`~FileTypeInfo.Extensions` See :meth:`~FileTypeInfo.GetExtensions` :attr:`~FileTypeInfo.ExtensionsCount` See :meth:`~FileTypeInfo.GetExtensionsCount` :attr:`~FileTypeInfo.IconFile` See :meth:`~FileTypeInfo.GetIconFile` :attr:`~FileTypeInfo.IconIndex` See :meth:`~FileTypeInfo.GetIconIndex` :attr:`~FileTypeInfo.MimeType` See :meth:`~FileTypeInfo.GetMimeType` :attr:`~FileTypeInfo.OpenCommand` See :meth:`~FileTypeInfo.GetOpenCommand` and :meth:`~FileTypeInfo.SetOpenCommand` :attr:`~FileTypeInfo.PrintCommand` See :meth:`~FileTypeInfo.GetPrintCommand` and :meth:`~FileTypeInfo.SetPrintCommand` :attr:`~FileTypeInfo.ShortDesc` See :meth:`~FileTypeInfo.GetShortDesc` and :meth:`~FileTypeInfo.SetShortDesc` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: FileTypeInfo(object) Container of information about FileType. **Possible constructors**:: FileTypeInfo() FileTypeInfo(mimeType) FileTypeInfo(mimeType, openCmd, printCmd, description, extension) FileTypeInfo(sArray) .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **__init__** `(self)` Default constructor creates an invalid file type info object. Such invalid/empty object should be used to terminate the list of file types passed to :meth:`MimeTypesManager.AddFallbacks` . **~~~** **__init__** `(self, mimeType)` Constructor specifying just the ``MIME`` type name. Use the various setter methods below to fully initialize the object. :param `mimeType`: :type `mimeType`: string .. versionadded:: 2.9.2 **~~~** **__init__** `(self, mimeType, openCmd, printCmd, description, extension)` Constructor allowing to specify all the fields at once. This is a vararg constructor taking an arbitrary number of extensions after the first four required parameters. The list must be terminated by ``NullPtr`` , notice that ``NULL`` can't be used here in portable code (C++0x ``nullptr`` can be used as well if your compiler supports it). :param `mimeType`: :type `mimeType`: string :param `openCmd`: :type `openCmd`: string :param `printCmd`: :type `printCmd`: string :param `description`: :type `description`: string :param `extension`: :type `extension`: string **~~~** **__init__** `(self, sArray)` Constuctor using an array of string elements corresponding to the parameters of the constructor above in the same order. :param `sArray`: :type `sArray`: list of strings **~~~** .. method:: AddExtension(self, ext) Add another extension associated with this file type. :param `ext`: :type `ext`: string .. versionadded:: 2.9.2 .. method:: GetDescription(self) Get the long, user visible description. :rtype: `string` .. method:: GetExtensions(self) Get the array of all extensions. :rtype: `list of strings` .. method:: GetExtensionsCount(self) Get the number of extensions. :rtype: `int` .. method:: GetIconFile(self) Get the icon filename. :rtype: `string` .. method:: GetIconIndex(self) Get the index of the icon within the icon file. :rtype: `int` .. method:: GetMimeType(self) Get the ``MIME`` type. :rtype: `string` .. method:: GetOpenCommand(self) Get the open command. :rtype: `string` .. method:: GetPrintCommand(self) Get the print command. :rtype: `string` .. method:: GetShortDesc(self) Get the short description (only used under Win32 so far). :rtype: `string` .. method:: SetDescription(self, description) Set the file type description. :param `description`: :type `description`: string .. versionadded:: 2.9.2 .. method:: SetIcon(self, iconFile, iconIndex=0) Set the icon information. :param `iconFile`: :type `iconFile`: string :param `iconIndex`: :type `iconIndex`: int .. method:: SetOpenCommand(self, command) Set the command to be used for opening files of this type. :param `command`: :type `command`: string .. versionadded:: 2.9.2 .. method:: SetPrintCommand(self, command) Set the command to be used for printing files of this type. :param `command`: :type `command`: string .. versionadded:: 2.9.2 .. method:: SetShortDesc(self, shortDesc) Set the short description for the files of this type. This is only used under MSW for some of the registry keys used for the file type registration. :param `shortDesc`: :type `shortDesc`: string .. attribute:: Description See :meth:`~FileTypeInfo.GetDescription` and :meth:`~FileTypeInfo.SetDescription` .. attribute:: Extensions See :meth:`~FileTypeInfo.GetExtensions` .. attribute:: ExtensionsCount See :meth:`~FileTypeInfo.GetExtensionsCount` .. attribute:: IconFile See :meth:`~FileTypeInfo.GetIconFile` .. attribute:: IconIndex See :meth:`~FileTypeInfo.GetIconIndex` .. attribute:: MimeType See :meth:`~FileTypeInfo.GetMimeType` .. attribute:: OpenCommand See :meth:`~FileTypeInfo.GetOpenCommand` and :meth:`~FileTypeInfo.SetOpenCommand` .. attribute:: PrintCommand See :meth:`~FileTypeInfo.GetPrintCommand` and :meth:`~FileTypeInfo.SetPrintCommand` .. attribute:: ShortDesc See :meth:`~FileTypeInfo.GetShortDesc` and :meth:`~FileTypeInfo.SetShortDesc`