~ubuntu-branches/ubuntu/karmic/kst/karmic

« back to all changes in this revision

Viewing changes to kst/kst/extensions/js/bind_picture.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-06-30 19:11:30 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630191130-acumuar75bz4puty
Tags: 1.2.1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                             bind_picture.h
 
3
                             --------------
 
4
    begin                : Jun 14 2005
 
5
    copyright            : (C) 2005 The University of Toronto
 
6
    email                :
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef BIND_PICTURE_H
 
19
#define BIND_PICTURE_H
 
20
 
 
21
#include "bind_borderedviewobject.h"
 
22
 
 
23
#include <kstviewpicture.h>
 
24
 
 
25
#include <kjs/interpreter.h>
 
26
#include <kjs/object.h>
 
27
 
 
28
/* @class Picture
 
29
   @inherits BorderedViewObject
 
30
   @collection ViewObjectCollection
 
31
   @description A customizable picture object.
 
32
*/
 
33
class KstBindPicture : public KstBindBorderedViewObject {
 
34
  public:
 
35
    /* @constructor
 
36
       @arg ViewObject parent The parent to place the new picture in.  May also
 
37
                              be a string containing the name of an existing
 
38
                              ViewObject.
 
39
       @description Creates a new picture and places it in the ViewObject <i>parent</i>.
 
40
    */
 
41
    /* @constructor
 
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>.
 
46
    */
 
47
    KstBindPicture(KJS::ExecState *exec, KstViewPicturePtr d, const char *name = 0L);
 
48
    KstBindPicture(KJS::ExecState *exec, KJS::Object *globalObject = 0L, const char *name = 0L);
 
49
    ~KstBindPicture();
 
50
 
 
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;
 
57
 
 
58
    int methodCount() const;
 
59
    int propertyCount() const;
 
60
 
 
61
    /* @method load
 
62
       @returns boolean
 
63
       @description Load an image from a give url.  Returns true on success.
 
64
       @arg string url The URL to retrieve the image from.
 
65
    */
 
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
 
70
                    image.
 
71
    */
 
72
    void setImage(KJS::ExecState *exec, const KJS::Value& value);
 
73
    KJS::Value image(KJS::ExecState *exec) const;
 
74
    /* @property string url
 
75
       @readonly
 
76
       @description The URL of the image if it was loaded from a file and has
 
77
                    not been modified.
 
78
    */
 
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.
 
83
    */
 
84
    void setRefreshTimer(KJS::ExecState *exec, const KJS::Value& value);
 
85
    KJS::Value refreshTimer(KJS::ExecState *exec) const;
 
86
 
 
87
 
 
88
  protected:
 
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);
 
92
};
 
93
 
 
94
 
 
95
#endif
 
96
 
 
97
// vim: ts=2 sw=2 et