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 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_grid_item_ffi.h" 17 18 #include "core/components_ng/pattern/grid/grid_item_model.h" 19 20 using namespace OHOS::Ace; 21 22 extern "C" { FfiOHOSAceFrameworkGridItemCreate()23void FfiOHOSAceFrameworkGridItemCreate() 24 { 25 NG::GridItemStyle style {}; 26 GridItemModel::GetInstance()->Create(style); 27 } 28 FfiOHOSAceFrameworkGridItemSetColumnStart(int32_t columnStart)29void FfiOHOSAceFrameworkGridItemSetColumnStart(int32_t columnStart) 30 { 31 GridItemModel::GetInstance()->SetColumnStart(columnStart); 32 } 33 FfiOHOSAceFrameworkGridItemSetColumnEnd(int32_t columnEnd)34void FfiOHOSAceFrameworkGridItemSetColumnEnd(int32_t columnEnd) 35 { 36 GridItemModel::GetInstance()->SetColumnEnd(columnEnd); 37 } 38 FfiOHOSAceFrameworkGridItemSetRowStart(int32_t rowStart)39void FfiOHOSAceFrameworkGridItemSetRowStart(int32_t rowStart) 40 { 41 GridItemModel::GetInstance()->SetRowStart(rowStart); 42 } 43 FfiOHOSAceFrameworkGridItemSetRowEnd(int32_t rowEnd)44void FfiOHOSAceFrameworkGridItemSetRowEnd(int32_t rowEnd) 45 { 46 GridItemModel::GetInstance()->SetRowEnd(rowEnd); 47 } 48 FfiOHOSAceFrameworkGridItemForceRebuild(bool forceRebuild)49void FfiOHOSAceFrameworkGridItemForceRebuild(bool forceRebuild) 50 { 51 GridItemModel::GetInstance()->SetForceRebuild(forceRebuild); 52 } 53 } 54