Skip to main content

qtbridge_interfaces/qabstract_item_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::QAbstractItemModelProxyRust;
10#[cxx::bridge]
11pub mod ffi {
12    unsafe extern "C++" {
13        include!("qtbridge-type-lib/src/generated/core/qhash/cpp/qhash_i32_qbytearray.h");
14        type QHash_i32_QByteArray = qtbridge_type_lib::QHash_i32_QByteArray;
15        include!("qtbridge-type-lib/src/generated/core/qmetaobject/cpp/qmetaobject.h");
16        type QMetaObject = qtbridge_type_lib::QMetaObject;
17        include!("qtbridge-type-lib/src/generated/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/generated/core/qmodelindex/cpp/qmodelindex.h");
22        type QModelIndex = qtbridge_type_lib::QModelIndex;
23        include!("qtbridge-type-lib/src/generated/core/qvariant/cpp/qvariant.h");
24        type QVariant = qtbridge_type_lib::QVariant;
25        include!("qtbridge-interfaces/src/qabstract_item_model/proxy_rust_bridge.rs.h");
26        type QAbstractItemModelProxyRust = super::QAbstractItemModelProxyRust;
27    }
28    #[namespace = "rust::bridge"]
29    unsafe extern "C++" {
30        include!("qtbridge-interfaces/src/qabstract_item_model/cpp/QAbstractItemModelProxyCpp.h");
31        type QAbstractItemModelProxyCpp;
32        # [Self = QAbstractItemModelProxyCpp]
33        # [rust_name = create]
34        unsafe fn create(rust_proxy: *mut QAbstractItemModelProxyRust, metaobject: *const DynamicMetaObjectData) -> *mut QAbstractItemModelProxyCpp;
35        # [Self = QAbstractItemModelProxyCpp]
36        # [rust_name = create_at]
37        unsafe fn createAt(rust_proxy: *mut QAbstractItemModelProxyRust, metaobject: *const DynamicMetaObjectData, addr: *mut u8)
38        -> *mut QAbstractItemModelProxyCpp;
39        # [Self = QAbstractItemModelProxyCpp]
40        # [rust_name = static_qmeta_object]
41        fn baseStaticMetaObject() -> &'static QMetaObject;
42        # [Self = QAbstractItemModelProxyCpp]
43        # [rust_name = size_of]
44        fn sizeOfProxy() -> usize;
45        # [Self = QAbstractItemModelProxyCpp]
46        # [rust_name = align_of]
47        fn alignOfProxy() -> usize;
48        # [Self = QAbstractItemModelProxyCpp]
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_rows]
58        fn base_removeRows(self: Pin<&mut Self>, first: i32, count: i32, parent: &QModelIndex) -> bool;
59        # [rust_name = base_sibling]
60        fn base_sibling(&self, row: i32, column: i32, idx: &QModelIndex) -> QModelIndex;
61        # [rust_name = base_data_changed]
62        fn dataChanged(self: Pin<&mut Self>, top_left: &QModelIndex, bottom_right: &QModelIndex);
63        # [rust_name = base_begin_insert_columns]
64        fn beginInsertColumns(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
65        # [rust_name = base_end_insert_columns]
66        fn endInsertColumns(self: Pin<&mut Self>);
67        # [rust_name = base_begin_insert_rows]
68        fn beginInsertRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
69        # [rust_name = base_end_insert_rows]
70        fn endInsertRows(self: Pin<&mut Self>);
71        # [rust_name = base_begin_move_columns]
72        fn beginMoveColumns(
73            self: Pin<&mut Self>,
74            source_parent: &QModelIndex,
75            source_first: i32,
76            source_last: i32,
77            destination_parent: &QModelIndex,
78            destination_child: i32,
79        );
80        # [rust_name = base_end_move_columns]
81        fn endMoveColumns(self: Pin<&mut Self>);
82        # [rust_name = base_begin_move_rows]
83        fn beginMoveRows(
84            self: Pin<&mut Self>,
85            source_parent: &QModelIndex,
86            source_first: i32,
87            source_last: i32,
88            destination_parent: &QModelIndex,
89            destination_child: i32,
90        );
91        # [rust_name = base_end_move_rows]
92        fn endMoveRows(self: Pin<&mut Self>);
93        # [rust_name = base_begin_remove_columns]
94        fn beginRemoveColumns(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
95        # [rust_name = base_end_remove_columns]
96        fn endRemoveColumns(self: Pin<&mut Self>);
97        # [rust_name = base_begin_remove_rows]
98        fn beginRemoveRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
99        # [rust_name = base_end_remove_rows]
100        fn endRemoveRows(self: Pin<&mut Self>);
101        # [rust_name = base_begin_reset_model]
102        fn beginResetModel(self: Pin<&mut Self>);
103        # [rust_name = base_end_reset_model]
104        fn endResetModel(self: Pin<&mut Self>);
105        # [rust_name = base_create_index]
106        fn createIndex(&self, row: i32, column: i32, ptr: usize) -> QModelIndex;
107    }
108}
109
110pub use ffi::QAbstractItemModelProxyCpp;
111
112impl_qcpp_proxy!(ffi::QAbstractItemModelProxyCpp, QAbstractItemModelProxyRust);