import { IgxSeriesComponent } from "./igx-series-component";
import { ensureBool, fromPoint, toPoint } from "igniteui-angular-core";
/**
 * Provides data for IgxDataChartComponent mouse button related events.
*
* `DataChartMouseButtonEventHandler` class represents the method that will handle IgxDataChartComponent mouse button related events.
*
* ```html
*  <igx-data-chart  #chart
*       [dataSource]="data"
* 	  (seriesMouseLeftButtonDown)="chart_seriesMouseLeftButtonDown()">
*       <igx-category-x-axis
*         label="label"
*         #xAxis
*         >
*       </igx-category-x-axis>
*       <igx-numeric-y-axis
*         minimumValue="0"
*         #yAxis>
*       </igx-numeric-y-axis>
*
*       <igx-column-series
*         [xAxis]="xAxis"
*         [yAxis]="yAxis"
*         valueMemberPath="value">
*       </igx-column-series>
*     </igx-data-chart>
* ```
*
* ```ts
* this.chart.seriesMouseLeftButtonDown.subscribe(this.chart_seriesMouseLeftButtonDown);
* chart_seriesMouseLeftButtonDown(sender :any,args: DataChartMouseButtonEventArgs )
*   {
*   }
* ```
*/
export class IgxDataChartMouseButtonEventArgs {
    constructor() {
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * Gets or sets a value that indicates the present state of the event handling for a routed
     * event as it travels the route.
     * ChartMouseButton events are not routed events; setting this property effects the underlying
     * MouseButtonEvent.
    *
    * Use the `handled` property to indicates the present state of the event handling for a routed event.
    */
    get handled() {
        return this.i.handled;
    }
    set handled(v) {
        this.i.handled = ensureBool(v);
    }
    /**
     * Gets or sets whether to cancel series selection.
    */
    get cancelSelection() {
        return this.i.cancelSelection;
    }
    set cancelSelection(v) {
        this.i.cancelSelection = ensureBool(v);
    }
    /**
     * Gets a reference to the object that raised the event.
    *
    * Use the `OriginalSource` property for the raised object event.
    *
    * ```ts
    * args.originalSource;
    * ```
    */
    get originalSource() {
        return this.i.originalSource;
    }
    /**
     * Gets the ItemsSource item associated with the current event.
    *
    * Use the `Item` property to get the ItemsSource item associated with the current event.
    *
    * ```ts
    * var item1= args.item;
    * ```
    */
    get item() {
        return this.i.item;
    }
    set item(v) {
        this.i.item = v;
    }
    /**
     * Gets the series associated with the current event.
    *
    * Use the `Series` property for the associated current event.
    *
    * ```ts
    *  var DataSeries= args.series;
    * ```
    */
    get series() {
        const r = this.i.series;
        if (r == null) {
            return null;
        }
        if (!r.externalObject) {
            let e = IgxSeriesComponent._createFromInternal(r);
            if (e) {
                e._implementation = r;
            }
            r.externalObject = e;
        }
        return r.externalObject;
    }
    set series(v) {
        v == null ? this.i.series = null : this.i.series = v.i;
    }
    /**
     * Gets the mouse position relative to the plot area.
    */
    get plotAreaPosition() {
        return fromPoint(this.i.plotAreaPosition);
    }
    set plotAreaPosition(v) {
        this.i.plotAreaPosition = toPoint(v);
    }
    /**
     * Gets the mouse position relative to the chart.
    */
    get chartPosition() {
        return fromPoint(this.i.chartPosition);
    }
    /**
     * Gets the Chart associated with the current event.
    *
    * Use the `Chart` property to get the chart associated with the current event.
    *
    * ```ts
    * var dataChart=  args.chart;
    * ```
    */
    get chart() {
        const r = this.i.chart;
        if (r == null) {
            return null;
        }
        return r.externalObject;
    }
    set chart(v) {
        v == null ? this.i.chart = null : this.i.chart = v.i;
    }
    /**
     * Provides a human readable description of the mouse button event.
    
    *
    * Use the `ToString` property to provides a human readable discription.
    *
    * ```ts
    *   var item= args.item.label.toString();
    * ```
    */
    toString() {
        let iv = this.i.toString();
        return (iv);
    }
    /**
     * Returns the x- and y- coordinates of the mouse pointer position, optionally evaluated
     * against the origin of a supplied UIElement.
    
    * @param relativeTo  * Any UIElement derived object that is contained by the the engine plug-in
     * and connected to the object tree. To specify the object relative to the overall the engine
     * coordinate system, use a relativeTo value of null.
    *
    * To get mouse X and Y position.
    *
    * ```ts
    *    var args.getPosition;
    * ```
    */
    getPosition(relativeTo) {
        let iv = this.i.getPosition(relativeTo);
        return fromPoint(iv);
    }
}
