/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2008
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "nsISupports.idl"
#include "nsISimpleEnumerator.idl"
#include "nsIURL.idl"

#include "flockIError.idl"
#include "flockIFeedContext.idl"
#include "flockIFeed.idl"
#include "flockIFeedItem.idl"
#include "flockIFeedFolderItem.idl"

interface nsIFeedResult;

[scriptable, uuid(5e730231-c2b6-45ba-b51d-4662583dd011)]
interface flockIFeedManagerListener : nsISupports {
    void onGetFeedComplete(in flockIFeed feed);
    void onError(in flockIError error);
};

[scriptable, uuid(4aea90af-dfc7-4a0f-b60e-12c55c14044b)]
interface flockIFeedManager : nsISupports {
    void getFeed(in nsIURL url, in flockIFeedManagerListener listener);
    void getFeedMetadata(in nsIURL url, in flockIFeedManagerListener listener);
    void getFeedBypassCache(in nsIURL url, in flockIFeedManagerListener listener);

    flockIFeedContext createFeedContext(in AString name);
    flockIFeedContext getFeedContext(in AString name);
    nsISimpleEnumerator getFeedContexts();
    void deleteFeedContext(in AString name);

    boolean existsFeed(in nsIURL url);

    nsISimpleEnumerator getLibrary();

    flockIFeed storeFeed(in nsIURL feedURL, in nsIFeedResult feedResult);

    /* Used by flock internal infastructure */
    flockIFeedFolderItem getFeedFolderItem(in AString itemID);
    flockIFeedItem getFeedItem(in AString itemID);
};
