1
/***************************************************************************
5
copyright : (C) 2005 The University of Toronto
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
18
#ifndef BIND_PICTURE_H
19
#define BIND_PICTURE_H
21
#include "bind_borderedviewobject.h"
23
#include <kstviewpicture.h>
25
#include <kjs/interpreter.h>
26
#include <kjs/object.h>
29
@inherits BorderedViewObject
30
@collection ViewObjectCollection
31
@description A customizable picture object.
33
class KstBindPicture : public KstBindBorderedViewObject {
36
@arg ViewObject parent The parent to place the new picture in. May also
37
be a string containing the name of an existing
39
@description Creates a new picture and places it in the ViewObject <i>parent</i>.
42
@arg Window window The window to place the new picture in. May also be a
43
string containing the name of an existing Window.
44
@optarg string url The URL of a file to load the picture from.
45
@description Creates a new picture and places it in the Window <i>window</i>.
47
KstBindPicture(KJS::ExecState *exec, KstViewPicturePtr d, const char *name = 0L);
48
KstBindPicture(KJS::ExecState *exec, KJS::Object *globalObject = 0L, const char *name = 0L);
51
KJS::Object construct(KJS::ExecState *exec, const KJS::List& args);
52
KJS::Value call(KJS::ExecState *exec, KJS::Object& self, const KJS::List& args);
53
KJS::Value get(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
54
void put(KJS::ExecState *exec, const KJS::Identifier& propertyName, const KJS::Value& value, int attr = KJS::None);
55
KJS::ReferenceList propList(KJS::ExecState *exec, bool recursive = true);
56
bool hasProperty(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
58
int methodCount() const;
59
int propertyCount() const;
63
@description Load an image from a give url. Returns true on success.
64
@arg string url The URL to retrieve the image from.
66
KJS::Value load(KJS::ExecState *exec, const KJS::List& args);
67
/* @property Image image
68
@description The raw image that is being displayed. You can take a copy
69
of this, manipulate it, then set it back to change the
72
void setImage(KJS::ExecState *exec, const KJS::Value& value);
73
KJS::Value image(KJS::ExecState *exec) const;
74
/* @property string url
76
@description The URL of the image if it was loaded from a file and has
79
KJS::Value url(KJS::ExecState *exec) const;
80
/* @property number refreshTimer
81
@description A timer to automatically refresh the picture. Value of 0
82
means the timer is disabled. Units are in seconds.
84
void setRefreshTimer(KJS::ExecState *exec, const KJS::Value& value);
85
KJS::Value refreshTimer(KJS::ExecState *exec) const;
89
KstBindPicture(int id, const char *name = 0L);
90
void addBindings(KJS::ExecState *exec, KJS::Object& obj);
91
static KstBindViewObject *bindFactory(KJS::ExecState *exec, KstViewObjectPtr obj);