1
/***************************************************************************
2
kiohandlers.cpp - KIO specific marshallers
5
copyright : (C) 2008 by Jonathan Schmidt-Dominé
6
email : devel@the-user.org
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
21
#include <smokeruby.h>
22
#include <marshall_macros.h>
24
#include <kbookmarkmenu.h>
27
#include <kfileitemdelegate.h>
28
#include <QAbstractItemModel>
29
#include <QNetworkCookie>
32
// DEF_LIST_MARSHALLER( KIOKBookmarkMenuList, QList<KBookmarkMenu*>&, KBookmarkMenu )
33
DEF_LIST_MARSHALLER( QActionList, QList<QAction*>, QAction )
34
// DEF_LIST_MARSHALLER( QActionListRef, QList<QAction*>&, QAction )
35
// DEF_MAP_MARSHALLER( QStringMap, QMap<QString,QString>*, QString )
36
DEF_VALUELIST_MARSHALLER( KFileItemDelegeteInformationList, QList<KFileItemDelegate::Information>, KFileItemDelegate::Information )
37
DEF_VALUELIST_MARSHALLER( UIntList, QList<unsigned int>, unsigned int )
38
DEF_VALUELIST_MARSHALLER( QModelIndexList, QList<QModelIndex>, QModelIndex )
39
DEF_VALUELIST_MARSHALLER( QNetworkCookieList, QList<QNetworkCookie>, QNetworkCookie )
42
void marshall_KServiceList(Marshall *m) {
44
case Marshall::FromVALUE:
48
case Marshall::ToVALUE:
50
KService::List *offerList = (KService::List*)m->item().s_voidp;
56
VALUE av = rb_ary_new();
58
for ( KService::List::Iterator it = offerList->begin();
59
it != offerList->end();
62
KSharedPtr<KService> *ptr = new KSharedPtr<KService>(*it);
63
KService * currentOffer = ptr->data();
65
VALUE obj = getPointerObject(currentOffer);
67
smokeruby_object * o = ALLOC(smokeruby_object);
68
o->smoke = m->smoke();
69
o->classId = m->smoke()->idClass("KService").index;
70
o->ptr = currentOffer;
72
obj = set_obj_info("KDE::Service", o);
90
TypeHandler KIO_handlers[] = {
91
// { "QList<KBookmarkMenu*>&", marshall_KIOKBookmarkMenuList },
92
{ "QList<KFileItemDelegate::Information>", marshall_KFileItemDelegeteInformationList },
93
{ "QList<KSharedPtr<KService>>", marshall_KServiceList },
94
{ "QList<QAction*>", marshall_QActionList },
95
// { "QList<QAction*>&", marshall_QActionListRef },
96
{ "QList<QModelIndex>", marshall_QModelIndexList },
97
{ "QList<QNetworkCookie>", marshall_QNetworkCookieList },
98
// { "QList<QPair<QString,QString>>", 0, Smoke::t_voidp|Smoke::tf_stack }, //267
99
// { "QList<QPair<QString,QString>>&", 0, Smoke::t_voidp|Smoke::tf_ref }, //268
100
// { "QList<QPair<QString,unsigned short>>", 0, Smoke::t_voidp|Smoke::tf_stack }, //269
101
{ "QList<unsigned int>", marshall_UIntList },
102
// { "QMap<QString,QString>*", marshall_QStringMap },
103
// { "QMap<int,QVariant>", },