/*
 * 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 "nsISimpleEnumerator.idl"
#include "nsIStringEnumerator.idl"
#include "nsIRDFDataSource.idl"
#include "nsIRDFNode.idl"


[scriptable, uuid(78b76670-a8db-4fea-adbe-54ab509aa467)]
interface flockIBlogLink: nsISupports {
  attribute AString href;
  attribute AString rel;
  attribute AString type;
  attribute AString title;
};


[scriptable, uuid(ce875203-d39c-40b0-8f01-b2313b49bb5e)]
interface flockIBlogAccount: nsISupports {
  attribute AString title;
  attribute AString uid;
  attribute AString url;
  attribute AString api;
  attribute boolean preferredapi;
  attribute AString username;
  attribute AString password;
  attribute AString pwhost;
  attribute AString apiLink;
  attribute AString editLink;
  attribute AString blogid;
};


[scriptable, uuid(756445c0-9632-4bec-b65b-f5b190a01e58)]
interface flockIBlogPost: nsISupports {
  attribute AString editURI;
  attribute AString title;
  attribute AString content;
  attribute AString dateCreated;
  attribute AString state;
  attribute AString tags;
  attribute AString uid;
  attribute AString uri;
  attribute AString accountID;
  attribute AString atomid;
};


[scriptable, uuid(9c51652a-6425-4ceb-8b3b-1523aa555971)]
interface flockIBlogRDFListener: nsISupports {
  void onResult (in nsIRDFDataSource aDataSource);
  void onFault (in AString fault);
  void onError (in AString error);
};


[scriptable, uuid(1405ac69-d6d0-4fd4-b55a-36ec8274153f)]
interface flockIBlogListener: nsISupports {
  void onResult (in nsISimpleEnumerator aAccountList);
  void onFault (in AString fault);
  void onError (in AString error);
};


[scriptable, uuid(70a7e958-2579-453b-9888-c35f9a0f22d0)]
interface flockIBlogAPI: nsISupports {
  attribute AString name;
  attribute AString shortName;
  attribute AString appkey;
  attribute AString supportsCategories;

  // Detect an account in a collection of links
  // aLinkList should be an enumerator of flockIBlogLink
  flockIBlogAccount detectAccount(in AString aUrl, in nsISimpleEnumerator aLinkList);

  // Observers
  void getUsersBlogs (in flockIBlogListener aListener, in flockIBlogAccount aAccount);
  void getRecentPosts (in flockIBlogRDFListener aListener, in flockIBlogAccount aAccount,
                       in PRUint32 aNumber);
  void getCategoryList (in flockIBlogRDFListener aListener, in flockIBlogAccount aAccount);

  // Modifiers
  void newPost (in flockIBlogRDFListener aListener, in flockIBlogAccount aAccount,
                in AString aTitle, in AString aDescription, in AString aDateCreated,
                in boolean aPublish, in nsIStringEnumerator aNotifications);
  void editPost (in flockIBlogRDFListener aListener, in flockIBlogAccount aAccount,
                 in AString aPostid, in AString aTitle, in AString aDescription,
                 in AString aDateCreated, in boolean aPublish, in AString aEditURI,
                 in AString aAtomID, in nsIStringEnumerator aNotifications); 
  void setPostCategories (in flockIBlogRDFListener aListener, in flockIBlogAccount aAccount,
                          in AString aPostid, in nsIStringEnumerator aCategories);
};
