Top | ![]() |
![]() |
![]() |
![]() |
EWebExtensionContainer * | e_web_extension_container_new () |
const gchar * | e_web_extension_container_get_object_path () |
const gchar * | e_web_extension_container_get_interface_name () |
const gchar * | e_web_extension_container_get_server_guid () |
const gchar * | e_web_extension_container_get_server_address () |
gint | e_web_extension_container_reserve_stamp () |
GDBusProxy * | e_web_extension_container_ref_proxy () |
void | e_web_extension_container_forget_stamp () |
void | e_web_extension_container_call_simple () |
void | e_web_extension_container_utils_connect_to_server () |
GDBusConnection * | e_web_extension_container_utils_connect_to_server_finish () |
gchar * | interface-name | Read / Write / Construct Only |
gchar * | object-path | Read / Write / Construct Only |
EWebExtensionContainer is a container of WebKitGTK+ Web Extensions, which runs a D-Bus server to which the Web Extensions can connect. This object is meant for the client side. It also takes care of all the connections and corresponding GDBusProxy objects.
The Web Extension part can use e_web_extension_container_utils_connect_to_server()
to connect to it.
EWebExtensionContainer * e_web_extension_container_new (const gchar *object_path
,const gchar *interface_name
);
Creates a new EWebExtensionContainer, which opens a new D-Bus server
for the given object_path
. If any such already exists, then it is returned
instead.
The interface_name
is used for the e_web_extension_container_call_simple()
and for the GDBusProxy instances managed by this object.
a new EWebExtensionContainer. Free it with
g_object_unref()
, when no longer needed.
[transfer full]
Since: 3.36
const gchar *
e_web_extension_container_get_object_path
(EWebExtensionContainer *container
);
Since: 3.36
const gchar *
e_web_extension_container_get_interface_name
(EWebExtensionContainer *container
);
Since: 3.36
const gchar *
e_web_extension_container_get_server_guid
(EWebExtensionContainer *container
);
a GUID of the D-Bus server this container
created,
or NULL
, when no server is running.
[nullable]
Since: 3.36
const gchar *
e_web_extension_container_get_server_address
(EWebExtensionContainer *container
);
Returns an address of the created D-Bus server. There can be used
e_web_extension_container_utils_connect_to_server()
to connect to it.
an address of the D-Bus server this container
created,
or NULL
, when no server is running.
[nullable]
Since: 3.36
gint
e_web_extension_container_reserve_stamp
(EWebExtensionContainer *container
);
Since: 3.36
GDBusProxy * e_web_extension_container_ref_proxy (EWebExtensionContainer *container
,guint64 page_id
,gint stamp
);
Tries to search for a GDBusProxy, which currently handles a Web Extension
with page_id
and stamp
. The owner should listen to page-proxy-changed signal,
to know when the proxy for the page changes.
Free the returned proxy, if not NULL, with g_object_unref()
,
when no longer needed.
container |
||
page_id |
a page ID, as returned by |
|
stamp |
a stamp of a Web Extension to look for |
Since: 3.36
void e_web_extension_container_forget_stamp (EWebExtensionContainer *container
,gint stamp
);
The owner of container
can call this function to free any resources
related to stamp
, indicating that this stamp
is no longer used.
Since: 3.36
void e_web_extension_container_call_simple (EWebExtensionContainer *container
,guint64 page_id
,gint stamp
,const gchar *method_name
,GVariant *params
);
Either calls asynchronously the D-Bus method named method_name
with
parameters params
immediately, when there exists a GDBusProxy for
the given page_id
and stamp
, or remembers this call and calls
it as soon as the GDBusProxy is created. The method_name
should
be part of the interface this container
had been created for.
The D-Bus call is made asynchronously. If there are more pending calls, then they are made in the order they had been added by this function.
container |
||
page_id |
a page ID, as returned by |
|
stamp |
a stamp of a Web Extension to look for |
|
method_name |
a D-Bus method name |
|
params |
optional parameters for the D-Bus method. |
[nullable] |
Since: 3.36
void e_web_extension_container_utils_connect_to_server (const gchar *server_address
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
This is only a wrapper around g_dbus_connection_new_for_address()
,
setting a GDBusObserver, which will authorize a peer the same
way the preview or composer server expects it.
Call e_web_extension_container_utils_connect_to_server_finish()
to finish
the request from the callback
.
server_address |
a D-Bus server address to connect to |
|
cancellable |
optional GCancellable object, or |
|
callback |
a GAsyncReadyCallback to call when the request is satisfied |
|
user_data |
the user data to pass to |
Since: 3.36
GDBusConnection * e_web_extension_container_utils_connect_to_server_finish (GAsyncResult *result
,GError **error
);
Finishes call of e_web_extension_container_utils_connect_to_server()
.
Free the returned connection, if not NULL
, with g_object_unref()
,
when no longer needed.
result |
a GAsyncResult obtained from GAsyncReadyCallback passed
to |
|
error |
return location for a GError, or |
Since: 3.36
“interface-name”
property “interface-name” gchar *
Owner: EWebExtensionContainer
Flags: Read / Write / Construct Only
Default value: NULL
“page-proxy-changed”
signalvoid user_function (EWebExtensionContainer *page_id, guint64 stamp, gint proxy, GDBusProxy *arg3, gpointer user_data)
A signal emitted whenever a proxy for the given page_id
and
stamp
changes. The proxy
can be NULL
, which means the previous
proxy disappeared.
page_id |
a page ID |
|
stamp |
a stamp |
|
proxy |
a GDBusProxy or |
[nullable] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.36