1c2b37d2cSopenharmony_ci/*
2c2b37d2cSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3c2b37d2cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c2b37d2cSopenharmony_ci * you may not use this file except in compliance with the License.
5c2b37d2cSopenharmony_ci * You may obtain a copy of the License at
6c2b37d2cSopenharmony_ci *
7c2b37d2cSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c2b37d2cSopenharmony_ci *
9c2b37d2cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c2b37d2cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c2b37d2cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c2b37d2cSopenharmony_ci * See the License for the specific language governing permissions and
13c2b37d2cSopenharmony_ci * limitations under the License.
14c2b37d2cSopenharmony_ci */
15c2b37d2cSopenharmony_ci
16c2b37d2cSopenharmony_ci#ifndef BASE_ACCOUNT_IACCOUNT_H
17c2b37d2cSopenharmony_ci#define BASE_ACCOUNT_IACCOUNT_H
18c2b37d2cSopenharmony_ci
19c2b37d2cSopenharmony_ci#include <cstdint>
20c2b37d2cSopenharmony_ci#include <string>
21c2b37d2cSopenharmony_ci#include <iremote_broker.h>
22c2b37d2cSopenharmony_ci#include "accountmgr_service_ipc_interface_code.h"
23c2b37d2cSopenharmony_ci#include "account_info.h"
24c2b37d2cSopenharmony_ci#include "device_account_info.h"
25c2b37d2cSopenharmony_ci#include "distributed_account_subscribe_callback.h"
26c2b37d2cSopenharmony_ci
27c2b37d2cSopenharmony_cinamespace OHOS {
28c2b37d2cSopenharmony_cinamespace AccountSA {
29c2b37d2cSopenharmony_ciconst char ACCOUNT_SERVICE_NAME[] = "AccountService";
30c2b37d2cSopenharmony_ci
31c2b37d2cSopenharmony_ciclass IAccount : public IRemoteBroker {
32c2b37d2cSopenharmony_cipublic:
33c2b37d2cSopenharmony_ci    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.accountfwk.IAccount");
34c2b37d2cSopenharmony_ci
35c2b37d2cSopenharmony_ci    virtual bool UpdateOhosAccountInfo(
36c2b37d2cSopenharmony_ci        const std::string &accountName, const std::string &uid, const std::string &eventStr) = 0;
37c2b37d2cSopenharmony_ci    virtual std::int32_t SetOhosAccountInfo(const OhosAccountInfo &ohosAccountInfo,
38c2b37d2cSopenharmony_ci        const std::string &eventStr) = 0;
39c2b37d2cSopenharmony_ci    virtual std::int32_t SetOhosAccountInfoByUserId(
40c2b37d2cSopenharmony_ci        const int32_t userId, const OhosAccountInfo &ohosAccountInfo, const std::string &eventStr) = 0;
41c2b37d2cSopenharmony_ci    virtual ErrCode QueryOhosAccountInfo(OhosAccountInfo &accountInfo) = 0;
42c2b37d2cSopenharmony_ci    virtual ErrCode QueryOhosAccountInfoByUserId(std::int32_t userId, OhosAccountInfo &info) = 0;
43c2b37d2cSopenharmony_ci    virtual ErrCode GetOhosAccountInfo(OhosAccountInfo &accountInfo) = 0;
44c2b37d2cSopenharmony_ci    virtual ErrCode GetOhosAccountInfoByUserId(int32_t userId, OhosAccountInfo &info) = 0;
45c2b37d2cSopenharmony_ci    virtual std::int32_t QueryDeviceAccountId(std::int32_t &accountId) = 0;
46c2b37d2cSopenharmony_ci    virtual ErrCode SubscribeDistributedAccountEvent(const DISTRIBUTED_ACCOUNT_SUBSCRIBE_TYPE type,
47c2b37d2cSopenharmony_ci        const sptr<IRemoteObject> &eventListener) = 0;
48c2b37d2cSopenharmony_ci    virtual ErrCode UnsubscribeDistributedAccountEvent(const DISTRIBUTED_ACCOUNT_SUBSCRIBE_TYPE type,
49c2b37d2cSopenharmony_ci        const sptr<IRemoteObject> &eventListener) = 0;
50c2b37d2cSopenharmony_ci    virtual sptr<IRemoteObject> GetAppAccountService() = 0;
51c2b37d2cSopenharmony_ci    virtual sptr<IRemoteObject> GetOsAccountService() = 0;
52c2b37d2cSopenharmony_ci    virtual sptr<IRemoteObject> GetAccountIAMService() = 0;
53c2b37d2cSopenharmony_ci    virtual sptr<IRemoteObject> GetDomainAccountService() = 0;
54c2b37d2cSopenharmony_ci};
55c2b37d2cSopenharmony_ci}  // namespace AccountSA
56c2b37d2cSopenharmony_ci}  // namespace OHOS
57c2b37d2cSopenharmony_ci
58c2b37d2cSopenharmony_ci#endif  // BASE_ACCOUNT_IACCOUNT_H
59