const FLOCK_PHOTO_CID = Components.ID('{5844743e-41a6-400c-a659-93e0067d1d68}');
const FLOCK_PHOTO_CONTRACTID = '@flock.com/photo;1';
const FLOCK_PHOTO_IID = Components.interfaces.flockIPhoto;


function flockPhoto() {
}

flockPhoto.prototype= {
    id: "",
    thumbnail: "",
    webPageUrl: "",
    midSizePhoto: "",
    largeSizePhoto: "",
    title: "",
    username: "",
    userid: "",
    is_public: "true",

    QueryInterface: function(iid) {
        if (!iid.equals(Components.interfaces.nsISupports) &&
            !iid.equals(FLOCK_PHOTO_IID))
            throw Components.results.NS_ERROR_NO_INTERFACE;
        return this;
    }
};


var flockPhotoModule = {
    registerSelf: function(compMgr, fileSpec, location, type) {
        compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
        compMgr.registerFactoryLocation(FLOCK_PHOTO_CID, 
                                        "flockPhoto JS component", 
                                        FLOCK_PHOTO_CONTRACTID, 
                                        fileSpec, 
                                        location,
                                        type);
    },

    getClassObject: function(compMgr, cid, iid) {
        if (!cid.equals(FLOCK_PHOTO_CID))
            throw Components.results.NS_ERROR_NO_INTERFACE;

        if (!iid.equals(Components.interfaces.nsIFactory))
            throw Components.results.NS_ERROR_NOT_IMPLEMENTED;

        return flockPhotoFactory;
    },

    canUnload: function(compMgr) { return true; }
};

var flockPhotoFactory = {
    createInstance: function(outer, iid) {
        if (outer != null)
            throw Components.results.NS_ERROR_NO_AGGREGATION;
    
        if (!iid.equals(FLOCK_PHOTO_IID) &&
            !iid.equals(Components.interfaces.nsISupports))
            throw Components.results.NS_ERROR_INVALID_ARG;

        return new flockPhoto();
    }
}

/* module initialisation */
function NSGetModule(comMgr, fileSpec) { return flockPhotoModule; }

