﻿TextSizeAdapter.prototype._source = null;
TextSizeAdapter.prototype._key = null;

TextSizeAdapter.prototype.getSize = function() {
    return this._source.read(this._key);
}

TextSizeAdapter.prototype.saveSize = function(size) {
    this._source.create(this._key, size, 7);
}

function TextSizeAdapter(source, key) {
    this._source = source;
    this._key = key;
}


// ---

TextSizeIncrement.prototype._size = null;
TextSizeIncrement.prototype._stylesheet = null;

TextSizeIncrement.prototype.getSize = function() {
    return this._size;
}

TextSizeIncrement.prototype.getStylesheet = function() {
    return this._stylesheet;
}

function TextSizeIncrement(adapter, size1Stylesheet, size2Stylesheet) {
    var currentSize = adapter.getSize();
    if (!currentSize) currentSize = 0;
    var newSize = currentSize == 0 ? 1 : currentSize == 1 ? 2 : 0;
    this._size = newSize;
    this._stylesheet = newSize == 0 ? "" : newSize == 1 ? size1Stylesheet : size2Stylesheet;
}

