001package com.gigya.android.sdk;
002
003import android.support.annotation.NonNull;
004
005import com.gigya.android.sdk.ui.plugin.GigyaPluginEvent;
006
007/**
008 * Plugin specific event callback.
009 *
010 * @param <A> Custom account type provided int the Gigya interface initialization. If non specified will use basic GigyaAccount type.
011 */
012public abstract class GigyaPluginCallback<A> {
013
014    /* Called when an error occurs. */
015    public void onError(GigyaPluginEvent event) {
016        // Stub.
017    }
018
019    /* Called on user cancel initiated. */
020    public void onCanceled() {
021        // Stub.
022    }
023
024    /* Called before validation of the form. */
025    public void onBeforeValidation(@NonNull GigyaPluginEvent event) {
026        // Stub.
027    }
028
029    /* Called after validation of the form. */
030    public void onAfterValidation(@NonNull GigyaPluginEvent event) {
031        // Stub.
032    }
033
034    /*
035    Called before a form is submitted. This event gives you an opportunity to perform certain actions before
036    the form is submitted, or cancel the submission by returning false.
037    */
038    public void onBeforeSubmit(@NonNull GigyaPluginEvent event) {
039        // Stub.
040    }
041
042    /*
043    Called when a form is submitted, can return a value or a promise. This event gives you an opportunity
044    to modify the form data when it is submitted.
045    */
046    public void onSubmit(@NonNull GigyaPluginEvent event) {
047        // Stub.
048    }
049
050    /* Called after a form is submitted. */
051    public void onAfterSubmit(@NonNull GigyaPluginEvent event) {
052        // Stub.
053    }
054
055    /*
056    Called before a new screen is rendered. This event gives you an opportunity to
057    cancel the navigation by returning false.
058    */
059    public void onBeforeScreenLoad(@NonNull GigyaPluginEvent event) {
060        // Stub.
061    }
062
063    /* Called after a new screen is rendered. */
064    public void onAfterScreenLoad(@NonNull GigyaPluginEvent event) {
065        // Stub.
066    }
067
068    /* Called when a field is changed in a managed form. */
069    public void onFieldChanged(@NonNull GigyaPluginEvent event) {
070        // Stub.
071    }
072
073    /* Called when a user clicks the "X" (close) button or the screen is hidden following the end of the flow. */
074    public void onHide(@NonNull GigyaPluginEvent event, @GigyaDefinitions.Plugin.PluginReason String reason) {
075        // Stub.
076    }
077
078    /* Called when an updated account instance is available during the flow. */
079    public void onLogin(@NonNull A accountObj) {
080        // Stub.
081    }
082
083    /* Called when a after a logout action occurs. */
084    public void onLogout() {
085        // Stub.
086    }
087
088    /* Called when a new connection is successfully added to the account. */
089    public void onConnectionAdded() {
090        // Stub.
091    }
092
093    /* Called when an existing connection is removed from the account., */
094    public void onConnectionRemoved() {
095        // Stub.
096    }
097
098}