const Endless = imports.gi.Endless; const GObject = imports.gi.GObject; const Lang = imports.lang; // Local libraries const ArticleModel = imports.wikipedia.models.article_model; const CategoryModel = new Lang.Class({ Name: "CategoryModel", Extends: GObject.Object, Properties: { 'description': GObject.ParamSpec.string('description', 'Category Description', 'This is the text that the user reads on the category page.', GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT, ""), 'title': GObject.ParamSpec.string('title', 'Category Name', 'This is the name that is displayed on the front page and as the title on the category page.', GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT, ""), 'image-uri': GObject.ParamSpec.string('image-uri', 'Category Image URI', 'Path to image for this category in the GResource', GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT, ""), 'image-thumbnail-uri': GObject.ParamSpec.string('image-thumbnail-uri', 'Category Thumbnail Image URI', 'Path to thumbnail image for this category in the GResource', GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT, ""), 'is-main-category': GObject.ParamSpec.boolean('is-main-category', 'Is Main Category boolean', 'Flag denoting whether this category is the main category for this app', GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT, false), }, _init: function(params) { this.parent(params); }, addArticles: function(articles) { this._articles = articles; }, getArticles: function() { return this._articles; } });