#ifndef IDAV_SETTINGS_H
#define IDAV_SETTINGS_H
#include "application.h"
#include "config.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SettingsWindow {
UiObject *obj;
DavConfig *config;
PwdStore *pwdstore;
UiList *repos;
UiInteger *repo_tabview;
DavBool repo_new;
UiString *repo_name;
UiString *repo_url;
UiList *repo_credentials;
UiString *repo_user;
UiString *repo_password;
UiInteger *repo_encryption;
UiList *repo_keys;
UiList *repo_tls_versions;
UiString *repo_cacert;
UiInteger *repo_disable_verification;
DavBool credentials_new;
DavBool credentials_modified;
DavBool credentials_list_needs_update;
DavBool credentials_ignore_selectionevent;
char *credentials_selected_id;
int credentials_selected_index;
int credentials_location_selected_index;
UiList *credentials_users;
UiString *credentials_id;
UiString *credentials_user;
UiString *credentials_password;
UiList *credentials_locations;
UiList *keys_list;
UiString *key_name;
UiString *key_file;
UiString *key_type;
UiInteger *key_secretstore;
int keys_selected_index;
int selected_repo;
} SettingsWindow;
typedef struct SettingsNewKeyDialog {
SettingsWindow *settings;
UiString *name;
UiString *file;
UiString *import_path;
UiString *message;
UiList *type;
UiInteger *secretstore;
DavBool add_to_repo;
} SettingsNewKeyDialog;
typedef struct SettingsNewCredentialsDialog {
SettingsWindow *settings;
UiString *id;
UiString *user;
UiString *password;
UiInteger *addlocation;
UiString *message;
char *url;
} SettingsNewCredentialsDialog;
void settings_window_open();
void settings_credentials_decrypt(SettingsWindow *settings);
void settings_ok(UiEvent *event,
void *userdata);
void settings_cancel(UiEvent *event,
void *userdata);
void settings_init(UiObject *obj, SettingsWindow *settings);
void settings_edit_repository(SettingsWindow *settings,
int repo_index);
void settings_store_repository(SettingsWindow *settings);
void settings_clear_repository(SettingsWindow *settings);
void settings_update_repolist(SettingsWindow *settings);
void* settings_repolist_getvalue(DavCfgRepository *repo,
int col);
void settings_reload_repo_keys(SettingsWindow *settings);
void settings_reload_keys(SettingsWindow *settings);
const char* dav_tlsversion2str(
int value);
void settings_reload_credentials(SettingsWindow *settings);
void settings_reload_repo_credentials(SettingsWindow *settings);
void settings_credentials_select(SettingsWindow *settings,
const char *id);
void settings_credentials_clear(SettingsWindow *settings);
int settings_credentials_save(SettingsWindow *settings);
void *keylist_getvalue(
void *data,
int col);
void settings_edit_key(SettingsWindow *settings, DavCfgKey *key);
void settings_clear_key(SettingsWindow *settings);
#ifdef __cplusplus
}
#endif
#endif