/* Copyright 2009 Palm, Inc.  All rights reserved. */
/*global Mojo, Class, $L */
/*jslint rhino:true, undef:true */

var WordAssistant = Class.create({

	initialize: function(docAssistant) {
		this.docAssistant = docAssistant;
		this.wideMode = false;
	},

    orientationChanged: function(orientation) {
        Mojo.Log.info("Word: orientation changed to: " + orientation);
    },

	toggleWideMode: function()
	{
		var lHandle = new Mojo.Service.Request( 'palm://com.palm.office/word/wideMode',
			{
				parameters: { docid: this.docAssistant.document_id, wideMode: !this.wideMode },

				onSuccess: function(payload) {
					this.wideMode = !this.wideMode;
					this.docAssistant.adapter.invalidateScreen();
                    this.docAssistant.setMenuCheck('widemode-cmd', this.wideMode);
				}.bind(this),

				onFailure: function(payload) {
					Mojo.Log.error("wideMode failed: %s", Object.toJSON(payload) );
				}
			});
	},

	docLoaded: function() {
	},

	gotoPage: function() {
	}
});
