//================================================================================
// Xe GUI library
//
// FileSelectionBox private header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Jun-16 01:16:09
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XeFSBoxP_h
#define _XeFSBoxP_h

#include <Xe/Dialog.h>
#include <Xe/FSBox.h>

#include <Xe/ColumnList.h>

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif

#ifndef xeListItem_def
#define xeListItem_def  1
typedef struct  xeListItem_S   xeListItem;
typedef struct  xeListItem_S*  xeListItemPtr;
EListA_t(xeListItemPtr);
#endif

typedef struct
{
	XeWidget  ListW;
	EListA_s(, xeListItemPtr, Items);  // These are persistent, so we can change the icon sizes etc. wihout regenerating everything.
} XeFSBList;

typedef struct
{
	EDirEntryCore;

	EpImage*  ThumbnailImage;
} XeDirEntry;
EListA_t(XeDirEntry);

typedef struct
{
	XeDialogCore;

	XeWidget          ShellW;
	XeWidget          ManagerW;
	XeWidget          FilterMatrixW, FilterTextW, FilterListBW,
	                  ListsMatrixW;

	XeFSBList         DirList;

	XeFSBList         FileList;
	XeWidget          FileListLabelW, FileIconSizeW, PreviewW, UpW, ViewModeMatrixW, SingleViewBW, DualViewBW;
	XeWidget          FileLabelW, FileTextW, FilterListFormW, FilterListW;
	XeColumnList      FileListColumns;

	XeEntryIdFunc     EntryIdFunc;

	XeWidget          ListsLayoutW;
	XeWidget          DirsScrolledWindowW, FilesScrolledWindowW,
	                  DirListLabelW,
	                  CustomItemW;
	XeWidget          FocusWidget;
	int               VScrollbarSizeX;
	int               FileListSizeX, ListXMargin, CustomItemPlacement, CustomItemType;
	int               SizeXDiff, SizeYDiff;
	int               SizeXWithLists, SizeYWithLists;
	unsigned int      DispFlags;
	char*             DirFilter;
	char*             Path;
	char*             FileName;

	EListA_s(, XeDirEntry, DirEntries);
	EIndex            NumOfDirs;

	char*             TmpFilterList;
	EguiCallbackList  ValueChangedCallback;

	XeIntervalId      DirMonitorTimer;
	time_t            DirLastUpdateMTime;

	uint16_t          MultiSelect:1, Mapped:1, DirListOn:1, FileListOn:1, ShowLists:1,
	                  FileListVisibleItemCountGiven:1,
	                  ShowFullPaths:1, FilterListOn:1, PrgChangedSize:1,
	                  FilePreviews:1;  // Show thumbnail images if available instead of the standard icons

	int               FolderIconSize, FileIconSize;
	int               FileListVisibleItemCount;

	uint16_t          FileDeleteAction, FileActivateOnSelectWith;
} XeFileSelectionBox;



#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}	// Close scope of 'extern "C"' declaration
#endif


extern void  _XeFSBoxFree(void);


#endif	// _XeFSBoxP_h
