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 "qshortcut_c.h"
13 
QShortcut_Create(QWidgetH parent)14 QShortcutH QShortcut_Create(QWidgetH parent)
15 {
16 	return (QShortcutH) new QShortcut((QWidget*)parent);
17 }
18 
QShortcut_Destroy(QShortcutH handle)19 void QShortcut_Destroy(QShortcutH handle)
20 {
21 	delete (QShortcut *)handle;
22 }
23 
QShortcut_Create2(const QKeySequenceH key,QWidgetH parent,const char * member,const char * ambiguousMember,Qt::ShortcutContext context)24 QShortcutH QShortcut_Create2(const QKeySequenceH key, QWidgetH parent, const char* member, const char* ambiguousMember, Qt::ShortcutContext context)
25 {
26 	return (QShortcutH) new QShortcut(*(const QKeySequence*)key, (QWidget*)parent, member, ambiguousMember, context);
27 }
28 
QShortcut_setKey(QShortcutH handle,const QKeySequenceH key)29 void QShortcut_setKey(QShortcutH handle, const QKeySequenceH key)
30 {
31 	((QShortcut *)handle)->setKey(*(const QKeySequence*)key);
32 }
33 
QShortcut_key(QShortcutH handle,QKeySequenceH retval)34 void QShortcut_key(QShortcutH handle, QKeySequenceH retval)
35 {
36 	*(QKeySequence *)retval = ((QShortcut *)handle)->key();
37 }
38 
QShortcut_setEnabled(QShortcutH handle,bool enable)39 void QShortcut_setEnabled(QShortcutH handle, bool enable)
40 {
41 	((QShortcut *)handle)->setEnabled(enable);
42 }
43 
QShortcut_isEnabled(QShortcutH handle)44 bool QShortcut_isEnabled(QShortcutH handle)
45 {
46 	return (bool) ((QShortcut *)handle)->isEnabled();
47 }
48 
QShortcut_setContext(QShortcutH handle,Qt::ShortcutContext context)49 void QShortcut_setContext(QShortcutH handle, Qt::ShortcutContext context)
50 {
51 	((QShortcut *)handle)->setContext(context);
52 }
53 
QShortcut_context(QShortcutH handle)54 Qt::ShortcutContext QShortcut_context(QShortcutH handle)
55 {
56 	return (Qt::ShortcutContext) ((QShortcut *)handle)->context();
57 }
58 
QShortcut_setWhatsThis(QShortcutH handle,PWideString text)59 void QShortcut_setWhatsThis(QShortcutH handle, PWideString text)
60 {
61 	QString t_text;
62 	copyPWideStringToQString(text, t_text);
63 	((QShortcut *)handle)->setWhatsThis(t_text);
64 }
65 
QShortcut_whatsThis(QShortcutH handle,PWideString retval)66 void QShortcut_whatsThis(QShortcutH handle, PWideString retval)
67 {
68 	QString t_retval;
69 	t_retval = ((QShortcut *)handle)->whatsThis();
70 	copyQStringToPWideString(t_retval, retval);
71 }
72 
QShortcut_setAutoRepeat(QShortcutH handle,bool on)73 void QShortcut_setAutoRepeat(QShortcutH handle, bool on)
74 {
75 	((QShortcut *)handle)->setAutoRepeat(on);
76 }
77 
QShortcut_autoRepeat(QShortcutH handle)78 bool QShortcut_autoRepeat(QShortcutH handle)
79 {
80 	return (bool) ((QShortcut *)handle)->autoRepeat();
81 }
82 
QShortcut_id(QShortcutH handle)83 int QShortcut_id(QShortcutH handle)
84 {
85 	return (int) ((QShortcut *)handle)->id();
86 }
87 
QShortcut_parentWidget(QShortcutH handle)88 QWidgetH QShortcut_parentWidget(QShortcutH handle)
89 {
90 	return (QWidgetH) ((QShortcut *)handle)->parentWidget();
91 }
92 
93