/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @addtogroup HdfPinAuth
 * @{
 *
 * @brief Provides APIs for the pin auth driver.
 *
 * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver.
 * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors.
 * After obtaining the pin auth executors, the service can call related APIs to get executor information, get
 * template information, and enroll, authenticate, and delete templates, etc.
 *
 * @since 5.0
 * @version 1.0
 */

/**
 * @file ICollector.idl
 *
 * @brief Defines the APIs of the collectors. These APIs can be used to get executor information,
 * cancel, collect data, and send message, etc.
 *
 * @since 5.0
 * @version 1.0
 */

package ohos.hdi.pin_auth.v2_1;

import ohos.hdi.pin_auth.v2_1.PinAuthTypes;
import ohos.hdi.pin_auth.v2_1.IExecutorCallback;

/**
 * @brief Defines the APIs of the collectors. These APIs can be used to get executor information,
 * cancel, collect data, and send message, etc.
 *
 * @since 5.0
 * @version 1.0
 */

interface ICollector {
    /**
     * @brief Gets executor information.
     *
     * @param executorInfo Indicates executor information. See {@link ExecutorInfo}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.0
     */
    GetExecutorInfo([out] struct ExecutorInfo executorInfo);
    /**
     * @brief Sends parameters to the driver when executor registration is finished.
     *
     * @param templateIdList Indicates the templates previously registered to the user auth framework.
     * @param frameworkPublicKey Indicates the framework public key.
     * @param extraInfo Indicates the extra information that is sent to the executors.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     */
    OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo);
    /**
     * @brief Cancels an operation.
     *
     * @param scheduleId Indicates the schedule ID of the operation to cancel.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.0
     */
    Cancel([in] unsigned long scheduleId);
    /**
     * @brief Send message.
     *
     * @param scheduleId Indicates the schedule ID of the message.
     * @param srcRole is the role of source.
     * @param msg is the message content.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.0
     */
    SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg);
    /**
     * @brief Sets pin data.
     *
     * @param scheduleId Indicates the schedule ID of enrollment.
     * @param authSubType Indicates the pin sub type.
     * @param data Indicates the pin data.
     * @param resultCode Indicates the result code.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.0
     */
    SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data,
        [in] int resultCode);
    /**
     * @brief Collect template data.
     *
     * @param scheduleId Indicates the schedule ID of collection.
     * @param extraInfo Indicates the extra information of collection.
     * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.0
     */
    Collect([in] unsigned long scheduleId, [in] unsigned char[] extraInfo,
        [in] IExecutorCallback callbackObj);
}
/** @} */