/*
 * 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 nsIURI;

/* XXX: This is a temporary interface until upstream has a saner API
 * around favicons. Do not rely on this being here.
 */

[scriptable, uuid(8fc2e753-3ac7-4f49-a631-baa731fe52c7)]
interface flockIFaviconFetchListener : nsISupports {
  void onFaviconFetchSuccess(in nsIURI aFaviconURI, in AString aDataURL,
                             in AString aTopic);
  void onFaviconFetchError(in nsIURI aFaviconURI, in AString aTopic);
  void onFaviconFetchStatusError(in nsIURI aFaviconURI,
                                 in unsigned long aResponseStatus,
                                 in AString aTopic);
};

[scriptable, uuid(79ec2cc8-d649-478f-aaa6-448117e8e995)]
interface flockIFaviconDataService : nsISupports {
  /* These two will be in nsIFaviconService in Firefox 3.1 */
  void setFaviconDataFromDataURL(in nsIURI aFaviconURI, in AString aDataURL,
                                 in PRTime aExpiration);

  AString getFaviconDataAsDataURL(in nsIURI aFaviconURI);

  /* This is needed until we can get sane lifetimes for favicons in
   * the favicon service
   */
  void fetchFaviconData(in nsIURI aFaviconURI,
                        in flockIFaviconFetchListener aFetchListener,
                        in AString aTopic);
};

%{C++

// 8cd730e6-4986-423b-9332-ca8c13d48180
#define FLOCK_FAVICONDATASERVICE_CID \
{ 0x8cd730e6, 0x4986, 0x423b, { 0x93, 0x32, 0xca, 0x8c, 0x13, 0xd4, 0x81, 0x80 } }
#define FLOCK_FAVICONDATASERVICE_CLASSNAME "Flock Favicon Data Service"
#define FLOCK_FAVICONDATASERVICE_CONTRACTID "@flock.com/favicon-data-service;1"

%}
