1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ACE_ENGINE_CJ_LAZYFOREACH_FUNC_H
17 #define ACE_ENGINE_CJ_LAZYFOREACH_FUNC_H
18 
19 #include <string>
20 
21 #include "base/utils/macros.h"
22 #include "ffi_remote_data.h"
23 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
24 
25 namespace OHOS {
26 namespace Ace {
27 namespace Framework {
28 
29 class CJDataChangeListener;
30 
31 class ACE_EXPORT LazyForEachFuncs : public FFI::RemoteData {
32     CJ_REMOTE_CLASS(LazyForEachFuncs)
33 
34 public :
35     std::string GenerateKey(int64_t index);
36     void GenerateItem(int64_t index);
37     int64_t GetTotalCount();
38     void RegisterListenerFunc(const sptr<CJDataChangeListener>& listener);
39     void UnRegisterListenerFunc(const sptr<CJDataChangeListener>& listener);
40     void MarkLazyForEachProcess(const std::string& key);
41     void ResetLazyForEachProcess();
42     void RemoveChildGroupById(const std::string& composedId);
43 };
44 
45 } // namespace Framework
46 } // namespace Ace
47 } // namespace OHOS
48 
49 #endif // ACE_ENGINE_CJ_LAZYFOREACH_H
50