import
{
    AttributeResponseDTO,
    IdNameIdentityDTO,
    ObjectTypeEntityDTO,
    ResponseContainerDTO,
    WSAttributeFlags,
    WSValueType,
    VectorDetailsDTO
} from './Windream.WebService';


export interface IObjectTypesController
{
    GetIndexMaskData(parameter: GetIndexMaskDataDTO): IndexMaskDataResponseContainerDTO;
    GetObjectType(parameter: IGetObjectTypeDTO): IObjectTypeResponseContainerDTO;
    GetObjectTypes(): IObjectTypeResponseContainerDTO[];
}

export interface GetIndexMaskDataDTO
{
    Item: ObjectTypeIdentityDTO;
    IndexMaskMode?: IndexMaskModes;
}



export interface IndexMaskDataResponseContainerDTO extends ResponseContainerDTO
{
    TabPages: IndexMaskTabPageResponseDTO[];
}

export interface IndexMaskTabPageResponseDTO
{
    Id: number;
    Name: String;
    Title: String;
    ScriptTrigger: IndexMaskScriptTriggerDTO;
    Elements: ElementResponseDTO[];
    Styles: StylesResponseDTO;
}

export interface ElementResponseDTO
{
    Id: String;
    LabelFor?: String;
    LabelRef?: String;
    TabPageId: number;
    Type: IndexMaskElementTypes;
    Index: IndexResponseDTO;
    Title: String;
    ScriptTrigger: IndexMaskScriptTriggerDTO;
    TabOrder: number;
    Name: String;
    IsReadOnly: Boolean;
    Position: ElementPositionResponseDTO;
    Size: ElementSizeResponseDTO;
    Styles: StylesResponseDTO;
    Min?: number;
    Max?: number;
    MaxLength?: number;
    Values: Object[];
}

export interface ElementSizeResponseDTO
{
    Width: number;
    Height: number;
}

export interface IGetObjectTypeDTO
{
    AttributeFlags: WSAttributeFlags;
    Item: ObjectTypeIdentityDTO;
    Values: string[];
}

export interface ObjectTypeFullIdentityDTO extends IdNameIdentityDTO
{
    Entity: ObjectTypeEntityDTO;
}

export interface ObjectTypeIdentityDTO extends IdNameIdentityDTO
{
}

export interface IObjectTypeResponseContainerDTO extends ResponseContainerDTO
{
    Item: IObjectTypeResponseDTO;
}

export interface IObjectTypeResponseDTO extends ObjectTypeFullIdentityDTO
{
    Attributes: AttributeResponseDTO[];
    ObjectType: ObjectTypeFullIdentityDTO;
}

export enum IndexMaskModes
{
    Default = 0,
    Indexing = 1,
    Searching = 2
}

export enum IndexMaskElementTypes
{
    Undefined = 0,
    Image = 1,
    Label = 2,
    Frame = 3,
    TextBox = 4,
    TextArea = 5,
    Button = 6,
    CheckBox = 7,
    ListBox = 8,
    ComboBox = 9,
    DropDownList = 10,
    DatePicker = 11,
    Clipboard = 12,
    Option = 13,
    CheckBoxList = 14,
    List = 15,
    FlexGrid = 16,
    TimePicker = 17,
    DateTimePicker = 18
}

export interface ElementPositionResponseDTO
{
    X: number;
    Y: number;
}

export interface IndexMaskScriptTriggerDTO
{
    OnBlur: Boolean;
    OnFocus: Boolean;
    OnChange: Boolean;
    OnClick: Boolean;
}

export interface IndexResponseDTO
{
    Column: String;
    GlobalName: String;
    ObjectTypeSpecificName: String;
    DisplayName: String;
    Type: WSValueType;
    UnderlyingType?: WSValueType;
    IsRequired: Boolean;
    IsReadOnly: Boolean;
    DefaultValue: Object;
    VectorDetails?: VectorDetailsDTO;
}

export interface StylesResponseDTO
{
    BackgroundImage: String;
    BackgroundColor: String;
    TextColor: String;
}