10fbfc30aSopenharmony_ci/*
20fbfc30aSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
30fbfc30aSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
40fbfc30aSopenharmony_ci * you may not use this file except in compliance with the License.
50fbfc30aSopenharmony_ci * You may obtain a copy of the License at
60fbfc30aSopenharmony_ci *
70fbfc30aSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
80fbfc30aSopenharmony_ci *
90fbfc30aSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
100fbfc30aSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
110fbfc30aSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120fbfc30aSopenharmony_ci * See the License for the specific language governing permissions and
130fbfc30aSopenharmony_ci * limitations under the License.
140fbfc30aSopenharmony_ci */
150fbfc30aSopenharmony_ci
160fbfc30aSopenharmony_ci#ifndef CALENDAR_MANAGER_NAPI_H
170fbfc30aSopenharmony_ci#define CALENDAR_MANAGER_NAPI_H
180fbfc30aSopenharmony_ci
190fbfc30aSopenharmony_ci#include <vector>
200fbfc30aSopenharmony_ci
210fbfc30aSopenharmony_ci#include "napi/native_api.h"
220fbfc30aSopenharmony_ci#include "napi/native_common.h"
230fbfc30aSopenharmony_ci#include "napi/native_node_api.h"
240fbfc30aSopenharmony_ci
250fbfc30aSopenharmony_ci#include "calendar_log.h"
260fbfc30aSopenharmony_ci#include "napi_util.h"
270fbfc30aSopenharmony_ci#include "napi_queue.h"
280fbfc30aSopenharmony_ci#include "calendar_napi.h"
290fbfc30aSopenharmony_ci#include "native_calendar_manager.h"
300fbfc30aSopenharmony_ci#include "napi_env.h"
310fbfc30aSopenharmony_ci#include "abs_shared_result_set.h"
320fbfc30aSopenharmony_ci#include "data_ability_helper.h"
330fbfc30aSopenharmony_ci#include "data_ability_predicates.h"
340fbfc30aSopenharmony_ci#include "values_bucket.h"
350fbfc30aSopenharmony_ci
360fbfc30aSopenharmony_ci#include <ui_content.h>
370fbfc30aSopenharmony_ci#include "napi_base_context.h"
380fbfc30aSopenharmony_cinamespace OHOS::CalendarApi {
390fbfc30aSopenharmony_ciclass CalendarManagerNapi {
400fbfc30aSopenharmony_cipublic:
410fbfc30aSopenharmony_ci    struct EditEventContext : public ContextBase {
420fbfc30aSopenharmony_ci        string event;
430fbfc30aSopenharmony_ci        napi_value _jsContext;
440fbfc30aSopenharmony_ci        string caller;
450fbfc30aSopenharmony_ci        int32_t _sessionId;
460fbfc30aSopenharmony_ci        Ace::UIContent *_uiContent = nullptr;
470fbfc30aSopenharmony_ci        napi_value id;
480fbfc30aSopenharmony_ci    };
490fbfc30aSopenharmony_ci
500fbfc30aSopenharmony_ci    static napi_value New(napi_env env, napi_callback_info info);
510fbfc30aSopenharmony_ci    static napi_value CreateCalendar(napi_env env, napi_callback_info info);
520fbfc30aSopenharmony_ci    static napi_value DeleteCalendar(napi_env env, napi_callback_info info);
530fbfc30aSopenharmony_ci    static napi_value GetCalendar(napi_env env, napi_callback_info info);
540fbfc30aSopenharmony_ci    static napi_value GetAllCalendars(napi_env env, napi_callback_info info);
550fbfc30aSopenharmony_ci    static napi_value EditEvent(napi_env env, napi_callback_info info);
560fbfc30aSopenharmony_ci    static napi_value Init(napi_env env, napi_value exports);
570fbfc30aSopenharmony_ciprivate:
580fbfc30aSopenharmony_ci    static napi_value LaunchEditorPage(napi_env env, std::shared_ptr<EditEventContext> ctxt);
590fbfc30aSopenharmony_ci};
600fbfc30aSopenharmony_ci
610fbfc30aSopenharmony_cinapi_value GetCalendarManager(napi_env env, napi_callback_info info);
620fbfc30aSopenharmony_ci
630fbfc30aSopenharmony_ci}  // namespace Calendar::CalendarApi
640fbfc30aSopenharmony_ci#endif  //  CALENDAR_MANAGER_NAPI_H
65