/*
 * Copyright (c) 2025 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.
 */

import UserAuthTypes;
import IGetExecutorPropertyCallback;
import ISetExecutorPropertyCallback;
import IIamCallback;
import IWidgetCallback;
import IVerifyTokenCallback;
import IModalCallback;
import IEventListenerCallback;
import IRemoteAuthCallback;

option_stub_hooks on;

interface OHOS.UserIam.UserAuth.IUserAuth {
    int GetAvailableStatus([in] int apiVersion, [in] int userId, [in] int authType,
        [in] unsigned int authTrustLevel);

    int GetAvailableStatus([in] int apiVersion, [in] int authType, [in] unsigned int authTrustLevel);

    void GetProperty([in] int userId, [in] int authType,
        [in] unsigned int[] keys, [in] IGetExecutorPropertyCallback getExecutorPropertyCallback);

    void GetPropertyById([in] unsigned long credentialId, [in] unsigned int[] keys,
        [in] IGetExecutorPropertyCallback getExecutorPropertyCallback);

    void SetProperty([in] int userId, [in] int authType, [in] unsigned char[] attributes,
        [in] ISetExecutorPropertyCallback setExecutorPropertyCallback);

    void AuthUser([in] IpcAuthParamInner ipcAuthParamInner, [in] IpcRemoteAuthParam ipcRemoteAuthParam,
        [in] IIamCallback userAuthCallback, [out] unsigned long contextId);

    void Auth([in] int apiVersion, [in] IpcAuthParamInner ipcAuthParamInner, 
        [in] IIamCallback userAuthCallback, [out] unsigned long contextId);

    void AuthWidget([in] int apiVersion, [in] IpcAuthParamInner ipcAuthParamInner,
        [in] IpcWidgetParamInner ipcWidgetParamInner, [in] IIamCallback userAuthCallback,
        [in] IModalCallback modalCallback, [out] unsigned long contextId);

    void Identify([in] unsigned char[] challenge, [in] int authType,
        [in] IIamCallback userAuthCallback, [out] unsigned long contextId);

    void CancelAuthOrIdentify([in] unsigned long contextId, [in] int cancelReason);

    void GetVersion([out] int version);

    void Notice([in] int noticeType, [in] String eventData);

    void RegisterWidgetCallback([in] int version, [in] IWidgetCallback widgetCallback);

    int GetEnrolledState([in] int apiVersion, [in] int authType, [out] IpcEnrolledState ipcEnrolledState);

    void RegistUserAuthSuccessEventListener([in] IEventListenerCallback listener);

    void UnRegistUserAuthSuccessEventListener([in] IEventListenerCallback listener);

    void SetGlobalConfigParam([in] IpcGlobalConfigParam ipcGlobalConfigParam);

    void PrepareRemoteAuth([in] String networkId, [in] IIamCallback userAuthCallback);

    void VerifyAuthToken([in] unsigned char[] tokenIn, [in] unsigned long allowableDuration,
        [in] IVerifyTokenCallback verifyTokenCallback);

    void QueryReusableAuthResult([in] IpcAuthParamInner ipcAuthParamInner, [out] unsigned char[] token);
    void GetAuthLockState([in] int authType, [in] IGetExecutorPropertyCallback getExecutorPropertyCallback);

    void RegisterRemoteAuthCallback([in] IRemoteAuthCallback remoteAuthCallback);
    void UnregisterRemoteAuthCallback();
}