File: reading_list.idl

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (117 lines) | stat: -rw-r--r-- 3,652 bytes parent folder | download | duplicates (7)
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
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Use the <code>chrome.readingList</code> API to read from and modify
// the items in the
// <a href="https://support.google.com/chrome/answer/7343019">Reading List</a>.
namespace readingList{
  dictionary ReadingListEntry {
    // The url of the entry.
    DOMString url;

    // The title of the entry.
    DOMString title;

    // Will be <code>true</code> if the entry has been read.
    boolean hasBeenRead;

    // The last time the entry was updated.
    // This value is in milliseconds since Jan 1, 1970.
    double lastUpdateTime;

    // The time the entry was created.
    // Recorded in milliseconds since Jan 1, 1970.
    double creationTime;
  };

  dictionary AddEntryOptions {
    // The url of the entry.
    DOMString url;

    // The title of the entry.
    DOMString title;

    // Will be <code>true</code> if the entry has been read.
    boolean hasBeenRead;
  };

  dictionary RemoveOptions {
    // The url to remove.
    DOMString url;
  };

  dictionary UpdateEntryOptions {
    // The url that will be updated.
    DOMString url;

    // The new title. The existing tile remains if a value isn't provided.
    DOMString? title;

    // The updated read status. The existing status remains if a value
    // isn't provided.
    boolean? hasBeenRead;
  };

  dictionary QueryInfo {
    // A url to search for.
    DOMString? url;

    // A title to search for.
    DOMString? title;

    // Indicates whether to search for read (<code>true</code>) or unread
    // (<code>false</code>) items.
    boolean? hasBeenRead;
  };

  callback AddEntryCallback = void ();
  callback RemoveEntryCallback = void();
  callback UpdateEntryCallback = void();
  callback QueryCallback = void(ReadingListEntry[] entries);

  interface Functions {
    // Adds an entry to the reading list if it does not exist.
    // |entry|: The entry to add to the reading list.
    // |callback|: Invoked once the entry has been added.
    static void addEntry(
        AddEntryOptions entry,
        optional AddEntryCallback callback);

    // Removes an entry from the reading list if it exists.
    // |info|: The entry to remove from the reading list.
    // |callback|: Invoked once the entry has been removed.
    static void removeEntry(
        RemoveOptions info,
        optional RemoveEntryCallback callback);

    // Updates a reading list entry if it exists.
    // |info|: The entry to update.
    // |callback|: Invoked once the matched entries have been updated.
    static void updateEntry(
        UpdateEntryOptions info,
        optional UpdateEntryCallback callback);

    // Retrieves all entries that match the <code>QueryInfo</code> properties.
    // Properties that are not provided will not be matched.
    // |info|: The properties to search for.
    // |callback|: Invoked once the entries have been matched.
    static void query(
        QueryInfo info,
        QueryCallback callback);
  };

  interface Events {
    // Triggered when a <code>ReadingListEntry</code> is added to the reading list.
    // |entry|: The entry that was added.
    static void onEntryAdded(ReadingListEntry entry);

    // Triggered when a <code>ReadingListEntry</code> is removed from the reading list.
    // |entry|: The entry that was removed.
    static void onEntryRemoved(ReadingListEntry entry);

    // Triggered when a <code>ReadingListEntry</code> is updated in the reading list.
    // |entry|: The entry that was updated.
    static void onEntryUpdated(ReadingListEntry entry);
  };
};