Skip to main content

qtbridge_interfaces/qtable_model/
proxy_cpp_bridge.rs

1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only
3
4use qtbridge_runtime::qproxies::QCppProxy;
5use qtbridge_runtime::DynamicMetaObjectData;
6use qtbridge_type_lib::QMetaObject;
7use crate::impl_qcpp_proxy;
8
9use super::proxy_rust::QTableModelProxyRust;
10#[cxx::bridge]
11pub mod ffi {
12    unsafe extern "C++" {
13        include!("qtbridge-type-lib/src/core/qhash/cpp/qhash_i32_qbytearray.h");
14        type QHash_i32_QByteArray = qtbridge_type_lib::QHash_i32_QByteArray;
15        include!("qtbridge-type-lib/src/core/qmetaobject/cpp/qmetaobject.h");
16        type QMetaObject = qtbridge_type_lib::QMetaObject;
17        include!("qtbridge-type-lib/src/core/qmetatype/cpp/qmetatype.h");
18        type QMetaType = qtbridge_type_lib::QMetaType;
19        include!("qtbridge-runtime/src/cpp/dynamicmetaobjectdata.h");
20        type DynamicMetaObjectData = qtbridge_runtime::DynamicMetaObjectData;
21        include!("qtbridge-type-lib/src/core/qmodelindex/cpp/qmodelindex.h");
22        type QModelIndex = qtbridge_type_lib::QModelIndex;
23        include!("qtbridge-type-lib/src/core/qvariant/cpp/qvariant.h");
24        type QVariant = qtbridge_type_lib::QVariant;
25        include!("qtbridge-interfaces/src/qtable_model/proxy_rust_bridge.rs.h");
26        type QTableModelProxyRust = super::QTableModelProxyRust;
27    }
28    #[allow(clippy::missing_safety_doc)]
29    #[namespace = "rust::bridge"]
30    unsafe extern "C++" {
31        include!("qtbridge-interfaces/src/qtable_model/cpp/QTableModelProxyCpp.h");
32        type QTableModelProxyCpp;
33        # [Self = QTableModelProxyCpp]
34        # [rust_name = create]
35        unsafe fn create(rust_proxy: *mut QTableModelProxyRust, metaobject: *const DynamicMetaObjectData) -> *mut QTableModelProxyCpp;
36        # [Self = QTableModelProxyCpp]
37        # [rust_name = create_at]
38        unsafe fn createAt(rust_proxy: *mut QTableModelProxyRust, metaobject: *const DynamicMetaObjectData, addr: *mut u8) -> *mut QTableModelProxyCpp;
39        # [Self = QTableModelProxyCpp]
40        # [rust_name = static_qmeta_object]
41        fn baseStaticMetaObject() -> &'static QMetaObject;
42        # [Self = QTableModelProxyCpp]
43        # [rust_name = size_of]
44        fn sizeOfProxy() -> usize;
45        # [Self = QTableModelProxyCpp]
46        # [rust_name = align_of]
47        fn alignOfProxy() -> usize;
48        # [Self = QTableModelProxyCpp]
49        # [rust_name = parser_status_cast]
50        fn parserStatusCast() -> i32;
51        # [rust_name = emit_signal_cpp]
52        fn emitSignal(self: Pin<&mut Self>, signal_name: &str, argv: &[*const u8]);
53        # [rust_name = base_role_names]
54        fn base_roleNames(&self) -> QHash_i32_QByteArray;
55        # [rust_name = base_set_data]
56        fn base_setData(self: Pin<&mut Self>, index: &QModelIndex, value: &QVariant, role: i32) -> bool;
57        # [rust_name = base_remove_columns]
58        fn base_removeColumns(self: Pin<&mut Self>, first: i32, count: i32, parent: &QModelIndex) -> bool;
59        # [rust_name = base_remove_rows]
60        fn base_removeRows(self: Pin<&mut Self>, first: i32, count: i32, parent: &QModelIndex) -> bool;
61        # [rust_name = base_sibling]
62        fn base_sibling(&self, row: i32, column: i32, idx: &QModelIndex) -> QModelIndex;
63        # [rust_name = base_data_changed]
64        fn dataChanged(self: Pin<&mut Self>, top_left: &QModelIndex, bottom_right: &QModelIndex);
65        # [rust_name = base_begin_insert_columns]
66        fn beginInsertColumns(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
67        # [rust_name = base_end_insert_columns]
68        fn endInsertColumns(self: Pin<&mut Self>);
69        # [rust_name = base_begin_insert_rows]
70        fn beginInsertRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
71        # [rust_name = base_end_insert_rows]
72        fn endInsertRows(self: Pin<&mut Self>);
73        # [rust_name = base_begin_move_columns]
74        fn beginMoveColumns(
75            self: Pin<&mut Self>,
76            source_parent: &QModelIndex,
77            source_first: i32,
78            source_last: i32,
79            destination_parent: &QModelIndex,
80            destination_child: i32,
81        );
82        # [rust_name = base_end_move_columns]
83        fn endMoveColumns(self: Pin<&mut Self>);
84        # [rust_name = base_begin_move_rows]
85        fn beginMoveRows(
86            self: Pin<&mut Self>,
87            source_parent: &QModelIndex,
88            source_first: i32,
89            source_last: i32,
90            destination_parent: &QModelIndex,
91            destination_child: i32,
92        );
93        # [rust_name = base_end_move_rows]
94        fn endMoveRows(self: Pin<&mut Self>);
95        # [rust_name = base_begin_remove_columns]
96        fn beginRemoveColumns(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
97        # [rust_name = base_end_remove_columns]
98        fn endRemoveColumns(self: Pin<&mut Self>);
99        # [rust_name = base_begin_remove_rows]
100        fn beginRemoveRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
101        # [rust_name = base_end_remove_rows]
102        fn endRemoveRows(self: Pin<&mut Self>);
103        # [rust_name = base_begin_reset_model]
104        fn beginResetModel(self: Pin<&mut Self>);
105        # [rust_name = base_end_reset_model]
106        fn endResetModel(self: Pin<&mut Self>);
107        # [rust_name = base_create_index]
108        fn createIndex(&self, row: i32, column: i32, ptr: usize) -> QModelIndex;
109    }
110}
111pub use ffi::QTableModelProxyCpp;
112
113impl_qcpp_proxy!(QTableModelProxyCpp, QTableModelProxyRust);