<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>