/*
 * BEGIN FLOCK GPL
 * 
 * Copyright Flock Inc. 2005-2006
 * http://flock.com
 * 
 * This file may be used under the terms of 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 "nsIRDFDataSource.idl"
#include "nsIRDFNode.idl"
#include "nsISimpleEnumerator.idl"
#include "nsIStringEnumerator.idl"
#include "nsIFileURL.idl"
#include "flockIBlogAPI.idl"


[scriptable, uuid(8425e79d-6b5a-4ee8-af87-5fc5791261a3)]
interface flockIDetectListener: nsISupports {
  void onResult (in flockIBlogAccount api);
  void onError (in AString errorMsg);
};


[scriptable, uuid(094a6d1a-357a-466f-a854-484ed125ea03)]
interface flockIBlogService: nsIRDFDataSource {
  readonly attribute nsISimpleEnumerator services;

  // Disk files history
  void addRecent (in AString aName, in AString aFilepath); 
  boolean recentIsEmpty (); 

  // API Catalog
  void registerAPI(in flockIBlogAPI aAPI, in ACString aShortname);
  flockIBlogAPI getAPIFromShortname(in ACString aShortname);
  AString getShortnameFromAPI(in flockIBlogAPI aAPI);
  void getCandidatesAPI(in flockIDetectListener aListener, in AString aUrl);

  // Accounts management
  long accountCount ();
  AString getAccountList ();
  flockIBlogAccount getAccount (in AString aBlogID);
  flockIBlogAPI getBlogAPI (in AString aBlogID);
  void setBlogAPI (in AString aBlogID, in flockIBlogAPI aBlogAPI);
  boolean accountExists (in AString aTitle);
  void saveAccount (in AString aTitle, in flockIBlogAccount aBlogAccount);
  void deleteAccount (in AString aBlogID);
  void addCategory (in AString aBlogID, in AString aCategoryId, in AString aCategoryName);
  void flushCategories (in flockIBlogAccount aBlogAccount);

  // Notifications
  void addNotification (in AString aURL);
  void removeNotification (in AString aURL);
  nsIStringEnumerator getNotifications ();
};

