125c1cde8Sopenharmony_ci/*
225c1cde8Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd.
325c1cde8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
425c1cde8Sopenharmony_ci * you may not use this file except in compliance with the License.
525c1cde8Sopenharmony_ci * You may obtain a copy of the License at
625c1cde8Sopenharmony_ci *
725c1cde8Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
825c1cde8Sopenharmony_ci *
925c1cde8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1025c1cde8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1125c1cde8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1225c1cde8Sopenharmony_ci * See the License for the specific language governing permissions and
1325c1cde8Sopenharmony_ci * limitations under the License.
1425c1cde8Sopenharmony_ci */
1525c1cde8Sopenharmony_ci
1625c1cde8Sopenharmony_ci#ifndef DATA_STORAGE_RDB_SIM_CALLBACK_H
1725c1cde8Sopenharmony_ci#define DATA_STORAGE_RDB_SIM_CALLBACK_H
1825c1cde8Sopenharmony_ci
1925c1cde8Sopenharmony_ci#include "iosfwd"
2025c1cde8Sopenharmony_ci#include "rdb_base_callback.h"
2125c1cde8Sopenharmony_ci#include "vector"
2225c1cde8Sopenharmony_ci
2325c1cde8Sopenharmony_cinamespace OHOS {
2425c1cde8Sopenharmony_cinamespace NativeRdb {
2525c1cde8Sopenharmony_ciclass RdbStore;
2625c1cde8Sopenharmony_ci}
2725c1cde8Sopenharmony_cinamespace Telephony {
2825c1cde8Sopenharmony_ciclass RdbSimCallback : public RdbBaseCallBack {
2925c1cde8Sopenharmony_cipublic:
3025c1cde8Sopenharmony_ci    RdbSimCallback(const std::vector<std::string> &createTableVec) : RdbBaseCallBack(createTableVec) {}
3125c1cde8Sopenharmony_ci    ~RdbSimCallback() = default;
3225c1cde8Sopenharmony_ci
3325c1cde8Sopenharmony_ci    int OnUpgrade(NativeRdb::RdbStore &rdbStore, int oldVersion, int newVersion) override;
3425c1cde8Sopenharmony_ci    int OnDowngrade(NativeRdb::RdbStore &rdbStore, int currentVersion, int targetVersion) override;
3525c1cde8Sopenharmony_ci    int OnOpen(NativeRdb::RdbStore &rdbStore) override;
3625c1cde8Sopenharmony_ci
3725c1cde8Sopenharmony_ciprivate:
3825c1cde8Sopenharmony_ci    const int VERSION_2 = 2;
3925c1cde8Sopenharmony_ci    const int VERSION_3 = 3;
4025c1cde8Sopenharmony_ci};
4125c1cde8Sopenharmony_ci} // namespace Telephony
4225c1cde8Sopenharmony_ci} // namespace OHOS
4325c1cde8Sopenharmony_ci#endif // DATA_STORAGE_RDB_SIM_CALLBACK_H
44