4#include "DiskUsage.hpp"
5#include "DittoConfig.hpp"
9#include "SmallPeerInfo.hpp"
10#include "TransportConfig.hpp"
22class AuthenticationStatusHandler;
40 friend class AttachmentFetcher;
41 friend class AttachmentFetcherCtx;
42 friend class AuthenticationStatusHandler;
43 friend class AuthenticationStatusHandlerCtx;
44 friend class Authenticator;
45 friend class Collection;
47 friend class StoreObserver;
49 friend class SyncSubscription;
56 static std::shared_ptr<Ditto>
68 static std::future<std::shared_ptr<Ditto>>
82 Ditto(jobject android_context,
84 std::string persistence_dir =
"");
88 std::string persistence_dir =
"");
98 DITTO_DEPRECATED_BECAUSE(
"Assigning one Ditto instance to another is not "
99 "supported. Create a new instance instead.")
136 DITTO_DEPRECATED_BECAUSE(
"Use get_sync() instead") Sync &
sync() const;
482 DITTO_DEPRECATED_BECAUSE(
483 "Use the Ditto constructor's `android_context` parameter instead")
484 void set_android_context(JNIEnv *env, jobject context);
503 std::vector<std::
string> missing_permissions() const;
519 jobjectArray missing_permissions_jni_array() const;
525 std::shared_ptr<Fields> fields;
530 explicit Ditto(std::shared_ptr<Fields> fields);
532 void set_is_closable(
bool is_closable);
533 std::shared_ptr<DittoHandleWrapper> get_handle_wrapper();
535 friend struct StoreObserverCtx;
536 friend struct ::ditto::internal::DittoUnitTest;
538 static std::shared_ptr<Ditto> open_ditto_with_config(
DittoConfig config);
Provides access to authentication information and methods for logging on to Ditto Cloud....
Definition Authenticator.hpp:34
Provides an interface to be able to monitor local files.
Definition DiskUsage.hpp:66
Sync & get_sync() const
Provides access to the SDK's sync functionality.
TransportConfig get_transport_config() const
Returns the current transport config.
void stop_sync() const
Stops all network transports.
DittoConfig get_config() const
Returns the configuration used to initialize this Ditto instance.
void set_transport_config(TransportConfig config)
Assign a new transports configuration.
void run_garbage_collection() const
Removes all sync metadata for any remote peers which aren't currently connected.
void disable_sync_with_v3() const
Disable sync with peers running version 3 or lower of the Ditto SDK.
static std::string default_root_directory()
Returns the default root directory where Ditto stores its data.
bool get_is_sync_active() const
Returns a flag indicating whether or not sync is active. Use start_sync to activate sync and stop_syn...
static bool get_emoji_log_level_headings_enabled()
Gets whether or not emoji log level headings are enabled for Ditto.
std::string get_app_id() const
Get the Ditto application Id.
Sync & sync() const
Provides access to the SDK's sync functionality.
void set_device_name(std::string const &name)
Set a custom identifier for the current device.
static bool get_logging_enabled()
Gets whether or not logging is enabled for Ditto.
DiskUsage & get_disk_usage() const
Provides access to the SDK's disk usage.
static std::string get_sdk_version()
Returns a string identifying the version of the Ditto SDK.
Presence & get_presence() const
Provides access to the SDK's presence functionality.
static std::shared_ptr< Ditto > open(DittoConfig config=DittoConfig::default_config())
Create a new Ditto instance.
static void set_logging_enabled(bool enabled)
Sets whether or not logging is enabled for Ditto.
SmallPeerInfo & get_small_peer_info() const
Provides access to the SDK's Small Peer Info functionality.
PresenceObserver observe_peers(PresenceCallback cb)
Request information about Ditto peers in range of this device.
static LogLevel get_minimum_log_level()
Gets the minimum log level at which logs will be emitted for Ditto.
Ditto(std::shared_ptr< Identity > identity=Identity::OfflinePlayground(), std::string persistence_dir="")
Initializes a new Ditto instance.
void update_transport_config(std::function< void(TransportConfig &config)> lambda)
Convenience method to update the current transport config of the receiver.
static std::future< std::shared_ptr< Ditto > > open_async(DittoConfig config=DittoConfig::default_config())
Create a new Ditto instance asynchronously.
void set_offline_only_license_token(std::string license_token)
Activate an offline Ditto instance by setting a license token. You cannot initiate sync on an offline...
void close()
Shut down Ditto and release all resources. Must be called before recreating a Ditto instance that use...
Store & get_store() const
Provides access to the SDK's store functionality.
void start_sync() const
Starts the network transports. Ditto will connect to other devices and sync with them where appropria...
static void set_emoji_log_level_headings_enabled(bool enabled)
Sets whether or not emoji log level headings are enabled for Ditto.
std::shared_ptr< Authenticator > get_auth() const
Provides access to authentication information and methods for logging on to Ditto Cloud.
bool get_is_activated() const
Returns a flag indicating whether or not the Ditto instance has been activated by a successful call t...
std::string get_absolute_persistence_directory() const
The absolute path to the persistence directory used by Ditto to persist data.
std::string get_persistence_directory() const
The persistence directory used by Ditto to persist data.
static void set_minimum_log_level(LogLevel log_level)
Sets the minimum log level at which logs should be emitted for Ditto.
static std::shared_ptr< OfflinePlaygroundIdentity > OfflinePlayground(std::string app_id="")
Construct a new OfflinePlaygroundIdentity.
Definition Presence.hpp:33
The entrypoint for small peer user info collection.
Definition SmallPeerInfo.hpp:30
Provides access to Collections and a transaction API.
Definition Store.hpp:65
Definition StoreObserver.hpp:43
A sync subscription configures Ditto to receive updates from remote peers about documents matching th...
Definition SyncSubscription.hpp:20
A configuration object specifying which network transports Ditto should use to sync data.
Definition TransportConfig.hpp:374
Namespace for internal Ditto SDK functionality.
Definition Ditto.hpp:29
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
LogLevel
The log levels that the Ditto SDK supports.
Definition LogLevel.hpp:9
std::function< void(PresenceGraph)> PresenceCallback
A type representing a callback that will get called when there are updates relating to presence.
Definition Presence.hpp:26
Configuration options for initializing a Ditto instance.
Definition DittoConfig.hpp:30
static DittoConfig default_config()
Get a usable default configuration.