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 "qitemdelegate_c.h"
13 
QItemDelegate_Create(QObjectH parent)14 QItemDelegateH QItemDelegate_Create(QObjectH parent)
15 {
16 	return (QItemDelegateH) new QItemDelegate((QObject*)parent);
17 }
18 
QItemDelegate_Destroy(QItemDelegateH handle)19 void QItemDelegate_Destroy(QItemDelegateH handle)
20 {
21 	delete (QItemDelegate *)handle;
22 }
23 
QItemDelegate_hasClipping(QItemDelegateH handle)24 bool QItemDelegate_hasClipping(QItemDelegateH handle)
25 {
26 	return (bool) ((QItemDelegate *)handle)->hasClipping();
27 }
28 
QItemDelegate_setClipping(QItemDelegateH handle,bool clip)29 void QItemDelegate_setClipping(QItemDelegateH handle, bool clip)
30 {
31 	((QItemDelegate *)handle)->setClipping(clip);
32 }
33 
QItemDelegate_paint(QItemDelegateH handle,QPainterH painter,const QStyleOptionViewItemH option,const QModelIndexH index)34 void QItemDelegate_paint(QItemDelegateH handle, QPainterH painter, const QStyleOptionViewItemH option, const QModelIndexH index)
35 {
36 	((QItemDelegate *)handle)->paint((QPainter*)painter, *(const QStyleOptionViewItem*)option, *(const QModelIndex*)index);
37 }
38 
QItemDelegate_sizeHint(QItemDelegateH handle,PSize retval,const QStyleOptionViewItemH option,const QModelIndexH index)39 void QItemDelegate_sizeHint(QItemDelegateH handle, PSize retval, const QStyleOptionViewItemH option, const QModelIndexH index)
40 {
41 	*(QSize *)retval = ((QItemDelegate *)handle)->sizeHint(*(const QStyleOptionViewItem*)option, *(const QModelIndex*)index);
42 }
43 
QItemDelegate_createEditor(QItemDelegateH handle,QWidgetH parent,const QStyleOptionViewItemH option,const QModelIndexH index)44 QWidgetH QItemDelegate_createEditor(QItemDelegateH handle, QWidgetH parent, const QStyleOptionViewItemH option, const QModelIndexH index)
45 {
46 	return (QWidgetH) ((QItemDelegate *)handle)->createEditor((QWidget*)parent, *(const QStyleOptionViewItem*)option, *(const QModelIndex*)index);
47 }
48 
QItemDelegate_setEditorData(QItemDelegateH handle,QWidgetH editor,const QModelIndexH index)49 void QItemDelegate_setEditorData(QItemDelegateH handle, QWidgetH editor, const QModelIndexH index)
50 {
51 	((QItemDelegate *)handle)->setEditorData((QWidget*)editor, *(const QModelIndex*)index);
52 }
53 
QItemDelegate_setModelData(QItemDelegateH handle,QWidgetH editor,QAbstractItemModelH model,const QModelIndexH index)54 void QItemDelegate_setModelData(QItemDelegateH handle, QWidgetH editor, QAbstractItemModelH model, const QModelIndexH index)
55 {
56 	((QItemDelegate *)handle)->setModelData((QWidget*)editor, (QAbstractItemModel*)model, *(const QModelIndex*)index);
57 }
58 
QItemDelegate_updateEditorGeometry(QItemDelegateH handle,QWidgetH editor,const QStyleOptionViewItemH option,const QModelIndexH index)59 void QItemDelegate_updateEditorGeometry(QItemDelegateH handle, QWidgetH editor, const QStyleOptionViewItemH option, const QModelIndexH index)
60 {
61 	((QItemDelegate *)handle)->updateEditorGeometry((QWidget*)editor, *(const QStyleOptionViewItem*)option, *(const QModelIndex*)index);
62 }
63 
QItemDelegate_itemEditorFactory(QItemDelegateH handle)64 QItemEditorFactoryH QItemDelegate_itemEditorFactory(QItemDelegateH handle)
65 {
66 	return (QItemEditorFactoryH) ((QItemDelegate *)handle)->itemEditorFactory();
67 }
68 
QItemDelegate_setItemEditorFactory(QItemDelegateH handle,QItemEditorFactoryH factory)69 void QItemDelegate_setItemEditorFactory(QItemDelegateH handle, QItemEditorFactoryH factory)
70 {
71 	((QItemDelegate *)handle)->setItemEditorFactory((QItemEditorFactory*)factory);
72 }
73 
74