QtDataSync
4.2.0
A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
|
The keystore plugin to be implemented to provide custom keystores. More...
#include <keystore.h>
Public Member Functions | |
virtual bool | keystoreAvailable (const QString &provider) const =0 |
Check if the keystore type identified by the provider is currently accessible. More... | |
virtual KeyStore * | createInstance (const QString &provider, const Defaults &defaults, QObject *parent=nullptr)=0 |
Create an instance of a keystore for the given provider and parent. More... | |
The keystore plugin to be implemented to provide custom keystores.
The plugin that must be implemented to create a KeyStore plugin. The plugins IID is QtDataSync_KeyStorePlugin_Iid. The plugin most have a json file with the following layout:
Each string in the Keys
array is the name of a kind of keystore that is provided from that plugin. Most plugins provide onyl one type of keystore, so for most cases you have only 1 element in the list. Please note that the plugin must be able to handle all these providers when passed to it's methods.
For more details on how to implement such a plugin, have a look at: The High-Level API: Writing Qt Extensions
Definition at line 78 of file keystore.h.
|
pure virtual |
Create an instance of a keystore for the given provider and parent.
provider | The type of keystore to be created |
defaults | The defaults of the current datasync instance. Shoudl be passed to the keystore constructor |
parent | The parent for the keystore. Should be set as the QObject::parent of the newly created keystore |
This method must be threadsafe
After the availablility of a provider has been checked via keystoreAvailable(), this method is called to actually create an instance. You should always return a valid keystore for all valid providers, and don't need to perform additional validity checks. It is save to return nullptr
in case the store cannot be created. The providers passed to this method are the ones defined in the json file.
|
pure virtual |
Check if the keystore type identified by the provider is currently accessible.
provider | The provider type the check |
true
if the keystore backend for the given provider is available, false
if not.This method must be threadsafe
This method should check if the given keystore is accessible, i.e. if the user has enabled it. If a keystore is available, it should be possible to open and use it without any errors (assuming the user allows access for keystores that have it). The providers passed to this method are the ones defined in the json file.