Browse Source

...

sisyphus
Dustin Falgout 8 years ago
parent
commit
76dd0bf4d8
  1. 106
      src/gresource/js/LightDMObjects.js

106
src/gresource/js/LightDMObjects.js

@ -42,163 +42,214 @@
/**
* Interface for object that holds info about a session. Session objects are not
* created by the theme's code, but rather by the {@link LightDM.Greeter} class.
* created by the theme's code, but rather by the [`LightDM.Greeter`](#dl-LightDM-Greeter) class.
*
* @memberOf LightDM
*/
class Session {
constructor( { comment, key, name } ) {
this._comment = comment;
this._key = key;
this._name = name;
}
/**
* The comment for the session.
* The name for the session.
* @type {string}
* @readonly
*/
this.comment = comment;
get name() {
return this._name;
}
/**
* The key for the session.
* @type {string}
* @readonly
*/
this.key = key;
get key() {
return this._key;
}
/**
* The name for the session.
* The comment for the session.
* @type {string}
* @readonly
*/
this.name = name;
get comment() {
return this._comment;
}
}
/**
* Interface for object that holds info about a language on the system. Language objects are not
* created by the theme's code, but rather by the {@link LightDM.Greeter} class.
* created by the theme's code, but rather by the [`LightDM.Greeter`](#dl-LightDM-Greeter) class.
*
* @memberOf LightDM
*/
class Language {
constructor( { code, name, territory } ) {
this._code = code;
this._name = name;
this._territory = territory;
}
/**
* The code for the language.
* @type {string}
* @readonly
*/
this.code = code;
get code() {
return this._code;
}
/**
* The name for the language.
* The name for the layout.
* @type {string}
* @readonly
*/
this.name = name;
get name() {
return this._name;
}
/**
* The territory for the language.
* @type {string}
* @readonly
*/
this.territory = territory;
get territory() {
return this._territory;
}
}
/**
* Interface for object that holds info about a keyboard layout on the system. Language
* objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class.
* objects are not created by the theme's code, but rather by the [`LightDM.Greeter`](#dl-LightDM-Greeter) class.
*
* @memberOf LightDM
*/
class Layout {
constructor( { description, name, short_description } ) {
this._description = description;
this._name = name;
this._short_description = short_description;
}
/**
* The description for the layout.
* @type {string}
* @readonly
*/
this.description = description;
get description() {
return this._description;
}
/**
* The name for the layout.
* @type {string}
* @readonly
*/
this.name = name;
get name() {
return this._name;
}
/**
* The territory for the layout.
* @type {string}
* @readonly
*/
this.short_description = short_description;
get short_description() {
return this._short_description;
}
}
/**
* Interface for object that holds info about a user account on the system. User
* objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class.
* objects are not created by the theme's code, but rather by the [`LightDM.Greeter`](#dl-LightDM-Greeter) class.
*
* @memberOf LightDM
*/
class User {
constructor( user_info ) {
Object.keys(user_info).forEach( key => {
this[`_${key}`] = user_info[key];
} );
}
/**
* The display name for the user.
* @type {string}
* @readonly
*/
this.display_name = user_info.display_name;
get display_name() {
return this._display_name;
}
/**
* The language for the user.
* @type {string}
* @readonly
*/
this.language = user_info.language;
get language() {
return this._language;
}
/**
* The keyboard layout for the user.
* @type {string}
* @readonly
*/
this.layout = user_info.layout;
get layout() {
return this._layout;
}
/**
* The image for the user.
* @type {string}
* @readonly
*/
this.image = user_info.image;
get image() {
return this._image;
}
/**
* The home_directory for the user.
* @type {string}
* @readonly
*/
this.home_directory = user_info.home_directory;
get home_directory() {
return this._home_directory;
}
/**
* The username for the user.
* @type {string}
* @readonly
*/
this.username = user_info.username;
get username() {
return this._username;
}
/**
* Whether or not the user is currently logged in.
* @type {boolean}
* @readonly
*/
this.logged_in = user_info.logged_in;
get logged_in() {
return this._logged_in;
}
/**
* The last session that the user logged into.
* @type {string|null}
* @readonly
*/
this.session = user_info.session;
get session() {
return this._session;
}
/**
* ***Deprecated!*** See {@link LightDM.User#username}.
@ -206,7 +257,9 @@ class User {
* @type {string}
* @readonly
*/
this.name = user_info.name;
get name() {
return this._name;
}
/**
* ***Deprecated!*** See {@link LightDM.User#display_name}.
@ -214,6 +267,7 @@ class User {
* @type {string}
* @readonly
*/
this.real_name = user_info.real_name;
get real_name() {
return this._real_name;
}
}

Loading…
Cancel
Save