summaryrefslogtreecommitdiffstats
path: root/src/dom/work/views.idl
blob: 3cc74512c1e1091961e80be87255a3922fc359aa (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/*
 * Copyright (c) 2004 World Wide Web Consortium,
 *
 * (Massachusetts Institute of Technology, European Research Consortium for
 * Informatics and Mathematics, Keio University). All Rights Reserved. This
 * work is distributed under the W3C(r) Software License [1] in the hope that
 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 */

// File: http://www.w3.org/TR/2004/NOTE-DOM-Level-3-Views-20040226/views.idl

#ifndef _VIEWS_IDL_
#define _VIEWS_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module views
{

  typedef dom::Node Node;
  typedef dom::DOMString DOMString;

  interface Segment;
  interface VisualResource;
  interface VisualCharacter;
  interface VisualCharacterRun;
  interface VisualFrame;
  interface VisualImage;
  interface VisualFormButton;
  interface VisualFormField;

  // Introduced in DOM Level 3:
  interface View {
    void               select(in Node boundary, 
                              in unsigned long offset, 
                              in boolean extend, 
                              in boolean add);
    Segment            createSegment();
    boolean            matchFirstSegment(inout Segment todo)
                                        raises(dom::DOMException);
    long               getIntegerProperty(in DOMString name)
                                        raises(dom::DOMException);
    DOMString          getStringProperty(in DOMString name)
                                        raises(dom::DOMException);
    boolean            getBooleanProperty(in boolean name)
                                        raises(dom::DOMException);
    Node               getContentPropertyNode(in DOMString name)
                                        raises(dom::DOMException);
    unsigned long      getContentPropertyOffset(in DOMString name)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 3:
  interface Match {

    // MatchTestGroup
    const unsigned short      IS_EQUAL                       = 0;
    const unsigned short      IS_NOT_EQUAL                   = 1;
    const unsigned short      INT_PRECEDES                   = 2;
    const unsigned short      INT_PRECEDES_OR_EQUALS         = 3;
    const unsigned short      INT_FOLLOWS                    = 4;
    const unsigned short      INT_FOLLOWS_OR_EQUALS          = 5;
    const unsigned short      STR_STARTS_WITH                = 6;
    const unsigned short      STR_ENDS_WITH                  = 7;
    const unsigned short      STR_CONTAINS                   = 8;
    const unsigned short      SET_ANY                        = 9;
    const unsigned short      SET_ALL                        = 10;
    const unsigned short      SET_NOT_ANY                    = 11;
    const unsigned short      SET_NOT_ALL                    = 12;

    readonly attribute unsigned short  test;
  };

  // Introduced in DOM level 3:
  interface MatchString : Match {
    readonly attribute DOMString       name;
    readonly attribute DOMString       value;
  };

  // Introduced in DOM level 3:
  interface MatchInteger : Match {
    readonly attribute DOMString       name;
    readonly attribute long            value;
  };

  // Introduced in DOM level 3:
  interface MatchBoolean : Match {
    readonly attribute DOMString       name;
    readonly attribute boolean         value;
  };

  // Introduced in DOM level 3:
  interface MatchContent : Match {
    readonly attribute DOMString       name;
    readonly attribute Node            nodeArg;
    readonly attribute unsigned long   offset;
  };

  // Introduced in DOM level 3:
  interface MatchSet : Match {
    readonly attribute Node            nodeArg;
    void               addMatch(in Match add);
    Match              getMatch(in unsigned long index);
  };

  // Introduced in DOM Level 3:
  interface Item {
    readonly attribute boolean         exists;
    readonly attribute DOMString       name;
  };

  // Introduced in DOM Level 3:
  interface StringItem : Item {
    readonly attribute DOMString       value;
  };

  // Introduced in DOM Level 3:
  interface IntegerItem : Item {
    readonly attribute long            value;
  };

  // Introduced in DOM Level 3:
  interface BooleanItem : Item {
             attribute boolean         value;
  };

  // Introduced in DOM Level 3:
  interface ContentItem : Item {
             attribute Node            nodeArg;
             attribute unsigned long   offset;
  };

  interface VisualView {
    readonly attribute DOMString       fontScheme;
    readonly attribute unsigned long   width;
    readonly attribute unsigned long   height;
    readonly attribute unsigned long   horizontalDPI;
    readonly attribute unsigned long   verticalDPI;
    VisualCharacter    createVisualCharacter();
    VisualCharacterRun createVisualCharacterRun();
    VisualFrame        createVisualFrame();
    VisualImage        createVisualImage();
    VisualFormButton   createVisualFormButton();
    VisualFormField    createVisualFormField();
    void               select(in Node boundary, 
                              in unsigned long offset, 
                              in boolean extend, 
                              in boolean add);
    void               matchSegment(in VisualResource segment);
  };

  interface VisualResource {
  };

  interface VisualFont : VisualResource {
             attribute DOMString       matchFontName;
    readonly attribute boolean         exists;
    readonly attribute DOMString       fontName;
    boolean            getNext();
  };

  interface VisualSegment : VisualResource {
             attribute boolean         matchPosition;
             attribute boolean         matchInside;
             attribute boolean         matchContaining;
             attribute long            matchX;
             attribute long            matchY;
             attribute long            matchXR;
             attribute long            matchYR;
             attribute boolean         matchContent;
             attribute boolean         matchRange;
             attribute Node            matchNode;
             attribute unsigned long   matchOffset;
             attribute Node            matchNodeR;
             attribute unsigned long   matchOffsetR;
             attribute boolean         matchContainsSelected;
             attribute boolean         matchContainsVisible;
    readonly attribute boolean         exists;
    readonly attribute Node            startNode;
    readonly attribute unsigned long   startOffset;
    readonly attribute Node            endNode;
    readonly attribute unsigned long   endOffset;
    readonly attribute long            topOffset;
    readonly attribute long            bottomOffset;
    readonly attribute long            leftOffset;
    readonly attribute long            rightOffset;
    readonly attribute unsigned long   width;
    readonly attribute unsigned long   height;
    readonly attribute boolean         selected;
    readonly attribute boolean         visible;
    readonly attribute unsigned long   foregroundColor;
    readonly attribute unsigned long   backgroundColor;
    readonly attribute DOMString       fontName;
    readonly attribute DOMString       fontHeight;
    boolean            getNext();
  };

  interface VisualCharacter : VisualSegment {
  };

  interface VisualCharacterRun : VisualSegment {
  };

  interface VisualFrame : VisualSegment {
    readonly attribute VisualSegment   embedded;
  };

  interface VisualImage : VisualSegment {
    readonly attribute DOMString       imageURL;
    readonly attribute boolean         isLoaded;
  };

  interface VisualFormButton : VisualSegment {
    readonly attribute boolean         isPressed;
  };

  interface VisualFormField : VisualSegment {
    readonly attribute DOMString       formValue;
  };

  // Introduced in DOM Level 3:
  interface Segment : Match {
             attribute Match           criteria;
             attribute DOMString       order;
    void               addItem(in Item add);
    MatchString        createMatchString(in unsigned short test, 
                                         in DOMString name, 
                                         in DOMString value);
    MatchInteger       createMatchInteger(in unsigned short test, 
                                          in DOMString name, 
                                          in long value);
    MatchBoolean       createMatchBoolean(in unsigned short test, 
                                          in DOMString name, 
                                          in boolean value);
    MatchContent       createMatchContent(in unsigned short test, 
                                          in DOMString name, 
                                          in unsigned long offset, 
                                          in Node nodeArg);
    MatchSet           createMatchSet(in unsigned short test);
    StringItem         createStringItem(in DOMString name);
    IntegerItem        createIntegerItem(in DOMString name);
    BooleanItem        createBooleanItem(in DOMString name);
    ContentItem        createContentItem(in DOMString name);
    void               getItem(in unsigned long index);
    boolean            getNext();
  };
};

#endif // _VIEWS_IDL_