summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_io_positioner.eo
blob: b344d784de299066942a1e89098f42e5770e6e3f (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
import eina_types;

enum Efl.Io.Positioner.Whence {
    [[Seek position modes]]
    start, [[Seek from start of the stream/file]]
    current, [[Seek from current position]]
    end, [[Seek from the end of stream/file]]
}

mixin Efl.Io.Positioner {
    [[Generic interface for objects that can change or report position.

      @since 1.19
    ]]

    data: null;

    methods {
        seek @pure_virtual {
            [[Seek in data]]
            params {
                @in offset: int64; [[Offset in byte relative to whence]]
                @in whence: Efl.Io.Positioner.Whence; [[Whence]]
            }
            return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]]
        }

        @property position {
            [[Position property]]
            get @pure_virtual { }
            set {
                [[Try to set position object, relative to start of file. See @.seek()]]
                return: bool; [[$true if could reposition, $false if errors.]]
            }
            values {
                position: uint64; [[Position in file or buffer]]
            }
        }
    }

    events {
        position,changed; [[Notifies position changed]]
    }
}