//===============================================================================
// Xe UI toolkit
//
// XeToggleButton
//  Public header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2025-Jun-12 00:03:08
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XeToggleButton_h
#define _XeToggleButton_h

#include <Xe/Label.h>

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

extern XeWidgetClass*                    XeToggleButton_class;
typedef struct _XeToggleButtonClassRec*  XeToggleButtonClass;
typedef struct _XeToggleButtonRec*       XeToggleButton;

enum
{
	XeButtonTypeTOGGLE = 0,
	XeButtonTypeLED,
	XeButtonTypeLIST_HEADER,
	XeButtonTypeMODE,
	XeButtonTypeTAB_TOP,     // Folder tab above
	XeButtonTypeTAB_BOTTOM,  // Folder tab below
	XeButtonTypeTAB_LEFT,    // Folder tab to the left
	XeButtonTypeTAB_RIGHT    // Folder tab to the right
};

enum
{
	XeN_OF_MANY = 0, XeONE_OF_MANY, XeN_OF_MANY_FULL_HEIGHT
};

typedef struct
{
	XeCallbackStructCore;

	int      ClickCount;
	EBool    Set;
	EBool    ValueChanged;
	uint8_t  ArrowDirection;
	EBool    ArrowDirectionChanged;
} XeToggleButtonCallbackStruct;

extern void   XeToggleButton_SetState(XeWidget PWidget, const EBool PValue, const EBool PNotify);
extern EBool  XeToggleButton_GetState(XeWidget PWidget);
extern void   XeToggleButton_Arm(XeWidget PW);
extern void   XeToggleButton_Disarm(XeWidget PW);
extern void   XeToggleButton_ArmSubButton(XeWidget PW);

//
// Deferred Widgets
//
extern XeDWidgetClass  XeDToggleButton_class;

extern void       _XeCB_ToggleButton(XeWidget PW, EPointer PClientData, EPointer PCallData);
extern XeDWidget  XeToggleButton_Add(XeApp PApp, const char* PLocation, const EBool PDefault, const char* PName, const char PMnemonic, const char* PAccel, const char* PAccelText, const EBool PCreateOptionsButton, const char* PToolTip,  XeCallbackFunc PCallback, EPointer PClientData);
extern void       XeStdSetToggleButtonArgs(const XeCoordinate PMarginLeft, const XeCoordinate PMarginRight,  const XeCoordinate PMarginTop, const XeCoordinate PMarginBottom,  EArg* PArgs, int* PArgCnt);

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

#endif // _XeToggleButton_h
