summaryrefslogtreecommitdiff
path: root/src/lib/eio/eio_sentry.eo
blob: 993e0c958fae4c83d4f7ea6755dc43c4adfd1ddf (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
struct @beta Eio.Sentry.Event
{
  [[Wraps the data about a monitor event on a file.]]
  trigger: string; [[The cause of the event.]]
  source: string; [[The original monitored path.]]
}

class @beta Eio.Sentry extends Efl.Object
{
  [[Monitors files and directories for changes.]]

  methods {
    add {
      [[Adds a new path to the list of monitored paths.]]
      params {
        @in path: string; [[Path to monitor]]
      }
      return : bool; [[$true on success, $false otherwise]]
    }
    remove {
      [[Removes the given path from the monitored list.]]
      params {
        @in path: string; [[Path to remove from monitoring]]
      }
    }
    fallback_check @const @beta {
      [[Return if the sentry is using the fallback monitoring method

        The fallback method of monitoring cannot provide certain events.
      ]]
      params {
        @in path: string; [[Path to check for fallback monitoring]]
      }
      return : bool; [[$true only if the sentry is using the fallback mechanism]]
    }
  }
 events {
    file,created: Eio.Sentry.Event; [[Called when a file was created]]
    file,deleted: Eio.Sentry.Event; [[Called when a file was deleted]]
    file,modified: Eio.Sentry.Event; [[Called when a file was modified]]
    file,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a file was closed]]
    directory,created: Eio.Sentry.Event; [[Called when a directory was created]]
    directory,deleted: Eio.Sentry.Event; [[Called when a directory was deleted]]
    directory,modified: Eio.Sentry.Event; [[called when a directory was modified]]
    directory,closed: Eio.Sentry.Event; [[Called for non-fallback sentries when a directory was closed]]
    self,rename: Eio.Sentry.Event; [[Called for non-fallback sentries when the object was renamed]]
    self,deleted: Eio.Sentry.Event; [[Called when the object was deleted]]
    error: Eio.Sentry.Event; [[Called in case of an error]]
 }

 implements {
    Efl.Object.constructor;
    Efl.Object.destructor;
  }
}