namespace ui

namespace ui {

// namespaces

namespace ui.ComboBoxHistory;

// typedefs

typedef ui.ListItem ComboItem;
typedef ui.ListItem EnumPropertyOption;

// enums

bitflag enum Alignment;
enum AuthenticationMethod;
bitflag enum ColorFlags;
enum FileDlgKind;
enum FilePropertyMode;
bitflag enum FilePropertyOptions;
bitflag enum FontFlags;
enum FrameShadow;
enum InsertActionPos;
enum NetworkAdapterUsage;
enum SizePolicy;
bitflag enum SizePolicyFlags;
enum StdColor;
enum StdDlgButton;
bitflag enum StdDlgButtons;
enum StdDlgIcon;
enum TextFormat;
enum ToolButtonStyle;
enum WebSocketCloseMode;
enum WebSocketTransmitMode;

// structs

struct ColorRange;
struct DictionaryEntry;
struct FlagPropertyOption;
struct HidDeviceEntry;
struct ListItem;
struct TextAttr;

// classes

class AbstractButton;
class Action;
class ActionProperty;
class BoolProperty;
class BoxLayout;
class BufferPropertySet;
class CheckBox;
class CheckBoxLabel;
class ChecksumInfoSet;
class ColorProperty;
class ColorRangeTree;
class ComboBox;
class ComboProperty;
class DictionaryProperty;
class DictionaryWidget;
class EnumProperty;
class FileDlg;
class FileProperty;
class FlagProperty;
class FormLayout;
class GroupBox;
class GroupProperty;
class HBoxLayout;
class Icon;
class InformationGrid;
class InformationGroup;
class InformationItem;
class InformationStatValue;
class InformationValue;
class IntProperty;
class Label;
class Layout;
class LineEdit;
class ListWidget;
class LogRecordCodeFilterUi;
class LoginDlg;
class Menu;
class MessageDlg;
class ProgressDlg;
class Property;
class PropertyGrid;
class PushButton;
class RadioButton;
class SerialUi;
class SocketPropertySet;
class SpinBox;
class SshPropertySet;
class SslPropertySet;
class StatusBar;
class StatusPane;
class StdEditToolBar;
class StdSessionInfoSet;
class StringProperty;
class Terminal;
class ThroughputInfoSet;
class ToolBar;
class VBoxLayout;
class WebSocketUi;
class Widget;

// global variables

ui.EnumPropertyOption const TransmitModeOptionTable[3] = {  { "Auto",   WebSocketTransmitMode.Auto },  { "Text",   WebSocketTransmitMode.Text },  { "Binary", WebSocketTransmitMode.Binary },  };
string_t const TransmitModeToolTipTable[3] = {  "Transmit as text if the packet is a valid UTF-8; transmit as binary otherwise",  "Transmit as text always",  "Transmit as binary always",  };
ui.EnumPropertyOption CloseModeOptionTable[2] = {  { "Graceful", WebSocketCloseMode.Graceful },  { "Abrupt",   WebSocketCloseMode.Abrupt },  };

// global functions

uint_t rgb(
    uint8_t r,
    uint8_t g,
    uint8_t b
);

ui.DictionaryEntry* loadDictionary(
    doc.Storage* storage,
    string_t name,
    size_t* count = null
);

void saveDictionary(
    ui.DictionaryEntry const* dictionary,
    doc.Storage* storage,
    string_t name
);

ui.DictionaryEntry* insertDictionaryHead(
    ui.DictionaryEntry* dictionary,
    string_t key,
    string_t value,
    bool isChecked = true
);

std.StringHashTable* createDictionaryHashTable(ui.DictionaryEntry const* dictionary);

ui.DictionaryEntry* findDictionaryEntry(
    ui.DictionaryEntry* dictionary,
    string_t key
);

bool isHidMonDeviceLess(
    io.HidMonDeviceDesc const* device1,
    io.HidMonDeviceDesc const* device2
);

void refreshHidMonDeviceListUi(
    ui.ComboBox* deviceCombo,
    ui.EnumProperty* deviceProp
);

size_t findHidMonDeviceComboIndex(
    ui.ComboBox* deviceCombo,
    uint_t vid,
    uint_t pid,
    uint_t captureDeviceId = -1,
    uint_t address = -1,
    uint_t interfaceId = -1
);

bool isHidDeviceLess(
    ui.HidDeviceEntry const* device1,
    ui.HidDeviceEntry const* device2
);

void refreshHidDeviceListUi(
    ui.ComboBox* deviceCombo,
    ui.EnumProperty* deviceProp
);

size_t findHidDeviceComboIndex(
    ui.ComboBox* deviceCombo,
    uint_t vid,
    uint_t pid,
    string_t path
);

ui.EnumPropertyOption const* createPcapDeviceOptionArray();

ui.EnumProperty* createPcapDeviceProperty(
    ui.PropertyGrid* propertyGrid,
    ui.GroupProperty* group = null,
    ui.Property* beforeProp = null,
    string_t name,
    string_t toolTip
);

ui.ComboBox* createPcapDeviceComboBox(
    ui.ToolBar* toolBar,
    uint_t width = -1
);

bool isSerialPortLess(
    io.SerialPortDesc const* port1,
    io.SerialPortDesc const* port2
);

void enumerateSerialPorts(
    ui.ComboBox* portCombo,
    ui.ComboProperty* portProp
);

ui.EnumPropertyOption const* createNetworkAdapterOptionArray(ui.NetworkAdapterUsage usage);

ui.EnumProperty* createNetworkAdapterProperty(
    ui.PropertyGrid* propertyGrid,
    ui.Property* group = null,
    ui.Property* insertBefore = null,
    ui.NetworkAdapterUsage usage,
    string_t name,
    string_t toolTip
);

ui.EnumProperty* createNetworkAdapterProperty(
    ui.PropertyGrid* propertyGrid,
    ui.NetworkAdapterUsage usage,
    string_t name,
    string_t toolTip
);

ui.ComboBox* createNetworkAdapterComboBox(
    ui.ToolBar* toolBar,
    ui.NetworkAdapterUsage usage,
    uint_t width = -1
);

io.SocketOptions getSocketOptions(
    ui.SocketPropertySet const* socketPropSet,
    ui.BufferPropertySet const* bufferPropSet
);

bool isUsbMonDeviceLess(
    io.UsbMonDeviceDesc const* device1,
    io.UsbMonDeviceDesc const* device2
);

void refreshUsbMonDeviceListUi(
    ui.ComboBox* deviceCombo,
    ui.EnumProperty* deviceProp
);

size_t findUsbMonDeviceComboIndex(
    ui.ComboBox* deviceCombo,
    uint_t vid,
    uint_t pid,
    uint_t captureDeviceId = -1,
    uint_t address = -1
);

bool isUsbDeviceLess(
    io.UsbDeviceEntry const* entry1,
    io.UsbDeviceEntry const* entry2
);

void refreshUsbDeviceListUi(
    ui.ComboBox* deviceCombo,
    ui.EnumProperty* deviceProp
);

size_t findUsbDeviceComboIndex(
    ui.ComboBox* deviceCombo,
    uint_t vid,
    uint_t pid,
    uint_t bus = -1,
    uint_t address = -1
);

size_t findUsbInterfaceComboIndex(
    ui.ComboBox* interfaceCombo,
    uint_t interfaceId,
    uint_t altSettingId = -1
);

size_t findUsbEndpointComboIndex(
    ui.ComboBox* interfaceCombo,
    uint_t endpointId
);

} // namespace ui