/* This file is part of GPump, a Pump.io client.
 *
 * GPump (THE SOFTWARE) is made available under the terms and conditions of the
 * GNU Lesser General Public Licence 3.0. A copy of the licence can be read
 * in the file lgpl-3.0.txt in the root of this project.
 */


const Secret = imports.gi.Secret;
const Lang = imports.lang;


let _default_account_data_object = null;

/** @file
 * More information on what is going on here can be found here:
 * https://developer.gnome.org/libsecret/unstable/js-examples.html
 */

/** @function
 * Get the default AccountData object.
 */
function get_account_data () {
  if (!_default_account_data_object) {
    _default_account_data_object = new AccountData ();
  }
  return _default_account_data_object;
}

/**
 * The libsecret schema.
 */
const GPUMP_SECRET_SCHEMA = new Secret.Schema ({
  name: "org.gego.gpump.tokens",
  flags: Secret.SchemaFlags.NONE,
  attributes: {
      "NickName": Secret.SchemaAttributeType.STRING, // The nickname of the user
      "Server": Secret.SchemaAttributeType.STRING, // The server
      "DisplayName": Secret.SchemaAttributeType.STRING
    }
});

/** @class
 * Class to hold the the account intformation.
 *
 * Do not create instances of this object, use the get_account_data function
 * instad.
 */
const AccountData = Lang.Class ({
  Name: "AccountData",
  
  _init: function () {
    
    
  }
});
