From dff192e3bd6d5737633a740988c31e4ecba92998 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 22 May 2024 20:06:24 -0400 Subject: Add background task example plugin Clarify BackgroundTask functionality (skip-note, skip-ci) Providing clear documentation so it is understood that background tasks do not manage the execution of said the task. Add background_task plugin to examples section --- binaryninjaapi.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 364eb564..d2cf74d2 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -15513,8 +15513,20 @@ namespace BinaryNinja { public CoreRefCountObject { public: - BackgroundTask(BNBackgroundTask* task); - BackgroundTask(const std::string& initialText, bool canCancel); + BackgroundTask(BNBackgroundTask *task); + + /*! + Provides a mechanism for reporting progress of + an optionally cancelable task to the user via the status bar in the UI. + If canCancel is is `True`, then the task can be cancelled either + programmatically or by the user via the UI. + + \note This API does not provide a means to execute a task. The caller is responsible to execute (and possibly cancel) the task. + + \param initialText Text description of the progress of the background task (displayed in status bar of the UI) + \param canCancel Whether the task can be cancelled + */ + BackgroundTask(const std::string &initialText, bool canCancel); bool CanCancel() const; bool IsCancelled() const; -- cgit v1.3.1