1 //******************************************************************************
2 // Copyright (c) 2005-2013 by Jan Van hijfte
3 //
4 // See the included file COPYING.TXT for details about the copyright.
5 //
6 // This program is distributed in the hope that it will be useful,
7 // but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 //******************************************************************************
10
11
12 #include "qabstractitemview_c.h"
13
QAbstractItemView_setModel(QAbstractItemViewH handle,QAbstractItemModelH model)14 void QAbstractItemView_setModel(QAbstractItemViewH handle, QAbstractItemModelH model)
15 {
16 ((QAbstractItemView *)handle)->setModel((QAbstractItemModel*)model);
17 }
18
QAbstractItemView_model(QAbstractItemViewH handle)19 QAbstractItemModelH QAbstractItemView_model(QAbstractItemViewH handle)
20 {
21 return (QAbstractItemModelH) ((QAbstractItemView *)handle)->model();
22 }
23
QAbstractItemView_setSelectionModel(QAbstractItemViewH handle,QItemSelectionModelH selectionModel)24 void QAbstractItemView_setSelectionModel(QAbstractItemViewH handle, QItemSelectionModelH selectionModel)
25 {
26 ((QAbstractItemView *)handle)->setSelectionModel((QItemSelectionModel*)selectionModel);
27 }
28
QAbstractItemView_selectionModel(QAbstractItemViewH handle)29 QItemSelectionModelH QAbstractItemView_selectionModel(QAbstractItemViewH handle)
30 {
31 return (QItemSelectionModelH) ((QAbstractItemView *)handle)->selectionModel();
32 }
33
QAbstractItemView_setItemDelegate(QAbstractItemViewH handle,QAbstractItemDelegateH delegate)34 void QAbstractItemView_setItemDelegate(QAbstractItemViewH handle, QAbstractItemDelegateH delegate)
35 {
36 ((QAbstractItemView *)handle)->setItemDelegate((QAbstractItemDelegate*)delegate);
37 }
38
QAbstractItemView_itemDelegate(QAbstractItemViewH handle)39 QAbstractItemDelegateH QAbstractItemView_itemDelegate(QAbstractItemViewH handle)
40 {
41 return (QAbstractItemDelegateH) ((QAbstractItemView *)handle)->itemDelegate();
42 }
43
QAbstractItemView_setSelectionMode(QAbstractItemViewH handle,QAbstractItemView::SelectionMode mode)44 void QAbstractItemView_setSelectionMode(QAbstractItemViewH handle, QAbstractItemView::SelectionMode mode)
45 {
46 ((QAbstractItemView *)handle)->setSelectionMode(mode);
47 }
48
QAbstractItemView_selectionMode(QAbstractItemViewH handle)49 QAbstractItemView::SelectionMode QAbstractItemView_selectionMode(QAbstractItemViewH handle)
50 {
51 return (QAbstractItemView::SelectionMode) ((QAbstractItemView *)handle)->selectionMode();
52 }
53
QAbstractItemView_setSelectionBehavior(QAbstractItemViewH handle,QAbstractItemView::SelectionBehavior behavior)54 void QAbstractItemView_setSelectionBehavior(QAbstractItemViewH handle, QAbstractItemView::SelectionBehavior behavior)
55 {
56 ((QAbstractItemView *)handle)->setSelectionBehavior(behavior);
57 }
58
QAbstractItemView_selectionBehavior(QAbstractItemViewH handle)59 QAbstractItemView::SelectionBehavior QAbstractItemView_selectionBehavior(QAbstractItemViewH handle)
60 {
61 return (QAbstractItemView::SelectionBehavior) ((QAbstractItemView *)handle)->selectionBehavior();
62 }
63
QAbstractItemView_currentIndex(QAbstractItemViewH handle,QModelIndexH retval)64 void QAbstractItemView_currentIndex(QAbstractItemViewH handle, QModelIndexH retval)
65 {
66 *(QModelIndex *)retval = ((QAbstractItemView *)handle)->currentIndex();
67 }
68
QAbstractItemView_rootIndex(QAbstractItemViewH handle,QModelIndexH retval)69 void QAbstractItemView_rootIndex(QAbstractItemViewH handle, QModelIndexH retval)
70 {
71 *(QModelIndex *)retval = ((QAbstractItemView *)handle)->rootIndex();
72 }
73
QAbstractItemView_setEditTriggers(QAbstractItemViewH handle,unsigned int triggers)74 void QAbstractItemView_setEditTriggers(QAbstractItemViewH handle, unsigned int triggers)
75 {
76 ((QAbstractItemView *)handle)->setEditTriggers((QAbstractItemView::EditTriggers)triggers);
77 }
78
QAbstractItemView_editTriggers(QAbstractItemViewH handle)79 unsigned int QAbstractItemView_editTriggers(QAbstractItemViewH handle)
80 {
81 return (unsigned int) ((QAbstractItemView *)handle)->editTriggers();
82 }
83
QAbstractItemView_setVerticalScrollMode(QAbstractItemViewH handle,QAbstractItemView::ScrollMode mode)84 void QAbstractItemView_setVerticalScrollMode(QAbstractItemViewH handle, QAbstractItemView::ScrollMode mode)
85 {
86 ((QAbstractItemView *)handle)->setVerticalScrollMode(mode);
87 }
88
QAbstractItemView_verticalScrollMode(QAbstractItemViewH handle)89 QAbstractItemView::ScrollMode QAbstractItemView_verticalScrollMode(QAbstractItemViewH handle)
90 {
91 return (QAbstractItemView::ScrollMode) ((QAbstractItemView *)handle)->verticalScrollMode();
92 }
93
QAbstractItemView_setHorizontalScrollMode(QAbstractItemViewH handle,QAbstractItemView::ScrollMode mode)94 void QAbstractItemView_setHorizontalScrollMode(QAbstractItemViewH handle, QAbstractItemView::ScrollMode mode)
95 {
96 ((QAbstractItemView *)handle)->setHorizontalScrollMode(mode);
97 }
98
QAbstractItemView_horizontalScrollMode(QAbstractItemViewH handle)99 QAbstractItemView::ScrollMode QAbstractItemView_horizontalScrollMode(QAbstractItemViewH handle)
100 {
101 return (QAbstractItemView::ScrollMode) ((QAbstractItemView *)handle)->horizontalScrollMode();
102 }
103
QAbstractItemView_setAutoScroll(QAbstractItemViewH handle,bool enable)104 void QAbstractItemView_setAutoScroll(QAbstractItemViewH handle, bool enable)
105 {
106 ((QAbstractItemView *)handle)->setAutoScroll(enable);
107 }
108
QAbstractItemView_hasAutoScroll(QAbstractItemViewH handle)109 bool QAbstractItemView_hasAutoScroll(QAbstractItemViewH handle)
110 {
111 return (bool) ((QAbstractItemView *)handle)->hasAutoScroll();
112 }
113
QAbstractItemView_setAutoScrollMargin(QAbstractItemViewH handle,int margin)114 void QAbstractItemView_setAutoScrollMargin(QAbstractItemViewH handle, int margin)
115 {
116 ((QAbstractItemView *)handle)->setAutoScrollMargin(margin);
117 }
118
QAbstractItemView_autoScrollMargin(QAbstractItemViewH handle)119 int QAbstractItemView_autoScrollMargin(QAbstractItemViewH handle)
120 {
121 return (int) ((QAbstractItemView *)handle)->autoScrollMargin();
122 }
123
QAbstractItemView_setTabKeyNavigation(QAbstractItemViewH handle,bool enable)124 void QAbstractItemView_setTabKeyNavigation(QAbstractItemViewH handle, bool enable)
125 {
126 ((QAbstractItemView *)handle)->setTabKeyNavigation(enable);
127 }
128
QAbstractItemView_tabKeyNavigation(QAbstractItemViewH handle)129 bool QAbstractItemView_tabKeyNavigation(QAbstractItemViewH handle)
130 {
131 return (bool) ((QAbstractItemView *)handle)->tabKeyNavigation();
132 }
133
QAbstractItemView_setDropIndicatorShown(QAbstractItemViewH handle,bool enable)134 void QAbstractItemView_setDropIndicatorShown(QAbstractItemViewH handle, bool enable)
135 {
136 ((QAbstractItemView *)handle)->setDropIndicatorShown(enable);
137 }
138
QAbstractItemView_showDropIndicator(QAbstractItemViewH handle)139 bool QAbstractItemView_showDropIndicator(QAbstractItemViewH handle)
140 {
141 return (bool) ((QAbstractItemView *)handle)->showDropIndicator();
142 }
143
QAbstractItemView_setDragEnabled(QAbstractItemViewH handle,bool enable)144 void QAbstractItemView_setDragEnabled(QAbstractItemViewH handle, bool enable)
145 {
146 ((QAbstractItemView *)handle)->setDragEnabled(enable);
147 }
148
QAbstractItemView_dragEnabled(QAbstractItemViewH handle)149 bool QAbstractItemView_dragEnabled(QAbstractItemViewH handle)
150 {
151 return (bool) ((QAbstractItemView *)handle)->dragEnabled();
152 }
153
QAbstractItemView_setDragDropOverwriteMode(QAbstractItemViewH handle,bool overwrite)154 void QAbstractItemView_setDragDropOverwriteMode(QAbstractItemViewH handle, bool overwrite)
155 {
156 ((QAbstractItemView *)handle)->setDragDropOverwriteMode(overwrite);
157 }
158
QAbstractItemView_dragDropOverwriteMode(QAbstractItemViewH handle)159 bool QAbstractItemView_dragDropOverwriteMode(QAbstractItemViewH handle)
160 {
161 return (bool) ((QAbstractItemView *)handle)->dragDropOverwriteMode();
162 }
163
QAbstractItemView_setDragDropMode(QAbstractItemViewH handle,QAbstractItemView::DragDropMode behavior)164 void QAbstractItemView_setDragDropMode(QAbstractItemViewH handle, QAbstractItemView::DragDropMode behavior)
165 {
166 ((QAbstractItemView *)handle)->setDragDropMode(behavior);
167 }
168
QAbstractItemView_dragDropMode(QAbstractItemViewH handle)169 QAbstractItemView::DragDropMode QAbstractItemView_dragDropMode(QAbstractItemViewH handle)
170 {
171 return (QAbstractItemView::DragDropMode) ((QAbstractItemView *)handle)->dragDropMode();
172 }
173
QAbstractItemView_setDefaultDropAction(QAbstractItemViewH handle,Qt::DropAction dropAction)174 void QAbstractItemView_setDefaultDropAction(QAbstractItemViewH handle, Qt::DropAction dropAction)
175 {
176 ((QAbstractItemView *)handle)->setDefaultDropAction(dropAction);
177 }
178
QAbstractItemView_defaultDropAction(QAbstractItemViewH handle)179 Qt::DropAction QAbstractItemView_defaultDropAction(QAbstractItemViewH handle)
180 {
181 return (Qt::DropAction) ((QAbstractItemView *)handle)->defaultDropAction();
182 }
183
QAbstractItemView_setAlternatingRowColors(QAbstractItemViewH handle,bool enable)184 void QAbstractItemView_setAlternatingRowColors(QAbstractItemViewH handle, bool enable)
185 {
186 ((QAbstractItemView *)handle)->setAlternatingRowColors(enable);
187 }
188
QAbstractItemView_alternatingRowColors(QAbstractItemViewH handle)189 bool QAbstractItemView_alternatingRowColors(QAbstractItemViewH handle)
190 {
191 return (bool) ((QAbstractItemView *)handle)->alternatingRowColors();
192 }
193
QAbstractItemView_setIconSize(QAbstractItemViewH handle,const QSizeH size)194 void QAbstractItemView_setIconSize(QAbstractItemViewH handle, const QSizeH size)
195 {
196 ((QAbstractItemView *)handle)->setIconSize(*(const QSize*)size);
197 }
198
QAbstractItemView_iconSize(QAbstractItemViewH handle,PSize retval)199 void QAbstractItemView_iconSize(QAbstractItemViewH handle, PSize retval)
200 {
201 *(QSize *)retval = ((QAbstractItemView *)handle)->iconSize();
202 }
203
QAbstractItemView_setTextElideMode(QAbstractItemViewH handle,Qt::TextElideMode mode)204 void QAbstractItemView_setTextElideMode(QAbstractItemViewH handle, Qt::TextElideMode mode)
205 {
206 ((QAbstractItemView *)handle)->setTextElideMode(mode);
207 }
208
QAbstractItemView_textElideMode(QAbstractItemViewH handle)209 Qt::TextElideMode QAbstractItemView_textElideMode(QAbstractItemViewH handle)
210 {
211 return (Qt::TextElideMode) ((QAbstractItemView *)handle)->textElideMode();
212 }
213
QAbstractItemView_keyboardSearch(QAbstractItemViewH handle,PWideString search)214 void QAbstractItemView_keyboardSearch(QAbstractItemViewH handle, PWideString search)
215 {
216 QString t_search;
217 copyPWideStringToQString(search, t_search);
218 ((QAbstractItemView *)handle)->keyboardSearch(t_search);
219 }
220
QAbstractItemView_visualRect(QAbstractItemViewH handle,PRect retval,const QModelIndexH index)221 void QAbstractItemView_visualRect(QAbstractItemViewH handle, PRect retval, const QModelIndexH index)
222 {
223 QRect t_retval;
224 t_retval = ((QAbstractItemView *)handle)->visualRect(*(const QModelIndex*)index);
225 copyQRectToPRect(t_retval, retval);
226 }
227
QAbstractItemView_scrollTo(QAbstractItemViewH handle,const QModelIndexH index,QAbstractItemView::ScrollHint hint)228 void QAbstractItemView_scrollTo(QAbstractItemViewH handle, const QModelIndexH index, QAbstractItemView::ScrollHint hint)
229 {
230 ((QAbstractItemView *)handle)->scrollTo(*(const QModelIndex*)index, hint);
231 }
232
QAbstractItemView_indexAt(QAbstractItemViewH handle,QModelIndexH retval,const QPointH point)233 void QAbstractItemView_indexAt(QAbstractItemViewH handle, QModelIndexH retval, const QPointH point)
234 {
235 *(QModelIndex *)retval = ((QAbstractItemView *)handle)->indexAt(*(const QPoint*)point);
236 }
237
QAbstractItemView_sizeHintForIndex(QAbstractItemViewH handle,PSize retval,const QModelIndexH index)238 void QAbstractItemView_sizeHintForIndex(QAbstractItemViewH handle, PSize retval, const QModelIndexH index)
239 {
240 *(QSize *)retval = ((QAbstractItemView *)handle)->sizeHintForIndex(*(const QModelIndex*)index);
241 }
242
QAbstractItemView_sizeHintForRow(QAbstractItemViewH handle,int row)243 int QAbstractItemView_sizeHintForRow(QAbstractItemViewH handle, int row)
244 {
245 return (int) ((QAbstractItemView *)handle)->sizeHintForRow(row);
246 }
247
QAbstractItemView_sizeHintForColumn(QAbstractItemViewH handle,int column)248 int QAbstractItemView_sizeHintForColumn(QAbstractItemViewH handle, int column)
249 {
250 return (int) ((QAbstractItemView *)handle)->sizeHintForColumn(column);
251 }
252
QAbstractItemView_openPersistentEditor(QAbstractItemViewH handle,const QModelIndexH index)253 void QAbstractItemView_openPersistentEditor(QAbstractItemViewH handle, const QModelIndexH index)
254 {
255 ((QAbstractItemView *)handle)->openPersistentEditor(*(const QModelIndex*)index);
256 }
257
QAbstractItemView_closePersistentEditor(QAbstractItemViewH handle,const QModelIndexH index)258 void QAbstractItemView_closePersistentEditor(QAbstractItemViewH handle, const QModelIndexH index)
259 {
260 ((QAbstractItemView *)handle)->closePersistentEditor(*(const QModelIndex*)index);
261 }
262
QAbstractItemView_setIndexWidget(QAbstractItemViewH handle,const QModelIndexH index,QWidgetH widget)263 void QAbstractItemView_setIndexWidget(QAbstractItemViewH handle, const QModelIndexH index, QWidgetH widget)
264 {
265 ((QAbstractItemView *)handle)->setIndexWidget(*(const QModelIndex*)index, (QWidget*)widget);
266 }
267
QAbstractItemView_indexWidget(QAbstractItemViewH handle,const QModelIndexH index)268 QWidgetH QAbstractItemView_indexWidget(QAbstractItemViewH handle, const QModelIndexH index)
269 {
270 return (QWidgetH) ((QAbstractItemView *)handle)->indexWidget(*(const QModelIndex*)index);
271 }
272
QAbstractItemView_setItemDelegateForRow(QAbstractItemViewH handle,int row,QAbstractItemDelegateH delegate)273 void QAbstractItemView_setItemDelegateForRow(QAbstractItemViewH handle, int row, QAbstractItemDelegateH delegate)
274 {
275 ((QAbstractItemView *)handle)->setItemDelegateForRow(row, (QAbstractItemDelegate*)delegate);
276 }
277
QAbstractItemView_itemDelegateForRow(QAbstractItemViewH handle,int row)278 QAbstractItemDelegateH QAbstractItemView_itemDelegateForRow(QAbstractItemViewH handle, int row)
279 {
280 return (QAbstractItemDelegateH) ((QAbstractItemView *)handle)->itemDelegateForRow(row);
281 }
282
QAbstractItemView_setItemDelegateForColumn(QAbstractItemViewH handle,int column,QAbstractItemDelegateH delegate)283 void QAbstractItemView_setItemDelegateForColumn(QAbstractItemViewH handle, int column, QAbstractItemDelegateH delegate)
284 {
285 ((QAbstractItemView *)handle)->setItemDelegateForColumn(column, (QAbstractItemDelegate*)delegate);
286 }
287
QAbstractItemView_itemDelegateForColumn(QAbstractItemViewH handle,int column)288 QAbstractItemDelegateH QAbstractItemView_itemDelegateForColumn(QAbstractItemViewH handle, int column)
289 {
290 return (QAbstractItemDelegateH) ((QAbstractItemView *)handle)->itemDelegateForColumn(column);
291 }
292
QAbstractItemView_itemDelegate2(QAbstractItemViewH handle,const QModelIndexH index)293 QAbstractItemDelegateH QAbstractItemView_itemDelegate2(QAbstractItemViewH handle, const QModelIndexH index)
294 {
295 return (QAbstractItemDelegateH) ((QAbstractItemView *)handle)->itemDelegate(*(const QModelIndex*)index);
296 }
297
QAbstractItemView_inputMethodQuery(QAbstractItemViewH handle,QVariantH retval,Qt::InputMethodQuery query)298 void QAbstractItemView_inputMethodQuery(QAbstractItemViewH handle, QVariantH retval, Qt::InputMethodQuery query)
299 {
300 *(QVariant *)retval = ((QAbstractItemView *)handle)->inputMethodQuery(query);
301 }
302
QAbstractItemView_reset(QAbstractItemViewH handle)303 void QAbstractItemView_reset(QAbstractItemViewH handle)
304 {
305 ((QAbstractItemView *)handle)->reset();
306 }
307
QAbstractItemView_setRootIndex(QAbstractItemViewH handle,const QModelIndexH index)308 void QAbstractItemView_setRootIndex(QAbstractItemViewH handle, const QModelIndexH index)
309 {
310 ((QAbstractItemView *)handle)->setRootIndex(*(const QModelIndex*)index);
311 }
312
QAbstractItemView_doItemsLayout(QAbstractItemViewH handle)313 void QAbstractItemView_doItemsLayout(QAbstractItemViewH handle)
314 {
315 ((QAbstractItemView *)handle)->doItemsLayout();
316 }
317
QAbstractItemView_selectAll(QAbstractItemViewH handle)318 void QAbstractItemView_selectAll(QAbstractItemViewH handle)
319 {
320 ((QAbstractItemView *)handle)->selectAll();
321 }
322
QAbstractItemView_edit(QAbstractItemViewH handle,const QModelIndexH index)323 void QAbstractItemView_edit(QAbstractItemViewH handle, const QModelIndexH index)
324 {
325 ((QAbstractItemView *)handle)->edit(*(const QModelIndex*)index);
326 }
327
QAbstractItemView_clearSelection(QAbstractItemViewH handle)328 void QAbstractItemView_clearSelection(QAbstractItemViewH handle)
329 {
330 ((QAbstractItemView *)handle)->clearSelection();
331 }
332
QAbstractItemView_setCurrentIndex(QAbstractItemViewH handle,const QModelIndexH index)333 void QAbstractItemView_setCurrentIndex(QAbstractItemViewH handle, const QModelIndexH index)
334 {
335 ((QAbstractItemView *)handle)->setCurrentIndex(*(const QModelIndex*)index);
336 }
337
QAbstractItemView_scrollToTop(QAbstractItemViewH handle)338 void QAbstractItemView_scrollToTop(QAbstractItemViewH handle)
339 {
340 ((QAbstractItemView *)handle)->scrollToTop();
341 }
342
QAbstractItemView_scrollToBottom(QAbstractItemViewH handle)343 void QAbstractItemView_scrollToBottom(QAbstractItemViewH handle)
344 {
345 ((QAbstractItemView *)handle)->scrollToBottom();
346 }
347
QAbstractItemView_update(QAbstractItemViewH handle,const QModelIndexH index)348 void QAbstractItemView_update(QAbstractItemViewH handle, const QModelIndexH index)
349 {
350 ((QAbstractItemView *)handle)->update(*(const QModelIndex*)index);
351 }
352
353