# PluginPanelItem

The PluginPanelItem structure describes a single item in a file system emulated by a plugin. It is used both to return information about the plugin file system and to pass a list of files to process to the plugin.

Attention!

- The size of the PluginPanelItem structure should be 366 bytes.

    struct PluginPanelItem
    {
    #ifndef _FAR_USE_WIN32_FIND_DATA
      struct FAR_FIND_DATA   FindData;
    #else
      WIN32_FIND_DATA FindData;
    #endif
      DWORD PackSizeHigh;
      DWORD PackSize;
      DWORD Flags;
      DWORD NumberOfLinks;
      char *Description;
      char *Owner;
      char **CustomColumnData;
      int CustomColumnNumber;
      DWORD_PTR UserData;
      DWORD CRC32;
      DWORD Reserved[2];
    };

### Elements

FindData
The FindData field contains many file parameters. See the description of the WIN32_FIND_DATA structure for detailed information.
PackSizeHigh
Contains the high-order 4 bytes of the file's packed size (in bytes). Currently unused.
PackSize
Contains the low-order 4 bytes of the file's packed size (in bytes).
Flags
A combination of the following values (the PLUGINPANELITEMFLAGS enumeration):

Flag | Description
--- | ---
PPIF_PROCESSDESCR | Use FAR's internal description processing. This flag can be set for processed files in the DeleteFiles, GetFiles and PutFiles functions. If set, FAR will update the description file contents using file names returned from the GetOpenPluginInfo function.
PPIF_SELECTED | In Control functions FCTL_GETPANELINFO, FCTL_GETANOTHERPANELINFO, FCTL_SETSELECTION and FCTL_SETANOTHERSELECTION this flag allows to check and set item selection. In PutFiles, GetFiles and ProcessHostFile functions, if an operation has failed, but some of the files were successfully processed, the plugin can remove selection only from the processed files. To perform this, the plugin should clear the `PPIF_SELECTED` flag in processed items in the PluginPanelItem list passed to the function.
PPIF_USERDATA | If this flag is set, FAR considers the UserData field a pointer to a user data structure. Cf. the description of the UserData field. The low order word of the Flags parameter can be used by a plugin for its own flags.

NumberOfLinks
Number of hard links.
Description
Points to a file description. Plugins can use this field to pass file descriptions to FAR. If not required, set theis field to `NULL`. If a plugin uses standard FAR description processing and has passed description file names to FAR in the GetOpenPluginInfo function, this field also must be `NULL`.
Owner
Points to a file owner name. Plugins can use this field to pass file owner names to FAR. If not used, set this field to `NULL`.
CustomColumnData
Points to an array of string addresses for plugin defined column types. The first string contains data for the `C0` column type, the second - for `C1` and so on. Up to 10 additional column types from `C0` to `C9` can be defined. If not used, set this field to `NULL`.
CustomColumnNumber
Number of data strings for additional column types.
UserData
This field can be used by the plugin to store either a 32-bit value or a pointer to a data structure. In the latter case, the first field of this structure must be a 32-bit value containig the structure size and the plugin must set `PPIF_USERDATA` in the Flags field. This allows FAR to copy the structure correctly to FAR internal buffers and later pass it to the plugin in PluginPanelItem lists. In the FreeFindData function the plugin must free the memory occupied by this additional structure.
CRC32
A 32-bit CRC (checksum) value. FAR does not use this field.
Reserved
Reserved for future use, should be set to 0.

### Remarks

1. All the data allocated by the plugin for Description, Owner and CustomColumnData members must be released by the plugin. FAR copies these data to its own structures, so it can be released at any time after passing these to FAR in the GetFindData function.
2. If the plugin uses the UserData field to store information about a file, the plugin writer should check the validity of that field. This is related to the following issue: When FAR calls the GetFiles function from the list of found files, only the FindData member of the PluginPanelItem structure is filled correctly. All other fields are equal to `NULL`.

See also:
structures | _FAR_USE_WIN32_FIND_DATA | FAR_FIND_DATA | TPluginPanelItem