summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_task.eo
blob: 92f0094fef1e9a40e4f612f3b13a5d136e4a0b8d (plain) (blame)
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
enum Efl.Task_Priority {
   [[ ]]
   normal,
   background,
   low,
   high,
   ultra
}

enum Efl.Task_Flags {
   [[ ]]
   none               = 0,
   use_stdin          = 1,
   use_stdout         = 2,
   no_exit_code_error = 4,
}

abstract Efl.Task extends Efl.Object
{
   [[ ]]
   methods {
      @property command {
         [[ A commandline that encodes arguments in a command string.
            This command is unix shell-style, thus whitespace separates
            arguments unless escaped. Also a semi-colon ';', ampersand
            '&', pipe/bar '|', hash '#', bracket, square brace, brace
            character ('(', ')', '[', ']', '{', '}'), exclamation
            mark '!',  backquote '`', greator or less than ('>' '<')
            character unless escaped or in quotes would cause
            args_count/value to not be generated properly, because
            it would force complex shell interpretation which
            will not be supported in evaluating the arg_count/value
            information, but the final shell may interpret this if this
            is executed via a command-line shell. To not be a complex
            shell command, it should be simple with paths, options
            and variable expansions, but nothing more complex involving
            the above unescaped characters.

            "cat -option /path/file"
            "cat 'quoted argument'"
            "cat ~/path/escaped\ argument"
            "/bin/cat escaped\ argument $VARIABLE"
            etc.

            It should not try and use "complex shell features" if you
            want the arg_count and arg_value set to be correct after
            setting the command string. For example none of:

            "VAR=x /bin/command && /bin/othercommand >& /dev/null"
            "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &"
            etc.

            If you set the command the arg_count/value property contents
            can change and be completely re-evaluated by parsing the
            command string into an argument array set along with
            interpreting escapes back into individual argument strings. ]]
         get { }
         set { }
         values {
            command: string; [[ The command string as described ]]
         }
      }
      @property arg_count {
         [[ Number of arguments passed in or arguments that are to be
            passed as sepcified by arg_value ]]
         get { }
         values {
            args: uint; [[ ]]
         }
      }
      @property arg_value {
         [[ Argument number by index. If the index does not exist when
            set, it is allocated and created. Getting an argument that
            Has not been set yet will return $NULL. Empty arguments will
            Be ignored. Setting an argument will result in the command
            porperty being re-evaluated and escaped into a single
            command string if needed. ]]
         set { }
         get { }
         keys {
            num: uint; [[ ]]
         }
         values {
            arg: string; [[ ]]
         }
      }
      arg_append {
         [[ Append a new string argument at the end of the arg set.
            This functions like setting an arg_value at the end of the
            current set so the set increases by 1 in size. ]]
         params {
            arg: string; [[ ]]
         }
      }
      arg_reset {
         [[ Clear all arguments in arg_value/count set. Will result in the
            command property also being cleared. ]]
      }
      @property env {
         [[ The environment to be passed in or that was passed to the
            task. This is a string key, value list which map to environment
            variables where appropriate. The var string must contain
            only an underscore ('_'), letters ('a-z', 'A-Z'),
            numbers ('0-9'), but the first character may not be a number.]]
         set { }
         get { }
         keys {
            var: string; [[ The variable name as a string ]]
         }
         values {
            value: string; [[ Set var to this value if not $NULL,
                              otherwise clear this env value if value
                              is $NULL or if it is an empty string ]]
         }
      }
      env_reset {
         [[ Clear all environment variables. ]]
      }
      @property priority {
         [[ The priority of this task. ]]
         get { }
         set { }
         values {
            priority: Efl.Task_Priority; [[ ]]
         }
      }
      @property exit_code {
         [[ The final exit code of this task. ]]
         get { }
         values {
            code: int; [[ ]]
         }
      }
      @property flags {
         set { }
         get { }
         values {
            flags: Efl.Task_Flags; [[ ]]
         }
      }
      run @pure_virtual {
         [[ Actually run the task ]]
         return: future<void> @owned; [[ A future triggered when task exits and is passed int exit code ]]
      }
      end @pure_virtual {
         [[ Request the task end (may send a signal or interrupt
            signal resulting in a terminate event being tiggered in the
            target task loop) ]]
      }
   }
   events {
   }
   implements {
      Efl.Object.destructor;
      Efl.Object.parent { set; }
   }
}