Browse Source

...

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

330
src/gresource/js/LightDMObjects.js

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

Loading…
Cancel
Save