import { AbstractControl, FormControl, FormGroup, ValidatorFn } from "@angular/forms";
import { Subject } from "rxjs";
import { EngineMagicService } from "./engine.magic.service";
import { HtmlProperties } from "@magic-xpa/gui";
import { GuiCommand, GuiInteractive } from "@magic-xpa/gui";
import { IGuiEvent } from "@magic-xpa/engine";
import { SubformMagicService } from "./subform.magic.service";
import { TitleMagicService } from "./title.magic.service";
import { AccessorMagicService } from "./accessor.magic.service";
import { Subscription } from "rxjs";
import { OverlayWindowService } from "./OverlayWindowService";
/**
 * Main service to connect the UI with the Magic WebCLient
 */
export declare class TaskMagicService {
    protected magic: EngineMagicService;
    private overlayWindowService;
    /**
     * Service to provide table-related functionalities
     */
    tableService: any;
    /**
     * Collection of data for all controls
     */
    Records: any;
    /**
     * FormGroup collection for line mode
     */
    formGroups: Array<FormGroup>;
    /**
     * FormGroup for all controls in screen mode
     */
    ScreenModeControls: FormGroup;
    /**
     * @ignore
     */
    refreshDom: Subject<GuiCommand>;
    /**
     * @ignore
     */
    subscribeRefreshDom: Subscription;
    /**
     * @ignore
     */
    detectChanges: Subject<any>;
    /**
     * @ignore
     */
    subscribeInteractiveCommands: Subscription;
    /**
     * @ignore
     */
    template: {
        [id: string]: string;
    };
    /**
     * Service to provide subform-related functionalities
     */
    mgSubformService: SubformMagicService;
    /**
     * Service to provide the title-change functionality
     */
    mgTitleService: TitleMagicService;
    /**
     * Service which enables getting/setting values from/to the Magic WebClient engine
     */
    mgAccessorService: AccessorMagicService;
    /**
     * @ignore
     */
    oldPageSize: number;
    /**
     *
     * @param  magic
     */
    constructor(magic: EngineMagicService, overlayWindowService: OverlayWindowService);
    /**
    * returns true if used is logged in
    * @returns
    */
    getIsLoggenIn(): boolean;
    /**
     * Id of task to which this service refers
     */
    _taskId: string;
    /**
     * returns the task Id
     * @returns
     */
    /**
    * Sets the task Id
    * @param value the task id to set
    */
    taskId: string;
    /**
     * Returns the task's data in Screen mode
     * @returns
     */
    readonly ScreenControlsData: any;
    /**
     * @ignore
     */
    settemplate(value: any): void;
    /**
     * Builds the FormControl for each and every control
     */
    buildScreenModeControls(): void;
    /**
     * Is the control a table control
     * @param id Id of the control
     * @returns
     */
    isTableControl(id: string): boolean;
    /**
     * Returns the FormControl of a control
     * @param guiRowid Id of the requested row
     * @param id Id of the control
     * @returns
     */
    getFormControl(guiRowid: string, id: string): AbstractControl;
    /**
     * handle the change of text for input control inside table
     * @param  guiRowId Id of the row for which the FormControls are built
     * set the new value of the formcontrol
     */
    setInputTextValue(controlId: string, guiRowid: string, val: any): void;
    /**
     * Build the FormControls for a table row
     * @param  guiRowId Id of the row for which the FormControls are built
     */
    buildTableRowControls(guiRowId: number): void;
    /**
     *
     * @ignore
     */
    updateRecordsBeforeCurrentView(value: number): void;
    /**
     * @ignore
     */
    setIncludesFirst(value: boolean): void;
    /**
     * @ignore
     */
    setIncludesLast(value: boolean): void;
    /**
     * @ignore
     */
    markRowAsCreated(guiRowId: number): void;
    /**
     * @ignore
     */
    markRowAsNotCreated(guiRowId: number): void;
    /**
     * @ignore
     */
    startRowEditing(guiRowId: number): void;
    /**
     * @ignore
     */
    stopRowEditing(guiRowId: number): void;
    /**
     * @ignore
     */
    isRowInRowEditing(guiRowId: string): boolean;
    /**
     * @ignore
     */
    setIsEmptyDataView(isEmpty: boolean): void;
    /**
     * Initialize the service to work with the task
     * @param taskId Id of the task
     * @param taskDescription
     */
    initTask(taskId: any, taskDescription: any): void;
    /**
     * @ignore
     */
    refreshView(): void;
    /**
     * Insert an event to the Magic WebClient event queue
     * @param guiEvent The event to insert
     */
    insertEvent(guiEvent: IGuiEvent): void;
    /**
     * @ignore
     */
    GetControlPictureMask(controlName: string): any;
    /**
     * Validates the control value, using the Magic WebClient
     * @param controlName Id of validated control
     * @param value value to be validated
     * @returns If validation fails, returns error message, else returns null
     */
    ValidateControlValue(controlName: string, value: any): string;
    /**
     * @ignore
     */
    GetRangedValue(controlName: string, value: string): string;
    /**
     * @ignore
     */
    GetFldRanges(controlName: string): string;
    /**
     * returns the value of a property of the control
     * @param controlId Id of control
     * @param prop Property
     * @param guiRowId Row Id, if applicable
     * @returns Property value
     */
    getProperty(controlId: string, prop: HtmlProperties, guiRowId?: string): any;
    /**
     * @ignore
     */
    getPropertyStub(ControlsProperties: any, controlId: any, prop: any): any;
    /**
     * @ignore
     */
    getStyleStub(ControlsProperties: any, controlId: any, styleName: string): any;
    /**
     * Return the CSS classes used for this control
     * @param controlId Id of control
     * @param guiRowId Row Id, if applicable
     * @returns String containing the classes currently defined for this control
     */
    getClasses(controlId: string, guiRowId?: string): string;
    /**
     * Return the value of a style used for a control
     * @param controlId Id of control
     * @param styleName Name of style
     * @param guiRowId Row Id, if applicable
     * @returns value of style of the control
     */
    getStyle(controlId: string, styleName: string, guiRowId?: string): string;
    /**
     * Return the value of a control
     * @param controlId Id of control
     * @param guiRowId Row Id, if applicable
     * @returns value of the control
     */
    getValue(controlId: string, guiRowId?: string): any;
    /**
     * Sets the value of a control
     * @param controlId Id of control
     * @param guiRowId Row Id, if applicable
     * @param value Value to set
     */
    setValue(controlId: string, guiRowId: string, value: any): void;
    /**
     * @ignore
     */
    protected executeInteractiveCommand(guiIntactiveCommand: GuiInteractive): void;
    /**
     * @ignore
     */
    handleSetProperty(command: GuiCommand, isTableChild: boolean): void;
    executeCommand(command: GuiCommand): void;
    /**
    custom validator
    */
    customValidator(rowid: string, id: string): ValidatorFn;
    /**
     * COnvert a value from Magic format to native format
     * @param controlId Id of control
     * @param  rowId Row Id, if applicable
     * @param val Value to convert
     * @returns Converted value
     */
    ConvertValToNative(controlId: string, rowId: number, val: any): any;
    /**
     * Convert a value from native to Magic format
     * @param controlId Id of control
     * @param  rowId Row Id, if applicable
     * @param val Value to convert
     * @returns Converted value
     */
    ConvertValFromNative(controlId: string, rowId: number, val: any): any;
    /**
     * Handle resize and also fetch chunk of records if having an empty view.
     * @ignore
     * @param pageSize : PageSize
     * @param topGuiRowId : GuiRowId of first record in view.
     */
    resize(pageSize: number, topGuiRowId: number): void;
    /**
     * Fetches data for new table rows when scrolling done
     */
    onScrollDown(): void;
    /**
     * Sets the new browser window title
     * @param newTitle New window title
     */
    setTitle(newTitle: string): void;
    /**
     * @ignore
     */
    getGuiRowId(dvRowId: number, isTableControl: boolean): number;
    /**
     *
     * @ignore
     */
    getDvRowId(guiRowId: number): number;
    /**
     * Clean up the service when it is no longer needed
     */
    dispose(): void;
    /**
     * Handle the Combobox "change" event
     * @param event  The event received from the UI
     * @param idx Id of the control raising the event
     * @param line Row Id, if applicable
     */
    onComboboxSelectionChanged(event: Event, idx: string, line: number): void;
    /**
     * Handle the Listbox "change" event
     * @param  event The event received from the UI
     * @param idx Id of the control raising the event
     */
    onListBoxSelectionChanged(event: Event, idx: string): void;
    /**
     * Handle the Checkbox "change" event
     * @param  event The event received from the UI
     * @param idx Id of the control raising the event
     * @param  rowId Row Id, if applicable
     */
    onCheckChanged(event: Event, idx: string, rowId: number): void;
    /**
     * Handle tab selection change, caused by UI events
     * @param idx Id of the control raising the event
     * @param  layer Id of selected tabpage
     */
    mgOnTabSelectionChanged(idx: string, layer: number): void;
    /**
     * Handle the Radio button "change" event
     * @param  event The event received from the UI
     * @param idx Id of the control raising the event
     */
    mgOnRadioSelectionChanged(event: Event, idx: string): void;
    /**
     * Inserts the "close" event to the magic WebClient event queue
     */
    close(): void;
    /**
     * @ignore
     */
    IsStub(): boolean;
    /**
     * @ignore
     */
    jsonData: string;
    /**
     * @ignore
     */
    saveData(data: string): void;
    /**
     * @ignore
     */
    createData(): void;
    /**
     * @ignore
     */
    loadStubData(stubData: any): void;
    /**
     * @ignore
     */
    loadData(): void;
    /**
     * @ignore
     */
    setStubValue(guiRowId: number, fc: FormControl, name: string): void;
}
