summaryrefslogtreecommitdiffstats
path: root/kjsembed/docs/types.html
blob: 1b3f212044d1d941b2e16f34d2e31d81417cb396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<html>
<head>
<link href="kjsembed.css" rel="stylesheet" type="text/css">
<title>KJSEmbed Types</title>
</head>
<body>
<h1>KJSEmbed Types</h1>
<hr>
<h2>Introduction</h2>

KJSEmbed adds a number of custom types to those defined by ECMA in
addition to the objects themselves. These types are used to pass
complex datatypes between scripts and the C++ code that is hosting the
script. This document describes the representations used to pass
information in each direction.

<p>

It should be noted that currently only a single representation is
available to scripts accessing native types. Scripts should not rely
on this behaviour as the restriction may be removed in a future
release of KJSEmbed so this, though the current script API will
continue to be supported.

<h2>Fundamental Types</h2>

<h3>Numbers</h3>
<ul>
<li>int -> Number
<li>uint -> Number
<li>float -> Number
<li>double -> Number
<li>Number -> int
<li>Number -> uint
<li>Number -> float
<li>Number -> double
</ul>

<h3>Strings</h3>
<ul>
<li>QString -> String
<li>QCString -> String
<li>const char * -> String
<li>String -> QString
<li>String -> QCString
<li>String -> const char *
</ul>

<h2>Qt Object Types</h2>

<h3>QColor</h3>
Represents a color, possibly including an alpha channel.
<ul>
<li>QColor -> '#rrggbb'
<li>'#rrggbb' -> QColor
<li>'#rrggbbaa' -> QColor
</ul>

<h3>QPoint</h3>
Represents a point.
<ul>
<li>QPoint -> [x,y]
<li>[x,y] -> QPoint
<li>obj.x obj.y -> QPoint
</ul>

<h3>QSize</h3>
Represents a size.
<ul>
<li>QSize -> [w,h]
<li>[w,h] -> QSize
<li>obj.w obj.h -> QSize
</ul>

<h3>QRect</h3>
Represents a rectangle.
<ul>
<li>QRect -> [x,y,w,h]
<li>[x,y,w,h] -> QRect
<li>obj.x obj.y obj.w obj.h -> QRect
</ul>

<h3>QDate</h3>
Represents a date.
<ul>
<li>QDate -> ''
</ul>

<h3>QTime</h3>
Represents a time.
<ul>
<li>QTime -> ''
</ul>

<h3>QDateTime</h3>
Represents a date/time pair.
<ul>
<li>QDateTime -> ''
</ul>

<h3>QKeySequence</h3>
Represents a sequence of keys, eg. it is used for accelerators.
<ul>
<li>QKeySequence -> ''
</ul>

<h3>QFont</h3>
Represents a font.
<ul>
<li>QFont -> ''
</ul>

<h2>KDE Object Types</h2>

<h3>KURL</h3>
Represents a URL.
<ul>
<li>KURL -> ''
<li>'' -> KURL
</ul>

<hr>
</body>
</html>