#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/BBLCloudServiceAgent.hpp>
Public Member Functions | |
| BBLCloudServiceAgent () | |
| ~BBLCloudServiceAgent () override | |
| std::string | get_id () const override |
| int | init_log () override |
| int | set_config_dir (std::string config_dir) override |
| int | set_cert_file (std::string folder, std::string filename) override |
| int | set_country_code (std::string country_code) override |
| int | start () override |
| int | change_user (std::string user_info) override |
| bool | is_user_login () override |
| int | user_logout (bool request=false) override |
| std::string | get_user_id () override |
| std::string | get_user_name () override |
| std::string | get_user_avatar () override |
| std::string | get_user_nickname () override |
| std::string | build_login_cmd () override |
| std::string | build_logout_cmd () override |
| std::string | build_login_info () override |
| std::string | get_access_token () const override |
| std::string | get_refresh_token () const override |
| bool | ensure_token_fresh (const std::string &reason) override |
| std::string | get_cloud_service_host () override |
| std::string | get_cloud_login_url (const std::string &language="") override |
| int | connect_server () override |
| bool | is_server_connected () override |
| int | refresh_connection () override |
| int | start_subscribe (std::string module) override |
| int | stop_subscribe (std::string module) override |
| int | add_subscribe (std::vector< std::string > dev_list) override |
| int | del_subscribe (std::vector< std::string > dev_list) override |
| void | enable_multi_machine (bool enable) override |
| int | get_user_presets (std::map< std::string, std::map< std::string, std::string > > *user_presets) override |
| std::string | request_setting_id (std::string name, std::map< std::string, std::string > *values_map, unsigned int *http_code) override |
| int | put_setting (std::string setting_id, std::string name, std::map< std::string, std::string > *values_map, unsigned int *http_code, bool force=false) override |
| int | get_setting_list (std::string bundle_version, ProgressFn pro_fn=nullptr, WasCancelledFn cancel_fn=nullptr) override |
| int | get_setting_list2 (std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn=nullptr, WasCancelledFn cancel_fn=nullptr) override |
| int | delete_setting (std::string setting_id) override |
| int | get_my_message (int type, int after, int limit, unsigned int *http_code, std::string *http_body) override |
| int | check_user_task_report (int *task_id, bool *printable) override |
| int | get_user_print_info (unsigned int *http_code, std::string *http_body) override |
| int | get_user_tasks (TaskQueryParams params, std::string *http_body) override |
| int | get_printer_firmware (std::string dev_id, unsigned *http_code, std::string *http_body) override |
| int | get_task_plate_index (std::string task_id, int *plate_index) override |
| int | get_user_info (int *identifier) override |
| int | get_subtask_info (std::string subtask_id, std::string *task_json, unsigned int *http_code, std::string *http_body) override |
| int | get_slice_info (std::string project_id, std::string profile_id, int plate_index, std::string *slice_json) override |
| int | query_bind_status (std::vector< std::string > query_list, unsigned int *http_code, std::string *http_body) override |
| int | modify_printer_name (std::string dev_id, std::string dev_name) override |
| int | get_camera_url (std::string dev_id, std::function< void(std::string)> callback) override |
| int | get_design_staffpick (int offset, int limit, std::function< void(std::string)> callback) override |
| int | start_publish (PublishParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, std::string *out) override |
| int | get_model_publish_url (std::string *url) override |
| int | get_subtask (BBLModelTask *task, OnGetSubTaskFn getsub_fn) override |
| int | get_model_mall_home_url (std::string *url) override |
| int | get_model_mall_detail_url (std::string *url, std::string id) override |
| int | get_my_profile (std::string token, unsigned int *http_code, std::string *http_body) override |
| int | get_my_token (std::string ticket, unsigned int *http_code, std::string *http_body) override |
| int | track_enable (bool enable) override |
| int | track_remove_files () override |
| int | track_event (std::string evt_key, std::string content) override |
| int | track_header (std::string header) override |
| int | track_update_property (std::string name, std::string value, std::string type="string") override |
| int | track_get_property (std::string name, std::string &value, std::string type="string") override |
| bool | get_track_enable () override |
| int | put_model_mall_rating (int design_id, int score, std::string content, std::vector< std::string > images, unsigned int &http_code, std::string &http_error) override |
| int | get_oss_config (std::string &config, std::string country_code, unsigned int &http_code, std::string &http_error) override |
| int | put_rating_picture_oss (std::string &config, std::string &pic_oss_path, std::string model_id, int profile_id, unsigned int &http_code, std::string &http_error) override |
| int | get_model_mall_rating_result (int job_id, std::string &rating_result, unsigned int &http_code, std::string &http_error) override |
| int | get_mw_user_preference (std::function< void(std::string)> callback) override |
| int | get_mw_user_4ulist (int seed, int limit, std::function< void(std::string)> callback) override |
| std::string | get_version () override |
| int | set_on_server_connected_fn (AppOnServerConnectedFn fn) override |
| int | set_on_http_error_fn (AppOnHttpErrorFn fn) override |
| int | set_get_country_code_fn (GetCountryCodeFn fn) override |
| int | set_queue_on_main_fn (QueueOnMainFn fn) override |
| virtual std::unique_ptr< ICameraSignalingChannel > | create_camera_signaling_channel (const std::string &dev_id) |
Private Member Functions | |
| int | set_extra_http_header () |
Static Private Member Functions | |
| static std::map< std::string, std::string > | get_extra_header () |
Private Attributes | |
| bool | m_enable_track {false} |
| AppOnServerConnectedFn | m_app_on_server_connected_fn |
| AppOnHttpErrorFn | m_app_on_http_error_fn |
BBLCloudServiceAgent - BBL DLL wrapper implementation of ICloudServiceAgent.
Delegates all cloud service and authentication operations to the proprietary BBL network DLL through function pointers obtained from BBLNetworkPlugin singleton. This class combines the functionality of the former BBLAuthAgent and BBLCloudServiceAgent.
|
default |
|
overridedefault |
|
overridevirtual |
Subscribe to push streams for specific device identifiers.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Build a JSON command for the WebView login flow. Contains backend URL, API key, and PKCE parameters.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return a JSON snapshot of the active session (user info, no tokens). Used by WebView to display current user state.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Build a JSON command for WebView logout.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Authenticate the user with the provided JSON payload.
Supported formats:
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Check for pending task reports.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Perform a health check against the configured backend. Updates is_server_connected() state and triggers OnServerConnectedFn.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
inlinevirtualinherited |
Create a camera signaling channel object for P2P camera streaming over WebRTC.
|
overridevirtual |
Remove device-level subscriptions.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Delete a remote preset.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Enable or disable multi-machine mode.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Ensure the access token is fresh, refreshing if necessary. Call before making API requests to avoid 401 errors.
| reason | Descriptive string for logging (e.g., "connect_server") |
Implements Slic3r::ICloudServiceAgent.
|
overridevirtual |
Return the current access token for API calls. Cloud and printer agents use this for Authorization headers.
Implements Slic3r::ICloudServiceAgent.
|
overridevirtual |
Request live camera streaming URL.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the login URL for the cloud service.
| language | Optional language code (e.g., "en-US", "zh-CN") for localized login page. If empty, returns the default (non-localized) login URL. |
Implements Slic3r::ICloudServiceAgent.
References get_cloud_service_host().
|
overridevirtual |
Return the base hostname for cloud API calls (varies by region). Helpful for diagnostics and when building browser URLs.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by get_cloud_login_url().
|
overridevirtual |
Fetch staff-picked designs from model mall.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance(), and Slic3r::offset().
|
staticprivate |
References Slic3r::extra_headers.
Referenced by set_extra_http_header().
|
inlineoverridevirtual |
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBL_CLOUD_PROVIDER().
|
overridevirtual |
Build model detail page URL.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Get model mall home URL.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Poll for rating result.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Get model publish URL.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Retrieve MakerWorld "For You" list.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch MakerWorld user preferences.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Retrieve inbox/notification messages.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Retrieve user's model mall profile.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Exchange a one-time login ticket (from a third-party OAuth callback) for token + profile JSON. Used by the localhost callback handler when the auth server redirects with ?ticket=...&redirect_url=... instead of passing tokens directly in the URL.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Get OSS configuration for image uploads.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch firmware information for a printer.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the current refresh token (if available).
Implements Slic3r::ICloudServiceAgent.
|
overridevirtual |
Trigger bulk download of user presets.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Enhanced preset sync with per-item validation.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Retrieve slicing job info.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch publishing subtask information.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch subtask information.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Get plate index for a cloud task.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Check if tracking is enabled.
Implements Slic3r::ICloudServiceAgent.
References m_enable_track.
|
overridevirtual |
Return the avatar URL/path for the current user.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the backend-generated user ID for the current session.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Retrieve extended user profile info.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the display name for the current user.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the nickname for the current user.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch all presets owned by the logged-in user.
| user_presets | Map populated with [type][setting_id] = json |
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Fetch aggregated print statistics.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Query user's tasks/prints.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Return the version of the cloud service implementation.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Initialize the logging backend for the agent. Call after set_config_dir() so logs have a destination.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Return whether the server is currently reachable.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Check whether a valid authenticated session exists.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Update printer name in cloud profile.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Submit a review for a marketplace design.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Upload rating images to OSS.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Update or create a preset with a known setting_id.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Query binding status for multiple devices.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Force a server state recheck, clearing any cached state. The result arrives through is_server_connected() and OnServerConnectedFn. Implementations may return before the check finishes, fold the call into a check already in flight, and ignore calls while the agent is shutting down.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Request a new preset identifier from the server.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Register the client certificate file for TLS authentication. May be unused by some implementations (e.g., OrcaCloudServiceAgent).
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Provide the writable configuration directory for storing auth state. Must be called before start().
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Set the country code for region-specific backend selection.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
private |
References Slic3r::extra_headers, get_extra_header(), and Slic3r::BBLNetworkPlugin::instance().
Referenced by start().
|
overridevirtual |
Provide country code getter callback.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Register HTTP error callback.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBL_CLOUD_PROVIDER(), Slic3r::BBLNetworkPlugin::instance(), and m_app_on_http_error_fn.
|
overridevirtual |
Register server connection status callback.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBL_CLOUD_PROVIDER(), Slic3r::BBLNetworkPlugin::instance(), and m_app_on_server_connected_fn.
|
overridevirtual |
Provide main thread queue callback.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Start the agent, performing any expensive initialization. Typically regenerates PKCE bundles and attempts silent sign-in.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance(), and set_extra_http_header().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Run multi-stage publishing workflow.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Subscribe to a logical module (e.g., "printer", "user").
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance(), and Slic3r::module().
|
overridevirtual |
Stop listening to a formerly subscribed module.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance(), and Slic3r::module().
|
overridevirtual |
Enable/disable telemetry.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance(), and m_enable_track.
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Report a custom analytics event.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Read a tracked user property.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Set telemetry headers.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Delete telemetry files.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
Referenced by Slic3r::GUI::GUI_App::on_init_network().
|
overridevirtual |
Update a tracked user property.
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
overridevirtual |
Terminate the current session.
| request | If true, also notify the backend to invalidate the session. |
Implements Slic3r::ICloudServiceAgent.
References Slic3r::BBLNetworkPlugin::instance().
|
private |
Referenced by set_on_http_error_fn().
|
private |
Referenced by set_on_server_connected_fn().
|
private |
Referenced by get_track_enable(), and track_enable().