Remove EWK_BRINGUP in gpu_info_collector_efl.cc
[platform/framework/web/chromium-efl.git] / google_update / google_update_idl.idl
1 // Copyright 2009-2010 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 // ========================================================================
15
16 import "oaidl.idl";
17 import "ocidl.idl";
18
19 // When adding interfaces to this file:
20 //  * Do not use "Google" or "GoogleUpdate" directly. Instead, use preprocessor
21 //    defines.
22 //  * Add a test for the Google-specific value to
23 //    omaha_customization_goopdate_apis_unittest.cc.
24
25 //
26 // Enums.
27 // These values can be passed to interface methods and/or compared to their
28 // output.
29 //
30
31 // Must be kept in sync with the enum in base/browser_utils.h.
32 typedef enum BrowserType {
33   BROWSER_UNKNOWN           = 0,
34   BROWSER_DEFAULT           = 1,
35   BROWSER_INTERNET_EXPLORER = 2,
36   BROWSER_FIREFOX           = 3,
37   BROWSER_CHROME            = 4,
38 } BrowserType;
39
40 // The normal install flow proceeds from STATE_INIT through
41 // STATE_INSTALL_COMPLETE in order, skipping states that are not relevant.
42 // All exceptions and terminal states are start with STATE_INSTALL_COMPLETE.
43 typedef enum CurrentState {
44   STATE_INIT = 1,
45   STATE_WAITING_TO_CHECK_FOR_UPDATE = 2,
46   STATE_CHECKING_FOR_UPDATE = 3,
47   STATE_UPDATE_AVAILABLE = 4,
48   STATE_WAITING_TO_DOWNLOAD = 5,
49   STATE_RETRYING_DOWNLOAD = 6,
50   STATE_DOWNLOADING = 7,
51   STATE_DOWNLOAD_COMPLETE = 8,
52   STATE_EXTRACTING = 9,
53   STATE_APPLYING_DIFFERENTIAL_PATCH = 10,
54   // TODO(omaha3): Should we move STATE_DOWNLOAD_COMPLETE here and eliminate
55   // STATE_READY_TO_INSTALL?
56   STATE_READY_TO_INSTALL = 11,
57   STATE_WAITING_TO_INSTALL = 12,
58   STATE_INSTALLING = 13,
59   STATE_INSTALL_COMPLETE = 14,
60   STATE_PAUSED = 15,
61   STATE_NO_UPDATE = 16,
62   STATE_ERROR = 17,
63 } CurrentState;
64
65 typedef enum InstallPriority {
66   INSTALL_PRIORITY_LOW = 0,
67   INSTALL_PRIORITY_HIGH = 10,
68 } InstallPriority;
69
70 // Specifies what the client should do after installation.
71 typedef enum PostInstallAction {
72   POST_INSTALL_ACTION_DEFAULT = 0,
73
74   // Caller should exit silently.
75   POST_INSTALL_ACTION_EXIT_SILENTLY = 1,
76
77   // Caller should launch the command.
78   POST_INSTALL_ACTION_LAUNCH_COMMAND = 2,
79
80   // Caller should launch the command and exit silently.
81   POST_INSTALL_ACTION_EXIT_SILENTLY_ON_LAUNCH_COMMAND = 3,
82
83   // The caller should ask the user to restart the browser. If the value of
84   // IApp's browser is supported and postInstallUrl is valid, the client should
85   // offer to restart the browser. If the user chooses to do so, the client
86   // should launch the ICurrentState::postInstallUrl after shutting down and
87   // restarting the browser.
88   POST_INSTALL_ACTION_RESTART_BROWSER = 4,
89
90   // Similar to POST_INSTALL_ACTION_RESTART_BROWSER, but ask the user to shut
91   // down all browsers.
92   POST_INSTALL_ACTION_RESTART_ALL_BROWSERS = 5,
93
94   // The caller should ask the user to reboot the machine.
95   POST_INSTALL_ACTION_REBOOT = 6,
96 } PostInstallAction;
97
98 enum AppCommandStatus {
99   // The command has never been executed.
100   COMMAND_STATUS_INIT = 1,
101   // The command is running.
102   COMMAND_STATUS_RUNNING = 2,
103   // An error occurred while launching or monitoring the command.
104   COMMAND_STATUS_ERROR = 3,
105   // The command has completed execution.
106   COMMAND_STATUS_COMPLETE = 4,
107 };
108
109 [
110   object,
111   dual,
112   uuid(6DB17455-4E85-46e7-9D23-E555E4B005AF),
113   helpstring("IGoogleUpdate3 Interface"),
114   pointer_default(unique)
115 ]
116 interface IGoogleUpdate3 : IDispatch {
117   // TODO(Omaha): Perhaps this interface exposes helpers such as
118   // RestartBrowsers, etc.
119
120   // Returns the count of the AppBundles in this IGoogleUpdate3 interface.
121   [id(1), propget] HRESULT Count([out, retval] long* count);
122
123   // Returns an IDispatch of the AppBundle in this IGoogleUpdate3 interface at
124   // the specified 0-based index. This property has the dispid of DISPID_VALUE
125   // to make it the default property of IGoogleUpdate3.
126   [id(DISPID_VALUE), propget] HRESULT Item([in] long index,
127                                            [out, retval] IDispatch** bundle);
128   // Returns an IDispatch to a newly created empty AppBundle.
129   [id(2)] HRESULT createAppBundle([out, retval] IDispatch** app_bundle);
130 }
131
132 [
133   object,
134   dual,
135   uuid(fe908cdd-22bb-472a-9870-1a0390e42f36),
136   helpstring("IAppBundle Interface"),
137   pointer_default(unique)
138 ]
139 interface IAppBundle : IDispatch {
140   // TODO(omaha3): AppBundle::display_name_ is never used. Should we remove?
141   [propget] HRESULT displayName([out, retval] BSTR*);
142   [propput] HRESULT displayName([in] BSTR);
143
144   [propget] HRESULT displayLanguage([out, retval] BSTR*);
145   [propput] HRESULT displayLanguage([in] BSTR);
146
147   [propget] HRESULT installSource([out, retval] BSTR*);
148   [propput] HRESULT installSource([in] BSTR);
149
150   [propget] HRESULT originURL([out, retval] BSTR*);
151   [propput] HRESULT originURL([in] BSTR);
152
153   [propget] HRESULT offlineDirectory([out, retval] BSTR* offline_dir);
154   [propput] HRESULT offlineDirectory([in] BSTR offline_dir);
155
156   [propget] HRESULT sessionId([out, retval] BSTR* session_id);
157   [propput] HRESULT sessionId([in] BSTR session_id);
158
159   // Controls whether or not event pings should be sent at the end of
160   // an operation.
161   [propget] HRESULT sendPings([out, retval] VARIANT_BOOL* send_pings);
162   [propput] HRESULT sendPings([in] VARIANT_BOOL send_pings);
163
164   // The priority property determines download speed/priority and the number/
165   // frequency of retries.  Use values from the InstallPriority enum.
166   [propget] HRESULT priority([out, retval] long* priority);
167   [propput] HRESULT priority([in] long priority);
168
169   // Returns the count of the Apps in the AppBundle.
170   [id(1), propget] HRESULT Count([out, retval] long* count);
171
172   // Returns an IDispatch of the App in the AppBundle at the specified 0-based
173   // index. This property has the dispid of DISPID_VALUE to make it the default
174   // property of IAppBundle.
175   [id(DISPID_VALUE), propget] HRESULT Item([in] long index,
176                                            [out, retval] IDispatch** app);
177
178   // Impersonation and primary tokens set by the client. Typically only
179   // set by the gupdatem service. The gupdatem service exposes a narrow
180   // interface to medium integrity clients. When a medium integrity client calls
181   // into the gupdatem service, the gupdatem service captures the token of the
182   // caller, and then calls put_altTokens() on the gupdate service, so that the
183   // gupdate service can use it for future download() and install() requests.
184   [propput] HRESULT altTokens([in] ULONG_PTR impersonation_token,
185                               [in] ULONG_PTR primary_token,
186                               [in] DWORD caller_proc_id);
187
188   // Sets a HWND to associate with the client, if any.  This will be used as
189   // the parent window for any dialogs that the server may need to display.
190   [propput] HRESULT parentHWND([in] ULONG_PTR hwnd);
191
192   // Initializes the bundle with the properties that have been set.
193   [id(2)] HRESULT initialize();
194
195   // Returns an IDispatch to a new App for the specified app id.
196   // The App is added to the Bundle.
197   [id(3)] HRESULT createApp([in] BSTR app_id,
198                             [out, retval] IDispatch** app);
199
200   // Returns an IDispatch to a newly created App for the specified app ID. The
201   // App is populated with information from the existing installation and added
202   // to the Bundle. Fails if the specified app is not installed.
203   [id(4)] HRESULT createInstalledApp([in] BSTR app_id,
204                                      [out, retval] IDispatch** app);
205
206   // Creates App instances for all installed apps managed by this Omaha
207   // instance. Each App is populated with information from the existing install.
208   [id(5)] HRESULT createAllInstalledApps();
209
210   // These methods are non-blocking. The operation is scheduled.
211   [id(6)] HRESULT checkForUpdate();
212   [id(7)] HRESULT download();
213   [id(8)] HRESULT install();
214
215   // All-in-one function for automatically updating all apps. Populates the
216   // bundle then schedules the update, which includes the update check and
217   // download and install, if necessary.
218   [id(9)] HRESULT updateAllApps();
219
220   // These three methods are non-blocking. The operation is requested.
221   [id(10)] HRESULT stop();
222   [id(11)] HRESULT pause();
223   [id(12)] HRESULT resume();
224
225   // Returns true if the bundle has an uncompleted non-blocking request.
226   [id(13)] HRESULT isBusy([out, retval] VARIANT_BOOL* is_busy);
227
228   // Downloads a package of an installed application.
229   [id(14)] HRESULT downloadPackage([in] BSTR app_id, [in] BSTR package_name);
230
231   // TODO(omaha): Define this aggregated bundle state. Is this really a property
232   // or should it be getCurrentState?
233   // The server and bundle are the only thing that can provide aggregated
234   // time estimates for downloads. Also, aggregate percentage is not currently
235   // available to the client because the total bytes to download is not
236   // available from App in all post-update check states.
237   // To do this, we will probably need to know the total expected download
238   // size for all packages to be installed - those that are required or in use -
239   // by the time the update check phase is complete.
240   [id(15), propget] HRESULT currentState([out, retval] VARIANT* current_state);
241 };
242
243 [
244   object,
245   dual,
246   uuid(76F7B787-A67C-4c73-82C7-31F5E3AABC5C),
247   helpstring("IApp Interface"),
248   pointer_default(unique)
249 ]
250 interface IApp : IDispatch {
251   // Returns a version IDispatch object.
252   [id(1), propget] HRESULT currentVersion([out, retval] IDispatch** current);
253   [id(2), propget] HRESULT nextVersion([out, retval] IDispatch** next);
254
255   [propget] HRESULT appId([out, retval] BSTR*);
256
257   [propget] HRESULT displayName([out, retval] BSTR*);
258   [propput] HRESULT displayName([in] BSTR);
259
260   [propget] HRESULT language([out, retval] BSTR*);
261   [propput] HRESULT language([in] BSTR);
262
263   [propget] HRESULT ap([out, retval] BSTR*);
264   [propput] HRESULT ap([in] BSTR);
265
266   [propget] HRESULT ttToken([out, retval] BSTR*);
267   [propput] HRESULT ttToken([in] BSTR);
268
269   [propget] HRESULT iid([out, retval] BSTR*);
270   [propput] HRESULT iid([in] BSTR);
271
272   [propget] HRESULT brandCode([out, retval] BSTR*);
273   [propput] HRESULT brandCode([in] BSTR);
274
275   [propget] HRESULT clientId([out, retval] BSTR*);
276   [propput] HRESULT clientId([in] BSTR);
277
278   [propget] HRESULT labels([out, retval] BSTR*);
279   [propput] HRESULT labels([in] BSTR);
280
281   [propget] HRESULT referralId([out, retval] BSTR*);
282   [propput] HRESULT referralId([in] BSTR);
283
284   // Returns an IDispatch to a command defined by this installed app with the
285   // specified ID, or NULL if this app is not installed or the command ID is not
286   // recognized.
287   [propget] HRESULT command([in] BSTR command_id,
288                             [out, retval] IDispatch** command);
289
290   // Use values from the BrowserType enum.
291   [propget] HRESULT browserType([out, retval] UINT*);
292   [propput] HRESULT browserType([in] UINT);
293
294   [propget] HRESULT clientInstallData([out, retval] BSTR*);
295   [propput] HRESULT clientInstallData([in] BSTR);
296
297   [propget] HRESULT serverInstallDataIndex([out, retval] BSTR*);
298   [propput] HRESULT serverInstallDataIndex([in] BSTR);
299
300   // Set as soon as possible. Error pings are disabled until set to true.
301   [propget] HRESULT isEulaAccepted([out, retval] VARIANT_BOOL*);
302   [propput] HRESULT isEulaAccepted([in] VARIANT_BOOL);
303
304   [propget] HRESULT usageStatsEnable([out, retval] UINT*);
305   [propput] HRESULT usageStatsEnable([in] UINT);
306
307   [propget] HRESULT installTimeDiffSec([out, retval] UINT*);
308
309   // Returns an ICurrentState interface. The object underlying the interface has
310   // static data that does not get updated as the server state changes. To get
311   // the most "current" state, the currentState property needs to be queried
312   // again.
313   [propget] HRESULT currentState([out, retval] IDispatch**);
314 };
315
316 [
317   object,
318   dual,
319   uuid(084D78A8-B084-4E14-A629-A2C419B0E3D9),
320   helpstring("IApp2 Interface"),
321   pointer_default(unique)
322 ]
323 interface IApp2 : IApp {
324   [propget] HRESULT untrustedData([out, retval] BSTR*);
325   [propput] HRESULT untrustedData([in] BSTR);
326 };
327
328 [
329   object,
330   dual,
331   uuid(4DE778FE-F195-4ee3-9DAB-FE446C239221),
332   helpstring("IAppCommand Interface"),
333   pointer_default(unique)
334 ]
335 interface IAppCommand : IDispatch {
336   [propget] HRESULT isWebAccessible([out, retval] VARIANT_BOOL*);
337   // Use values from the AppCommandStatus enum.
338   [propget] HRESULT status([out, retval] UINT*);
339   [propget] HRESULT exitCode([out, retval] DWORD*);
340   HRESULT execute([in, optional] VARIANT arg1,
341                   [in, optional] VARIANT arg2,
342                   [in, optional] VARIANT arg3,
343                   [in, optional] VARIANT arg4,
344                   [in, optional] VARIANT arg5,
345                   [in, optional] VARIANT arg6,
346                   [in, optional] VARIANT arg7,
347                   [in, optional] VARIANT arg8,
348                   [in, optional] VARIANT arg9);
349 };
350
351 [
352   object,
353   dual,
354   uuid(3D05F64F-71E3-48A5-BF6B-83315BC8AE1F),
355   helpstring("IAppCommand2 Interface"),
356   pointer_default(unique)
357 ]
358 interface IAppCommand2 : IAppCommand {
359   [propget] HRESULT output([out, retval] BSTR*);
360 };
361
362 [
363   object,
364   dual,
365   uuid(BCDCB538-01C0-46d1-A6A7-52F4D021C272),
366   helpstring("IAppVersion Interface"),
367   pointer_default(unique)
368 ]
369 interface IAppVersion : IDispatch {
370   [propget] HRESULT version([out, retval] BSTR*);
371
372   // [propget] HRESULT installManifest([out, retval] BSTR*);
373
374   // Returns the count of the Packages in the AppVersion.
375   [propget] HRESULT packageCount([out, retval] long* count);
376
377   // Returns an IDispatch of the Package in the AppVersion at the specified
378   // 0-based index.
379   [propget] HRESULT package([in] long index,
380                             [out, retval] IDispatch** package);
381 };
382
383 [
384   object,
385   dual,
386   uuid(DCAB8386-4F03-4dbd-A366-D90BC9F68DE6),
387   helpstring("IPackage Interface"),
388   pointer_default(unique)
389 ]
390 interface IPackage : IDispatch {
391   // Retrieves the package from the package cache and copies it to the
392   // directory provided. Returns an error is the package is not available
393   // locally.
394   [id(1)] HRESULT get([in] BSTR dir);
395
396   // Returns true if the package has been downloaded and is available
397   // locally.
398   [propget] HRESULT isAvailable([out, retval] VARIANT_BOOL*);
399
400   // Returns the manifest name of the package.
401   [propget] HRESULT filename([out, retval] BSTR*);
402 };
403
404 // TODO(omaha3): We should figure out what else we are going to want in this
405 // interface before dogfood even if we do not implement it.
406 [
407   object,
408   dual,
409   uuid(247954F9-9EDC-4E68-8CC3-150C2B89EADF),
410   helpstring("ICurrentState Interface"),
411   pointer_default(unique)
412 ]
413 interface ICurrentState : IDispatch {
414   // This interface is exposed to web clients!
415   // TODO(omaha3): Update valid comments once we settle on an implementation.
416
417   // A value from the CurrentState enum. This value determines which of the
418   // properties below are valid.
419   [propget] HRESULT stateValue([out, retval] LONG*);
420
421   // The remaining properties are only valid in the specified states. For all
422   // other states, the values are not specified.
423
424   // This property is valid only when stateValue is STATE_UPDATE_AVAILABLE.
425   [propget] HRESULT availableVersion([out, retval] BSTR*);
426
427   // The following three properties are only valid when stateValue is
428   // STATE_WAITING_TO_DOWNLOAD, STATE_RETRYING_DOWNLOAD, STATE_DOWNLOADING,
429   // STATE_DOWNLOAD_COMPLETE, STATE_EXTRACTING,
430   // STATE_APPLYING_DIFFERENTIAL_PATCH, or STATE_READY_TO_INSTALL.
431
432   // Bytes downloaded so far.
433   [propget] HRESULT bytesDownloaded([out, retval] ULONG*);
434
435   // Total bytes to download.
436   [propget] HRESULT totalBytesToDownload([out, retval] ULONG*);
437
438   // Estimated download time remaining in ms. -1 indicates unknown.
439   // Progress may not always be available, so clients should handle the -1 case.
440   [propget] HRESULT downloadTimeRemainingMs([out, retval] LONG*);
441
442   [propget] HRESULT nextRetryTime([out, retval] ULONGLONG*);
443
444   // TODO(omaha 3): Need some way to indicate reconnecting, retrying, etc.
445
446   // The following two properties are only valid when stateValue is
447   // STATE_INSTALLING or STATE_INSTALL_COMPLETE.
448
449   // Current install progress in percentage from 0 to 100. -1 indicates unknown.
450   // Progress may not always be available, so clients should handle the -1 case.
451   [propget] HRESULT installProgress([out, retval] LONG*);
452
453   // Estimated download time remaining in ms. -1 indicates unknown.
454   // Progress may not always be available, so clients should handle the -1 case.
455   [propget] HRESULT installTimeRemainingMs([out, retval] LONG*);
456
457   // The following four properties are only valid when stateValue is
458   // STATE_ERROR:
459
460   // Returns true if the app has been canceled.
461   [propget] HRESULT isCanceled([out, retval] VARIANT_BOOL* is_canceled);
462
463   // Error code.
464   [propget] HRESULT errorCode([out, retval] LONG*);
465
466   // Error extra code.
467   [propget] HRESULT extraCode1([out, retval] LONG*);
468
469   // The following three properties are only valid when stateValue is
470   // STATE_ERROR or STATE_INSTALL_COMPLETE.
471   // TODO(omaha3): If STATE_DOWNLOAD_COMPLETE or STATE_READY_TO_INSTALL becomes
472   // a terminal state, does it support completion messages?
473
474   // Completion message, localized in the specified language.
475   // TODO(omaha3): If we're going to have bundle error messages too, should the
476   // language be at bundle level? Should bundle have its own language setter?
477   [propget] HRESULT completionMessage([out, retval] BSTR*);
478
479   // Application installer result code. This is to be used as additional
480   // information only. Success/failure should be determined using errorCode.
481   // This is an error if errorCode is GOOPDATEINSTALL_E_INSTALLER_FAILED.
482   [propget] HRESULT installerResultCode([out, retval] LONG*);
483
484   // Application installer extra code.
485   [propget] HRESULT installerResultExtraCode1([out, retval] LONG*);
486
487   // A command that needs to be launched by the client after installation.
488   [propget] HRESULT postInstallLaunchCommandLine([out, retval] BSTR*);
489
490   // URL to be launched after restarting the browser.
491   [propget] HRESULT postInstallUrl([out, retval] BSTR*);
492
493   // Returns a PostInstallAction value indicating the action to be taken by the
494   // client after installation.
495   [propget] HRESULT postInstallAction([out, retval] LONG*);
496 }
497
498 [
499   object,
500   dual,
501   uuid(4E223325-C16B-4eeb-AEDC-19AA99A237FA),
502   helpstring("IRegistrationUpdateHook Interface"),
503   pointer_default(unique)
504 ]
505 interface IRegistrationUpdateHook : IDispatch {
506   HRESULT UpdateRegistry([in] BSTR app_id, [in] VARIANT_BOOL is_machine);
507 };
508
509 [
510   object,
511   uuid(b3a47570-0a85-4aea-8270-529d47899603),
512   helpstring("ICredentialDialog Interface"),
513   pointer_default(unique)
514 ]
515 interface ICredentialDialog : IUnknown {
516   HRESULT QueryUserForCredentials([in] ULONG_PTR owner_hwnd,
517                                   [in] BSTR server,
518                                   [in] BSTR message,
519                                   [out] BSTR* username,
520                                   [out] BSTR* password);
521 };
522
523 // BEGIN gupdatem interfaces.
524
525 // The following interfaces are exposed as a narrower version of the
526 // IGoogleUpdate3 interface from the gupdatem service. These interfaces are
527 // meant for use from medium and low integrity clients.
528
529 [
530   object,
531   dual,
532   uuid(494B20CF-282E-4BDD-9F5D-B70CB09D351E),
533   helpstring("IGoogleUpdate3Web Interface"),
534   pointer_default(unique)
535 ]
536 interface IGoogleUpdate3Web : IDispatch {
537   HRESULT createAppBundleWeb([out, retval] IDispatch** app_bundle_web);
538 };
539
540 [
541   object,
542   uuid(2D363682-561D-4c3a-81C6-F2F82107562A),
543   helpstring("IGoogleUpdate3WebSecurity Interface"),
544   pointer_default(unique)
545 ]
546 interface IGoogleUpdate3WebSecurity : IUnknown {
547   HRESULT setOriginURL([in] BSTR origin_url);
548 };
549
550 [
551   object,
552   dual,
553   uuid(DD42475D-6D46-496a-924E-BD5630B4CBBA),
554   helpstring("IAppBundleWeb Interface"),
555   pointer_default(unique)
556 ]
557 interface IAppBundleWeb : IDispatch {
558   [id(2)] HRESULT createApp([in] BSTR app_guid,
559                             [in] BSTR brand_code,
560                             [in] BSTR language,
561                             [in] BSTR ap);
562   [id(3)] HRESULT createInstalledApp([in] BSTR app_id);
563   [id(4)] HRESULT createAllInstalledApps();
564
565   [propget] HRESULT displayLanguage([out, retval] BSTR*);
566   [propput] HRESULT displayLanguage([in] BSTR);
567
568   [propput] HRESULT parentHWND([in] ULONG_PTR hwnd);
569
570   [propget] HRESULT length([out, retval] int* index);
571   [id(DISPID_VALUE), propget] HRESULT appWeb(
572       [in] int index, [out, retval] IDispatch** app_web);
573
574   HRESULT initialize();
575
576   HRESULT checkForUpdate();
577   HRESULT download();
578   HRESULT install();
579
580   HRESULT pause();
581   HRESULT resume();
582   HRESULT cancel();
583
584   HRESULT downloadPackage([in] BSTR app_id, [in] BSTR package_name);
585
586   [propget] HRESULT currentState([out, retval] VARIANT* current_state);
587 };
588
589 [
590   object,
591   dual,
592   uuid(18D0F672-18B4-48e6-AD36-6E6BF01DBBC4),
593   helpstring("IAppWeb Interface"),
594   pointer_default(unique)
595 ]
596 interface IAppWeb : IDispatch {
597   [propget] HRESULT appId([out, retval] BSTR*);
598
599   // Returns an IAppVersionWeb IDispatch object.
600   [propget] HRESULT currentVersionWeb([out, retval] IDispatch** current);
601   [propget] HRESULT nextVersionWeb([out, retval] IDispatch** next);
602
603   // Returns an IAppCommandWeb IDispatch object, or NULL.
604   [propget] HRESULT command([in] BSTR command_id,
605                             [out, retval] IDispatch** command);
606
607   HRESULT cancel();
608
609   [propget] HRESULT currentState([out, retval] IDispatch** current_state);
610
611   HRESULT launch();
612   HRESULT uninstall();
613
614   [propget] HRESULT serverInstallDataIndex([out, retval] BSTR*);
615   [propput] HRESULT serverInstallDataIndex([in] BSTR);
616 };
617
618 [
619   object,
620   dual,
621   uuid(8476CE12-AE1F-4198-805C-BA0F9B783F57),
622   helpstring("IAppCommandWeb Interface"),
623   pointer_default(unique)
624 ]
625 interface IAppCommandWeb : IDispatch {
626   // Use values from the AppCommandStatus enum.
627   [propget] HRESULT status([out, retval] UINT*);
628   [propget] HRESULT exitCode([out, retval] DWORD*);
629   [propget] HRESULT output([out, retval] BSTR*);
630   HRESULT execute([in, optional] VARIANT arg1,
631                   [in, optional] VARIANT arg2,
632                   [in, optional] VARIANT arg3,
633                   [in, optional] VARIANT arg4,
634                   [in, optional] VARIANT arg5,
635                   [in, optional] VARIANT arg6,
636                   [in, optional] VARIANT arg7,
637                   [in, optional] VARIANT arg8,
638                   [in, optional] VARIANT arg9);
639 };
640
641 [
642   object,
643   dual,
644   uuid(0CD01D1E-4A1C-489d-93B9-9B6672877C57),
645   helpstring("IAppVersionWeb Interface"),
646   pointer_default(unique)
647 ]
648 interface IAppVersionWeb : IDispatch {
649   [propget] HRESULT version([out, retval] BSTR*);
650
651   // Returns the count of the Packages in the AppVersion.
652   [propget] HRESULT packageCount([out, retval] long* count);
653
654   // TODO(omaha3): Implement this after a security review.
655   // Returns an IDispatch of the Package in the AppVersion at the specified
656   // 0-based index.
657   [propget] HRESULT packageWeb([in] long index,
658                                [out, retval] IDispatch** package);
659 };
660
661 [
662   object,
663   dual,
664   uuid(2E629606-312A-482f-9B12-2C4ABF6F0B6D),
665   helpstring("ICoCreateAsyncStatus Interface"),
666   pointer_default(unique)
667 ]
668 interface ICoCreateAsyncStatus : IDispatch {
669   [propget] HRESULT isDone([out, retval] VARIANT_BOOL* is_done);
670   [propget] HRESULT completionHResult([out, retval] LONG* hr);
671   [propget] HRESULT createdInstance([out, retval] IDispatch** instance);
672 };
673
674 [
675   object,
676   uuid(DAB1D343-1B2A-47f9-B445-93DC50704BFE),
677   helpstring("ICoCreateAsync Interface"),
678   pointer_default(unique)
679 ]
680 interface ICoCreateAsync : IUnknown {
681   HRESULT createOmahaMachineServerAsync(
682       [in] BSTR origin_url,
683       [in] BOOL create_elevated,
684       [out, retval] ICoCreateAsyncStatus** status);
685 };
686
687 // END gupdatem interfaces.
688
689 // BEGIN Legacy google_update_idl interfaces.
690
691 [
692   object,
693   uuid(5B25A8DC-1780-4178-A629-6BE8B8DEFAA2),
694   oleautomation,
695   nonextensible,
696   pointer_default(unique)
697 ]
698 interface IBrowserHttpRequest2 : IUnknown {
699   // This method will send request/data from the browser process.
700   // @param url                     URL where request will be send.
701   // @param post_data               POST data, if any. Can be NULL.
702   // @param request_headers         HTTP request headers, if any. Can be NULL.
703   // @param response_headers_needed HTTP response headers that are needed.
704   //                                Should be one of the values listed here:
705   //                                    http://msdn.microsoft.com/aa385351.aspx
706   //                                The input is a SAFEARRAY of DWORD. Can be a
707   //                                VT_EMPTY.
708   // @param response_headers        HTTP response headers, returned as SAFEARRAY
709   //                                of BSTR. The values corresponding one-to-one
710   //                                with the response_headers_needed values. Can
711   //                                be NULL if response_headers_needed==VT_EMPTY
712   // @param response_code           HTTP response code.
713   // @param cache_filename          Cache file that contains the response data.
714   HRESULT Send([in] BSTR url,
715                [in] BSTR post_data,
716                [in] BSTR request_headers,
717                [in] VARIANT response_headers_needed,
718                [out] VARIANT* response_headers,
719                [out] DWORD* response_code,
720                [out] BSTR* cache_filename);
721 };
722
723 [
724   object,
725   oleautomation,
726   uuid(128C2DA6-2BC0-44c0-B3F6-4EC22E647964),
727   helpstring("Google Update IProcessLauncher Interface"),
728   pointer_default(unique)
729 ]
730 interface IProcessLauncher : IUnknown {
731   // @param cmd_line The full command line to execute.
732   HRESULT LaunchCmdLine([in, string] const WCHAR* cmd_line);
733
734   // @param browser_type The browser to start.
735   // @param url The url to launch the browser with.
736   HRESULT LaunchBrowser([in] DWORD browser_type,
737                         [in, string] const WCHAR* url);
738
739   // @param app_id Unique id to identify the calling client application
740   // @param event_id Unique id for the command
741   // @param caller_proc_id The process id of the calling process
742   // @param proc_handle The process handle valid in the caller's context
743   HRESULT LaunchCmdElevated([in, string] const WCHAR* app_guid,
744                             [in, string] const WCHAR* cmd_id,
745                             [in] DWORD caller_proc_id,
746                             [out] ULONG_PTR* proc_handle);
747 };
748
749 [
750   object,
751   oleautomation,
752   uuid(D106AB5F-A70E-400E-A21B-96208C1D8DBB),
753   helpstring("Google Update IProcessLauncher2 Interface"),
754   pointer_default(unique)
755 ]
756 interface IProcessLauncher2 : IProcessLauncher {
757   // Launches the command line, returning the COM server's process ID and
758   // handles to the launched process and its stdout. The caller is responsible
759   // for closing the returned handles (by passing DUPLICATE_CLOSE_SOURCE to
760   // DuplicateHandle, for instance).
761   // @param cmd_line The full command line to execute.
762   // @param server_proc_id The process id of the IProcessLauncher2 COM server.
763   // @param proc_handle The process handle valid in the server's context
764   // @param stdout_handle The child process's stdout handle valid in the
765   //                      server's context.
766   HRESULT LaunchCmdLineEx([in, string] const WCHAR* cmd_line,
767                           [out] DWORD* server_proc_id,
768                           [out] ULONG_PTR* proc_handle,
769                           [out] ULONG_PTR* stdout_handle);
770 };
771
772 [
773   object,
774   oleautomation,
775   uuid(5CCCB0EF-7073-4516-8028-4C628D0C8AAB),
776   helpstring("Google Update IOneClickProcessLauncher Interface"),
777   pointer_default(unique)
778 ]
779 interface IOneClickProcessLauncher : IUnknown {
780   HRESULT LaunchAppCommand([in, string] const WCHAR* app_guid,
781                            [in, string] const WCHAR* cmd_id);
782 };
783
784 typedef enum {
785   COMPLETION_CODE_SUCCESS = 1,
786   COMPLETION_CODE_SUCCESS_CLOSE_UI,
787   COMPLETION_CODE_ERROR,
788   COMPLETION_CODE_RESTART_ALL_BROWSERS,
789   COMPLETION_CODE_REBOOT,
790   COMPLETION_CODE_RESTART_BROWSER,
791   COMPLETION_CODE_RESTART_ALL_BROWSERS_NOTICE_ONLY,
792   COMPLETION_CODE_REBOOT_NOTICE_ONLY,
793   COMPLETION_CODE_RESTART_BROWSER_NOTICE_ONLY,
794   COMPLETION_CODE_RUN_COMMAND,
795 } LegacyCompletionCodes;
796
797 [
798   object,
799   oleautomation,
800   uuid(1C642CED-CA3B-4013-A9DF-CA6CE5FF6503),
801   helpstring("GoogleUpdate UI-specific events Interface"),
802   pointer_default(unique)
803 ]
804 interface IProgressWndEvents : IUnknown {
805   // The UI is closing down. The user has clicked on either the "X" or the
806   // other buttons of the UI to close the window.
807   HRESULT DoClose();
808
809   // Pause has been clicked on.
810   HRESULT DoPause();
811
812   // Resume has been clicked on.
813   HRESULT DoResume();
814
815   // RestartBrowsers button has been clicked on.
816   HRESULT DoRestartBrowsers();
817
818   // Reboot button has been clicked on.
819   HRESULT DoReboot();
820
821   // Launch Browser.
822   HRESULT DoLaunchBrowser([in, string] const WCHAR* url);
823 };
824
825
826 [
827   object,
828   oleautomation,
829   uuid(49D7563B-2DDB-4831-88C8-768A53833837),
830   helpstring("IJobObserver Interface"),
831   pointer_default(unique)
832 ]
833 interface IJobObserver : IUnknown {
834   HRESULT OnShow();
835   HRESULT OnCheckingForUpdate();
836   HRESULT OnUpdateAvailable([in, string] const WCHAR* version_string);
837   HRESULT OnWaitingToDownload();
838   HRESULT OnDownloading([in] int time_remaining_ms, [in] int pos);
839   HRESULT OnWaitingToInstall();
840   HRESULT OnInstalling();
841   HRESULT OnPause();
842   HRESULT OnComplete([in] LegacyCompletionCodes code,
843                      [in, string] const WCHAR* completion_text);
844   HRESULT SetEventSink([in] IProgressWndEvents* ui_sink);
845 };
846
847 [
848   object,
849   oleautomation,
850   uuid(19692F10-ADD2-4EFF-BE54-E61C62E40D13),
851   helpstring("IJobObserver2 Interface"),
852   pointer_default(unique)
853 ]
854 interface IJobObserver2 : IUnknown {
855   // @param time_remaining_ms Remaining install time.
856   // @param pos Current install progress in percentage from 0 to 100. -1
857   //     indicates unknown.
858   HRESULT OnInstalling2([in] int time_remaining_ms, [in] int pos);
859 };
860
861 [
862   object,
863   oleautomation,
864   uuid(31AC3F11-E5EA-4a85-8A3D-8E095A39C27B),
865   helpstring("IGoogleUpdate Interface"),
866   pointer_default(unique)
867 ]
868 interface IGoogleUpdate : IUnknown {
869   // @param guid The guid for the app to be updated.
870   // @param observer The eventing interface.
871   HRESULT CheckForUpdate([in, string] const WCHAR* guid,
872                          [in] IJobObserver* observer);
873
874   // @param guid The guid for the app to be updated.
875   // @param observer The eventing interface.
876   HRESULT Update([in, string] const WCHAR* guid,
877                  [in] IJobObserver* observer);
878 };
879
880 // IGoogleUpdateCore is an internal Omaha interface.
881 [
882   object,
883   oleautomation,
884   uuid(909489C2-85A6-4322-AA56-D25278649D67),
885   helpstring("Google Update Core Interface"),
886   pointer_default(unique)
887 ]
888 interface IGoogleUpdateCore : IUnknown
889 {
890   // Runs a command elevated.
891   //
892   // @param app_id Unique id to identify the calling client application
893   // @param event_id Unique id for the command
894   // @param caller_proc_id The process id of the calling process
895   // @param proc_handle The process handle valid in the caller's context
896   HRESULT LaunchCmdElevated([in, string] const WCHAR* app_guid,
897                             [in, string] const WCHAR* cmd_id,
898                             [in] DWORD caller_proc_id,
899                             [out] ULONG_PTR* proc_handle);
900 };
901
902 // END Legacy google_update_idl interfaces.
903
904 [
905   uuid(655DD85A-3C0D-4674-9C58-AF7168C5861E),
906   version(1.0),
907   helpstring("Google Update 3.0 Type Library")
908 ]
909 library GoogleUpdate3Lib {
910   importlib("stdole2.tlb");
911
912   // These Interfaces are forward declared to ensure that they are described in
913   // the generated TLB file. This is required for ATL to correctly implement the
914   // corresponding IDispatch interfaces.
915   interface IGoogleUpdate3;
916   interface IAppBundle;
917   interface IApp;
918   interface IApp2;
919   interface IAppCommand;
920   interface IAppCommand2;
921   interface IAppVersion;
922   interface IPackage;
923   interface ICurrentState;
924
925   interface IGoogleUpdate3Web;
926   interface IAppBundleWeb;
927   interface IAppWeb;
928   interface IAppCommandWeb;
929   interface IAppVersionWeb;
930   interface ICoCreateAsyncStatus;
931
932   [
933     uuid(022105BD-948A-40c9-AB42-A3300DDF097F),
934     helpstring("GoogleUpdate3 Class for per-user applications")
935   ]
936   coclass GoogleUpdate3UserClass {
937     [default] interface IDispatch;
938   }
939
940   [
941     uuid(4EB61BAC-A3B6-4760-9581-655041EF4D69),
942     helpstring("GoogleUpdate3 Service Class for machine applications")
943   ]
944   coclass GoogleUpdate3ServiceClass {
945     [default] interface IDispatch;
946   }
947
948   [
949     uuid(22181302-A8A6-4f84-A541-E5CBFC70CC43),
950     helpstring("GoogleUpdate3Web for user applications")
951   ]
952   coclass GoogleUpdate3WebUserClass {
953     [default] interface IDispatch;
954   }
955
956   [
957     uuid(8A1D4361-2C08-4700-A351-3EAA9CBFF5E4),
958     helpstring("Pass-through broker for the GoogleUpdate3WebServiceClass")
959   ]
960   coclass GoogleUpdate3WebMachineClass {
961     [default] interface IDispatch;
962   }
963
964   [
965     uuid(534F5323-3569-4f42-919D-1E1CF93E5BF6),
966     helpstring("GoogleUpdate3Web")
967   ]
968   coclass GoogleUpdate3WebServiceClass {
969     [default] interface IDispatch;
970   }
971
972   [
973     uuid(598FE0E5-E02D-465d-9A9D-37974A28FD42),
974     helpstring("Fallback mechanism if GoogleUpdate3WebServiceClass fails")
975   ]
976   coclass GoogleUpdate3WebMachineFallbackClass {
977     [default] interface IDispatch;
978   }
979
980   [
981     uuid(E8CF3E55-F919-49d9-ABC0-948E6CB34B9F),
982     helpstring("CurrentStateUserClass")
983   ]
984   coclass CurrentStateUserClass {
985     [default] interface ICurrentState;
986   }
987
988   [
989     uuid(9D6AA569-9F30-41ad-885A-346685C74928),
990     helpstring("CurrentStateMachineClass")
991   ]
992   coclass CurrentStateMachineClass {
993     [default] interface ICurrentState;
994   }
995
996   [
997     uuid(7DE94008-8AFD-4c70-9728-C6FBFFF6A73E),
998     helpstring("CoCreateAsyncClass")
999   ]
1000   coclass CoCreateAsyncClass {
1001     [default] interface IUnknown;
1002   }
1003
1004   [
1005     uuid(e67be843-bbbe-4484-95fb-05271ae86750),
1006     helpstring("CredentialDialogUserClass")
1007   ]
1008   coclass CredentialDialogUserClass {
1009     [default] interface IUnknown;
1010   }
1011
1012   [
1013     uuid(25461599-633d-42b1-84fb-7cd68d026e53),
1014     helpstring("CredentialDialogMachineClass")
1015   ]
1016   coclass CredentialDialogMachineClass {
1017     [default] interface IUnknown;
1018   }
1019
1020   // BEGIN Legacy google_update_idl coclasses.
1021
1022   [
1023     uuid(ABC01078-F197-4b0b-ADBC-CFE684B39C82),
1024     helpstring("ProcessLauncherClass Class")
1025   ]
1026   coclass ProcessLauncherClass {
1027     [default] interface IUnknown;
1028   }
1029
1030   [
1031     uuid(51F9E8EF-59D7-475b-A106-C7EA6F30C119),
1032     helpstring("OneClickUserProcessLauncherClass Class")
1033   ]
1034   coclass OneClickUserProcessLauncherClass {
1035     [default] interface IOneClickProcessLauncher;
1036   }
1037
1038   [
1039     uuid(AAD4AE2E-D834-46d4-8B09-490FAC9C722B),
1040     helpstring("OneClickMachineProcessLauncherClass Class")
1041   ]
1042   coclass OneClickMachineProcessLauncherClass {
1043     [default] interface IOneClickProcessLauncher;
1044   }
1045
1046   [
1047     uuid(2F0E2680-9FF5-43c0-B76E-114A56E93598),
1048     helpstring("OnDemand updates for per-user applications.")
1049   ]
1050   coclass OnDemandUserAppsClass {
1051     [default] interface IUnknown;
1052   }
1053
1054   [
1055     uuid(6F8BD55B-E83D-4a47-85BE-81FFA8057A69),
1056     helpstring("OnDemand pass-through broker for machine applications.")
1057   ]
1058   coclass OnDemandMachineAppsClass {
1059     [default] interface IUnknown;
1060   }
1061
1062   [
1063     uuid(9465B4B4-5216-4042-9A2C-754D3BCDC410),
1064     helpstring("OnDemand updates for per-machine applications.")
1065   ]
1066   coclass OnDemandMachineAppsServiceClass {
1067     [default] interface IUnknown;
1068   }
1069
1070   [
1071     uuid(B3D28DBD-0DFA-40e4-8071-520767BADC7E),
1072     helpstring("Fallback for if OnDemandMachineAppsServiceClass fails.")
1073   ]
1074   coclass OnDemandMachineAppsFallbackClass {
1075     [default] interface IUnknown;
1076   }
1077
1078   [
1079     uuid(E225E692-4B47-4777-9BED-4FD7FE257F0E),
1080     helpstring("GoogleUpdateCore Class")
1081   ]
1082   coclass GoogleUpdateCoreClass
1083   {
1084     [default] interface IUnknown;
1085   }
1086
1087   [
1088     uuid(9B2340A0-4068-43d6-B404-32E27217859D),
1089     helpstring("GoogleUpdateCore Machine Class")
1090   ]
1091   coclass GoogleUpdateCoreMachineClass
1092   {
1093     [default] interface IUnknown;
1094   }
1095
1096   // END Legacy google_update_idl coclasses.
1097 };