summaryrefslogtreecommitdiffstats
path: root/kjsembed/docs/types.html
blob: 597016055fa7af2b7fb0657a35c9208e2af15d33 (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>TQString -> String
<li>TQCString -> String
<li>const char * -> String
<li>String -> QString
<li>String -> QCString
<li>String -> const char *
</ul>

<h2>Qt Object Types</h2>

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

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

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

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

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

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

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

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

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

<h2>KDE Object Types</h2>

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

<hr>
</body>
</html>