1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import "oaidl.idl";
6import "ocidl.idl";
7
8[
9  object,
10  uuid(e051a481-6345-4ba1-bdb1-cf7929955268),
11  dual,
12  nonextensible,
13  helpstring("IDaemonControl Interface"),
14  pointer_default(unique)
15]
16interface IDaemonControl : IDispatch {
17  [ id(1), helpstring("Returns a filtered copy of the daemon's configuration. "
18                      "Only 'host_id' and 'xmpp_login' values are returned, "
19                      "because any other values may contain security-sensitive "
20                      "information.") ]
21  HRESULT GetConfig([out, retval] BSTR* config_out);
22
23  [ id(2), helpstring("Returns a string representing the version of "
24                      "the daemon.") ]
25  HRESULT GetVersion([out, retval] BSTR* version_out);
26
27  [ id(3), helpstring("Replaces the existing daemon's configuration with "
28                      "the specified settings.") ]
29  HRESULT SetConfig([in] BSTR config);
30
31  [ id(4), helpstring("Sets the owner window for any windows shown by "
32                      "the daemon controller.") ]
33  HRESULT SetOwnerWindow([in] LONG_PTR owner_window);
34
35  [ id(5), helpstring("Starts the daemon.") ]
36  HRESULT StartDaemon();
37
38  [ id(6), helpstring("Stops the daemon.") ]
39  HRESULT StopDaemon();
40
41  [ id(7), helpstring("Modifies the existing daemon's configuration by "
42                      "merging it with the specified settings. The 'host_id' "
43                      "and 'xmpp_login' values cannot be modified, and must "
44                      "not be passed to this method.") ]
45  HRESULT UpdateConfig([in] BSTR config);
46};
47
48[
49  object,
50  uuid(655bd819-c08c-4b04-80c2-f160739ff6ef),
51  dual,
52  nonextensible,
53  helpstring("IDaemonControl2 Interface"),
54  pointer_default(unique)
55]
56interface IDaemonControl2 : IDaemonControl {
57  [ id(8), helpstring("Retrieves the user's consent to collect crash dumps "
58                      "and gather usage statistics.") ]
59  HRESULT GetUsageStatsConsent([out] BOOL* allowed,
60                               [out] BOOL* set_by_policy);
61
62  [ id(9), helpstring("Records the user's consent to collect crash dumps "
63                      "and gather usage statistics.") ]
64  HRESULT SetUsageStatsConsent([in] BOOL allowed);
65};
66
67[
68  object,
69  uuid(b59b96da-83cb-40ee-9b91-c377400fc3e3),
70  nonextensible,
71  helpstring("IRdpDesktopSessionEventHandler Interface"),
72  pointer_default(unique)
73]
74interface IRdpDesktopSessionEventHandler : IUnknown {
75  [ id(1), helpstring("Notifies that an RDP connection has been established "
76                      "successfully.") ]
77  HRESULT OnRdpConnected();
78
79  [ id(2), helpstring("Notifies the delegate that the RDP connection has been "
80                      "closed.") ]
81  HRESULT OnRdpClosed();
82};
83
84[
85  object,
86  uuid(6a7699f0-ee43-43e7-aa30-a6738f9bd470),
87  nonextensible,
88  helpstring("IRdpDesktopSession Interface"),
89  pointer_default(unique)
90]
91interface IRdpDesktopSession : IUnknown {
92  [ id(1), helpstring("Initiates a loopback RDP connection to spawn a new "
93                      "Windows session. |width| and |height| specify the "
94                      "initial screen resolution. |terminal_id| specifies a "
95                      "unique value to be used to identify this connection.") ]
96  HRESULT Connect([in] long width, [in] long height, [in] BSTR terminal_id,
97                  [in] IRdpDesktopSessionEventHandler* event_handler);
98
99  [ id(2), helpstring("Shuts down the connection created by Connect().") ]
100  HRESULT Disconnect();
101
102  [ id(3), helpstring("Changes the screen resolution.") ]
103  HRESULT ChangeResolution([in] long width, [in] long height);
104
105  [ id(4), helpstring("Sends Secure Attention Sequence to the session.") ]
106  HRESULT InjectSas();
107};
108
109[
110  uuid(b6396c45-b0cc-456b-9f49-f12964ee6df4),
111  version(1.0),
112  helpstring("Chromoting 1.0 Type Library")
113]
114library ChromotingLib {
115  importlib("stdole2.tlb");
116
117  [
118    uuid(@DAEMON_CONTROLLER_CLSID@),
119    helpstring("ElevatedController Class")
120  ]
121  coclass ElevatedController {
122    [default] interface IDaemonControl2;
123  };
124
125  [
126    uuid(@RDP_DESKTOP_SESSION_CLSID@),
127    helpstring("RdpDesktopSession Class")
128  ]
129  coclass RdpDesktopSession {
130    [default] interface IRdpDesktopSession;
131  };
132};
133