var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../base/BaseClass.ts" />
/// <reference path="./Category.ts" />
/// <reference path="./IContentConfigOptions.ts" />
var econda;
(function (econda) {
    var media;
    (function (media) {
        /**
         * Media content object. Defines name and category of tracked video / audio file. In most cases you'll set
         * these properties directly in the {@link econda.media.MediaTracker#content} property of your {@link econda.media.MediaTracker} instance.
         *
         * Content information defines, how (and where) users will see a media file in their reports.
         *
         * Example:
         *     var myContent = new econda.media.Content({
         *          name: "My Skater Video",
         *          category: "/News/Sports"
         *     });
         *
         *     var tracker = new econda.media.MediaTracker({
         *         content: myContent,
         *         duration: 120
         *     });
         *
         *     // or as a shorthand version...
         *     var tracker = new econda.media.MediaTracker({
         *         content: {
         *             name: "My Skater Video",
         *             category: "/News/Sports"
         *         }
         *         duration: 120
         *     });
         *
         *     // or as part of helper object
         *     var trackingHelper = new econda.media.helper.HtmlVideoTracker({
         *         player: document.getElementById("videoTagId"),
         *         tracker: {
         *             content: {
         *                 name: "My Skater Video",
         *                 category: "/News/Sports"
         *             }
         *         }
         *     });
         *
         * @class econda.media.Content
         * @extends econda.base.BaseClass
         */
        var Content = (function (_super) {
            __extends(Content, _super);
            function Content(cfg) {
                _super.call(this);
                /**
                 * Name of content, may NOT contains slashes
                 * @cfg {String} name
                 * @accessor
                 */
                this.name = null;
                /**
                  * Content category
                  * @cfg {econda.media.Category} content category
                  * @accessor
                  */
                this.category = null;
                /**
                 * Handle non object config values as value for property...
                 * @property {String} __defaultProperty
                 * @private
                 */
                this.__defaultProperty = "name";
                if (cfg instanceof Content) {
                    return cfg;
                }
                this.initConfig(cfg);
            }
            Content.prototype.getName = function () {
                return this.name;
            };
            Content.prototype.setName = function (name) {
                this.name = name;
                return this;
            };
            Content.prototype.getCategory = function () {
                return this.category;
            };
            Content.prototype.setCategory = function (category) {
                this.category = new media.Category(category);
                return this;
            };
            /**
             * Returns category path + name as string
             * @method
             * @return {String} e.g. "/ProductVideos/MyVideo" or "MyVideo" (if there's no category assigned)
             */
            Content.prototype.toString = function () {
                var cat = this.getCategory();
                var ret = "";
                if (cat != null) {
                    ret = cat.toString() + "/" + this.getName();
                }
                else {
                    ret = this.getName();
                }
                return ret;
            };
            return Content;
        }(econda.base.BaseClass));
        media.Content = Content;
    })(media = econda.media || (econda.media = {}));
})(econda || (econda = {}));