comctl32/listview: Remove superfluous forward declarations.
[wine] / include / mstask.idl
1 /*
2  * Task Scheduler Service interface
3  *
4  * Copyright (C) 2008 Google (Roy Shea)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  */
21
22 import "oaidl.idl";
23 import "oleidl.idl";
24
25 cpp_quote("#define TASK_SUNDAY 0x1")
26 cpp_quote("#define TASK_MONDAY 0x2")
27 cpp_quote("#define TASK_TUESDAY 0x4")
28 cpp_quote("#define TASK_WEDNESDAY 0x8")
29 cpp_quote("#define TASK_THURSDAY 0x10")
30 cpp_quote("#define TASK_FRIDAY 0x20")
31 cpp_quote("#define TASK_SATURDAY 0x40")
32
33 cpp_quote("#define TASK_FIRST_WEEK 1")
34 cpp_quote("#define TASK_SECOND_WEEK 2")
35 cpp_quote("#define TASK_THIRD_WEEK 3")
36 cpp_quote("#define TASK_FOURTH_WEEK 4")
37 cpp_quote("#define TASK_LAST_WEEK 5")
38
39 cpp_quote("#define TASK_JANUARY 0x1")
40 cpp_quote("#define TASK_FEBRUARY 0x2")
41 cpp_quote("#define TASK_MARCH 0x4")
42 cpp_quote("#define TASK_APRIL 0x8")
43 cpp_quote("#define TASK_MAY 0x10")
44 cpp_quote("#define TASK_JUNE 0x20")
45 cpp_quote("#define TASK_JULY 0x40")
46 cpp_quote("#define TASK_AUGUST 0x80")
47 cpp_quote("#define TASK_SEPTEMBER 0x100")
48 cpp_quote("#define TASK_OCTOBER 0x200")
49 cpp_quote("#define TASK_NOVEMBER 0x400")
50 cpp_quote("#define TASK_DECEMBER 0x800")
51
52 cpp_quote("#define TASK_TRIGGER_FLAG_HAS_END_DATE 0x1")
53 cpp_quote("#define TASK_TRIGGER_FLAG_KILL_AT_DURATION_END 0x2")
54 cpp_quote("#define TASK_TRIGGER_FLAG_DISABLED 0x4")
55
56 [
57     local,
58     object,
59     uuid(148BD528-A2AB-11CE-B11F-00AA00530503),
60     pointer_default(unique)
61 ]
62 interface IEnumWorkItems : IUnknown
63 {
64     HRESULT Next(
65             [in]   ULONG celt,
66             [out]  LPWSTR **rgpwszNames,
67             [out]  ULONG *pceltFetched);
68
69     HRESULT Skip(
70             [in]  ULONG celt);
71
72     HRESULT Reset();
73
74     HRESULT Clone(
75             [out]  IEnumWorkItems **ppEnumWorkItems);
76 }
77
78 cpp_quote("#ifndef _HPROPSHEETPAGE_DEFINED")
79 typedef struct _PSP *HPROPSHEETPAGE;
80 cpp_quote("#define _HPROPSHEETPAGE_DEFINED")
81 cpp_quote("#endif")
82
83 [
84     local,
85     object,
86     uuid(4086658a-cbbb-11cf-b604-00c04fd8d565),
87     pointer_default(unique)
88 ]
89 interface IProvideTaskPage : IUnknown
90 {
91     typedef enum _TASKPAGE {
92         TASKPAGE_TASK       = 0,
93         TASKPAGE_SCHEDULE   = 1,
94         TASKPAGE_SETTINGS   = 2
95     } TASKPAGE;
96
97     HRESULT GetPage(
98             [in]   TASKPAGE tpType,
99             [in]   BOOL fPersistChanges,
100             [out]  HPROPSHEETPAGE *phPage);
101 }
102
103 [
104     local,
105     object,
106     uuid(148BD52B-A2AB-11CE-B11F-00AA00530503),
107     pointer_default(unique)
108 ]
109 interface ITaskTrigger : IUnknown
110 {
111     typedef enum _TASK_TRIGGER_TYPE {
112         TASK_TIME_TRIGGER_ONCE              = 0,
113         TASK_TIME_TRIGGER_DAILY             = 1,
114         TASK_TIME_TRIGGER_WEEKLY            = 2,
115         TASK_TIME_TRIGGER_MONTHLYDATE       = 3,
116         TASK_TIME_TRIGGER_MONTHLYDOW        = 4,
117         TASK_EVENT_TRIGGER_ON_IDLE          = 5,
118         TASK_EVENT_TRIGGER_AT_SYSTEMSTART   = 6,
119         TASK_EVENT_TRIGGER_AT_LOGON         = 7
120     } TASK_TRIGGER_TYPE, *PTASK_TRIGGER_TYPE;
121
122     typedef struct _DAILY {
123         WORD DaysInterval;
124     } DAILY;
125
126     typedef struct _WEEKLY {
127         WORD WeeksInterval;
128         WORD rgfDaysOfTheWeek;
129     } WEEKLY;
130
131     typedef struct _MONTHLYDATE {
132         DWORD rgfDays;
133         WORD rgfMonths;
134     } MONTHLYDATE;
135
136     typedef struct _MONTHLYDOW {
137         WORD wWhichWeek;
138         WORD rgfDaysOfTheWeek;
139         WORD rgfMonths;
140     } MONTHLYDOW;
141
142     typedef union _TRIGGER_TYPE_UNION {
143         DAILY Daily;
144         WEEKLY Weekly;
145         MONTHLYDATE MonthlyDate;
146         MONTHLYDOW MonthlyDOW;
147     } TRIGGER_TYPE_UNION;
148
149     typedef struct _TASK_TRIGGER {
150         WORD cbTriggerSize;
151         WORD Reserved1;
152         WORD wBeginYear;
153         WORD wBeginMonth;
154         WORD wBeginDay;
155         WORD wEndYear;
156         WORD wEndMonth;
157         WORD wEndDay;
158         WORD wStartHour;
159         WORD wStartMinute;
160         DWORD MinutesDuration;
161         DWORD MinutesInterval;
162         DWORD rgFlags;
163         TASK_TRIGGER_TYPE TriggerType;
164         TRIGGER_TYPE_UNION Type;
165         WORD Reserved2;
166         WORD wRandomMinutesInterval;
167     } TASK_TRIGGER, *PTASK_TRIGGER;
168
169     HRESULT SetTrigger(
170             [in]  const PTASK_TRIGGER pTrigger);
171
172     HRESULT GetTrigger(
173             [out]  PTASK_TRIGGER pTrigger);
174
175     HRESULT GetTriggerString(
176             [out]  LPWSTR *ppwszTrigger);
177 }
178
179 [
180     local,
181     object,
182     uuid(a6b952f0-a4b1-11d0-997d-00aa006887ec),
183     pointer_default(unique)
184 ]
185 interface IScheduledWorkItem : IUnknown
186 {
187     HRESULT CreateTrigger(
188             [out]  WORD *piNewTrigger,
189             [out]  ITaskTrigger **ppTrigger);
190
191     HRESULT DeleteTrigger(
192             [in]  WORD iTrigger);
193
194     HRESULT GetTriggerCount(
195             [out]  WORD *plCount);
196
197     HRESULT GetTrigger(
198             [in]   WORD iTrigger,
199             [out]  ITaskTrigger **ppTrigger);
200
201     HRESULT GetTriggerString(
202             [in]   WORD iTrigger,
203             [out]  LPWSTR *ppwszTrigger);
204
205     HRESULT GetRunTimes(
206             [in]       const LPSYSTEMTIME pstBegin,
207             [in]       const LPSYSTEMTIME pstEnd,
208             [in, out]  WORD *pCount,
209             [out]      LPSYSTEMTIME *rgstTaskTimes);
210
211     HRESULT GetNextRunTime(
212             [out]  SYSTEMTIME *pstNextRun);
213
214     HRESULT SetIdleWait(
215             [in]  WORD wIdleMinutes,
216             [in]  WORD wDeadlineMinutes);
217
218     HRESULT GetIdleWait(
219             [out]  WORD *pwIdleMinutes,
220             [out]  WORD *pwDeadlineMinutes);
221
222     HRESULT Run();
223
224     HRESULT Terminate();
225
226     HRESULT EditWorkItem(
227             [in]  HWND hParent,
228             [in]  DWORD dwReserved);
229
230     HRESULT GetMostRecentRunTime(
231             [out]  SYSTEMTIME *pstLastRun);
232
233     HRESULT GetStatus(
234             [out]  HRESULT *phrStatus);
235
236     HRESULT GetExitCode(
237             [out]  DWORD *pdwExitCode);
238
239     HRESULT SetComment(
240             [in]  LPCWSTR pwszComment);
241
242     HRESULT GetComment(
243             [out]  LPWSTR *ppwszComment);
244
245     HRESULT SetCreator(
246             LPCWSTR pwszCreator);
247
248     HRESULT GetCreator(
249             [out]  LPWSTR *ppwszCreator);
250
251     HRESULT SetWorkItemData(
252             [in]  WORD cBytes,
253             [in]  BYTE rgbData[]);
254
255     HRESULT GetWorkItemData(
256             [out]  WORD *pcBytes,
257             [out]  BYTE **ppBytes);
258
259     HRESULT SetErrorRetryCount(
260             WORD wRetryCount);
261
262     HRESULT GetErrorRetryCount(
263             [out]  WORD *pwRetryCount);
264
265     HRESULT SetErrorRetryInterval(
266             WORD wRetryInterval);
267
268     HRESULT GetErrorRetryInterval(
269             [out]  WORD *pwRetryInterval);
270
271     HRESULT SetFlags(
272             DWORD dwFlags);
273
274     HRESULT GetFlags(
275             [out]  DWORD *pdwFlags);
276
277     HRESULT SetAccountInformation(
278             [in]  LPCWSTR pwszAccountName,
279             [in]  LPCWSTR pwszPassword);
280
281     HRESULT GetAccountInformation(
282             [out]  LPWSTR *ppwszAccountName);
283 }
284
285 [
286     local,
287     object,
288     uuid(148BD524-A2AB-11CE-B11F-00AA00530503),
289     pointer_default(unique)
290 ]
291 interface ITask : IScheduledWorkItem
292 {
293     HRESULT SetApplicationName(
294             [in]  LPCWSTR pwszApplicationName);
295
296     HRESULT GetApplicationName(
297             [out]  LPWSTR *ppwszApplicationName);
298
299     HRESULT SetParameters(
300             [in]  LPCWSTR pwszParameters);
301
302     HRESULT GetParameters(
303             [out]  LPWSTR *ppwszParameters);
304
305     HRESULT SetWorkingDirectory(
306             [in]  LPCWSTR pwszWorkingDirectory);
307
308     HRESULT GetWorkingDirectory(
309             [in]  LPWSTR *ppwszWorkingDirectory);
310
311     HRESULT SetPriority(
312             [in]  DWORD dwPriority);
313
314     HRESULT GetPriority(
315             [out]  DWORD *pdwPriority);
316
317     HRESULT SetTaskFlags(
318             [in]  DWORD dwFlags);
319
320     HRESULT GetTaskFlags(
321             [out]  DWORD *pdwFlags);
322
323     HRESULT SetMaxRunTime(
324             [in]  DWORD dwMaxRunTime);
325
326     HRESULT GetMaxRunTime(
327             [out]  DWORD *pdwMaxRunTime);
328 }
329
330 [
331     local,
332     object,
333     uuid(148BD527-A2AB-11CE-B11F-00AA00530503),
334     pointer_default(unique)
335 ]
336 interface ITaskScheduler : IUnknown
337 {
338     HRESULT SetTargetComputer(
339             [in]  LPCWSTR pwszComputer);
340
341     HRESULT GetTargetComputer(
342             [out]  LPWSTR *ppwszComputer);
343
344     HRESULT Enum(
345             [out]  IEnumWorkItems **ppEnumTasks);
346
347     HRESULT Activate(
348             [in]   LPCWSTR pwszName,
349             [in]   REFIID riid,
350             [out]  IUnknown **ppunk);
351
352     HRESULT Delete(
353             [in]  LPCWSTR pwszName);
354
355     HRESULT NewWorkItem(
356             [in]   LPCWSTR pwszTaskName,
357             [in]   REFCLSID rclsid,
358             [in]   REFIID riid,
359             [out]  IUnknown **ppunk);
360
361     HRESULT AddWorkItem(
362             [in]  LPCWSTR pwszTaskName,
363             [in]  IScheduledWorkItem *pWorkItem);
364
365     HRESULT IsOfType(
366             [in]  LPCWSTR pwszName,
367             [in]  REFIID riid);
368 }
369
370 [
371     uuid(148BD52A-A2AB-11CE-B11F-00AA00530503)
372 ]
373 coclass CTaskScheduler
374 {
375     [default] interface ITaskScheduler;
376 };
377
378
379 [
380     uuid(148BD520-A2AB-11CE-B11F-00AA00530503)
381 ]
382 coclass CTask
383 {
384     [default] interface ITask;
385 };