Changeset View
Changeset View
Standalone View
Standalone View
scripting/meta.h
Show All 40 Lines | |||||
41 | { | 41 | { | ||
42 | namespace MetaScripting | 42 | namespace MetaScripting | ||
43 | { | 43 | { | ||
44 | 44 | | |||
45 | 45 | | |||
46 | /** | 46 | /** | ||
47 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | 47 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | ||
48 | * Conversion functions for QPoint | 48 | * Conversion functions for QPoint | ||
49 | */ | 49 | **/ | ||
50 | namespace Point | 50 | namespace Point | ||
51 | { | 51 | { | ||
52 | QScriptValue toScriptValue(QScriptEngine*, const QPoint&); | 52 | QScriptValue toScriptValue(QScriptEngine*, const QPoint&); | ||
53 | void fromScriptValue(const QScriptValue&, QPoint&); | 53 | void fromScriptValue(const QScriptValue&, QPoint&); | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | /** | 56 | /** | ||
57 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | 57 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | ||
58 | * Conversion functions for QSize | 58 | * Conversion functions for QSize | ||
59 | */ | 59 | **/ | ||
60 | namespace Size | 60 | namespace Size | ||
61 | { | 61 | { | ||
62 | QScriptValue toScriptValue(QScriptEngine*, const QSize&); | 62 | QScriptValue toScriptValue(QScriptEngine*, const QSize&); | ||
63 | void fromScriptValue(const QScriptValue&, QSize&); | 63 | void fromScriptValue(const QScriptValue&, QSize&); | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | /** | 66 | /** | ||
67 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | 67 | * The toScriptValue and fromScriptValue functions used in qScriptRegisterMetaType. | ||
68 | * Conversion functions for QRect | 68 | * Conversion functions for QRect | ||
69 | * TODO: QRect conversions have to be linked from plasma as they provide a lot more | 69 | * TODO: QRect conversions have to be linked from plasma as they provide a lot more | ||
70 | * features. As for QSize and QPoint, I don't really plan any such thing. | 70 | * features. As for QSize and QPoint, I don't really plan any such thing. | ||
71 | */ | 71 | **/ | ||
72 | namespace Rect | 72 | namespace Rect | ||
73 | { | 73 | { | ||
74 | QScriptValue toScriptValue(QScriptEngine*, const QRect&); | 74 | QScriptValue toScriptValue(QScriptEngine*, const QRect&); | ||
75 | void fromScriptValue(const QScriptValue&, QRect&); | 75 | void fromScriptValue(const QScriptValue&, QRect&); | ||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | namespace Client | 78 | namespace Client | ||
79 | { | 79 | { | ||
80 | QScriptValue toScriptValue(QScriptEngine *eng, const KClientRef &client); | 80 | QScriptValue toScriptValue(QScriptEngine *eng, const KClientRef &client); | ||
81 | void fromScriptValue(const QScriptValue &value, KClientRef& client); | 81 | void fromScriptValue(const QScriptValue &value, KClientRef& client); | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | namespace Toplevel | 84 | namespace Toplevel | ||
85 | { | 85 | { | ||
86 | QScriptValue toScriptValue(QScriptEngine *eng, const KToplevelRef &client); | 86 | QScriptValue toScriptValue(QScriptEngine *eng, const KToplevelRef &client); | ||
87 | void fromScriptValue(const QScriptValue &value, KToplevelRef& client); | 87 | void fromScriptValue(const QScriptValue &value, KToplevelRef& client); | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | /** | 90 | /** | ||
91 | * Merges the second QScriptValue in the first one. | 91 | * Merges the second QScriptValue in the first one. | ||
92 | */ | 92 | **/ | ||
93 | void valueMerge(QScriptValue&, QScriptValue); | 93 | void valueMerge(QScriptValue&, QScriptValue); | ||
94 | 94 | | |||
95 | /** | 95 | /** | ||
96 | * Registers all the meta conversion to the provided QScriptEngine | 96 | * Registers all the meta conversion to the provided QScriptEngine | ||
97 | */ | 97 | **/ | ||
98 | void registration(QScriptEngine* eng); | 98 | void registration(QScriptEngine* eng); | ||
99 | 99 | | |||
100 | /** | 100 | /** | ||
101 | * Functions for the JS function objects, config.exists and config.get. | 101 | * Functions for the JS function objects, config.exists and config.get. | ||
102 | * Read scripting/IMPLIST for details on how they work | 102 | * Read scripting/IMPLIST for details on how they work | ||
103 | */ | 103 | **/ | ||
104 | QScriptValue configExists(QScriptContext*, QScriptEngine*); | 104 | QScriptValue configExists(QScriptContext*, QScriptEngine*); | ||
105 | QScriptValue getConfigValue(QScriptContext*, QScriptEngine*); | 105 | QScriptValue getConfigValue(QScriptContext*, QScriptEngine*); | ||
106 | 106 | | |||
107 | /** | 107 | /** | ||
108 | * Provide a config object to the given QScriptEngine depending | 108 | * Provide a config object to the given QScriptEngine depending | ||
109 | * on the keys provided in the QVariant. The provided QVariant | 109 | * on the keys provided in the QVariant. The provided QVariant | ||
110 | * MUST returns (true) on isHash() | 110 | * MUST returns (true) on isHash() | ||
111 | */ | 111 | **/ | ||
112 | void supplyConfig(QScriptEngine*, const QVariant&); | 112 | void supplyConfig(QScriptEngine*, const QVariant&); | ||
113 | 113 | | |||
114 | /** | 114 | /** | ||
115 | * For engines whose scripts have no associated configuration. | 115 | * For engines whose scripts have no associated configuration. | ||
116 | */ | 116 | **/ | ||
117 | void supplyConfig(QScriptEngine*); | 117 | void supplyConfig(QScriptEngine*); | ||
118 | 118 | | |||
119 | } | 119 | } | ||
120 | } | 120 | } | ||
121 | 121 | | |||
122 | /** | 122 | /** | ||
123 | * Code linked from plasma for QTimer. | 123 | * Code linked from plasma for QTimer. | ||
124 | */ | 124 | **/ | ||
125 | QScriptValue constructTimerClass(QScriptEngine *eng); | 125 | QScriptValue constructTimerClass(QScriptEngine *eng); | ||
126 | 126 | | |||
127 | #endif | 127 | #endif |