/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * 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"

interface nsISimpleEnumerator;
interface nsIURI;
interface nsIFeedResult;

interface flockIError;
interface flockIFeedContext;
interface flockIFeed;
interface flockIFeedItem;
interface flockIFeedFolderItem;

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

[scriptable, uuid(e7c3cb9d-f253-43b5-b0a8-f62156d6fc97)]
interface flockIFeedManager : nsISupports {
    void getFeed(in nsIURI aFeedURI,
                 in flockIFeedManagerListener aListener);
    void getFeedMetadata(in nsIURI aFeedURI,
                         in flockIFeedManagerListener aListener);
    void getFeedBypassCache(in nsIURI aFeedURI,
                            in flockIFeedManagerListener aListener,
                            in boolean aAsyncStorage);

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

    boolean existsFeed(in nsIURI aFeedURI);

    nsISimpleEnumerator getLibrary();

    boolean storeFeed(in nsIURI aFeedURI,
                      in nsIFeedResult aFeedResult,
                      in ACString aLastModified,
                      in flockIFeedManagerListener aListener);

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