summaryrefslogtreecommitdiff
path: root/desktop/hotlist.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-12-29 14:44:48 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2016-12-29 14:44:48 +0000
commitb6be869f19994070ec522d19455ea7eb47965be4 (patch)
tree24ca43ab57a53321fa52a50e2b18bd993ff76399 /desktop/hotlist.h
parentded1979fa1b77ea6261df7a7f6f9177bde433f2d (diff)
downloadnetsurf-b6be869f19994070ec522d19455ea7eb47965be4.tar.gz
netsurf-b6be869f19994070ec522d19455ea7eb47965be4.tar.bz2
Hotlist: Allow hotlist initilialisation without hotlist corewindow.
Now, hotlist_init can be called without a corewindow. This allows the hotlist backend to be up and running, before any hostlist manager is opened. Calling hotlist_manager_init attaches the hotlist to a corewindow.
Diffstat (limited to 'desktop/hotlist.h')
-rw-r--r--desktop/hotlist.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index 31aa0307c..c77ac92d2 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -33,18 +33,44 @@ struct rect;
/**
* Initialise the hotlist.
*
- * This opens the hotlist file, generating the hotlist data, and creates a
+ * This opens the hotlist file, construct the hostlist, and creates a
* treeview. If there's no hotlist file, it generates a default hotlist.
*
- * This must be called before any other hotlist_* function.
+ * This must be called before any other hotlist_* function. It must
+ * be called before URLs can be added to the hotlist, and before the
+ * hotlist can be queried to ask if URLs are present in the hotlist.
+ *
+ * \param path The path to hotlist file to load
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror hotlist_init(const char *path);
+
+/**
+ * Initialise the hotlist manager.
+ *
+ * This connects the underlying hotlist treeview to a corewindow for display.
+ *
+ * The provided core window handle must be valid until hotlist_fini is called.
*
* \param cw_t Callback table for core_window containing the treeview
* \param core_window_handle The handle in which the treeview is shown
- * \param path The path to hotlist file to load
* \return NSERROR_OK on success, appropriate error otherwise
*/
-nserror hotlist_init(struct core_window_callback_table *cw_t,
- void *core_window_handle, const char *path);
+nserror hotlist_manager_init(struct core_window_callback_table *cw_t,
+ void *core_window_handle);
+
+
+/**
+ * Finalise the hotlist manager.
+ *
+ * This simply disconnects the underlying treeview from its corewindow,
+ * allowing destruction of a GUI hotlist window, without finalising the
+ * hotlist module.
+ *
+ * \param path The path to save hotlist to
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror hotlist_manager_fini(void);
/**
* Finalise the hotlist.