/*
 * 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"

[scriptable, uuid(25383099-7216-4049-9499-a541dbed862b)]
interface flockIRichObject: nsISupports
{
    attribute AString type;
    attribute AString title;
    attribute AString content;
    attribute AString url;
    attribute AString webPageTitle;
    attribute AString webPageUrl;

    AString toHtml();
    AString toText();
};

[scriptable, uuid(0e4e7542-5534-41b3-acf9-a95927690200)]
interface flockIScrapbookService: nsIRDFDataSource
{
    // Returns the number of elements in the shelf
    long elementsCount();

    // Insert a new element and returns its ID
    string insert(in flockIRichObject anObject, in long aPosition);
    string insertOld(in AString aType, in AString aTitle, in AString aContent, in AString anUrl, in AString aSrc, in long aPosition);
    string update(in AString anId, in AString aType, in AString aTitle, in AString aContent, in AString anUrl, in AString aSrc);
    // Return the position of an object
    long getPositionOf(in AString anId);
    // Return a property of an object
    AString getTargetOf(in AString anId, in AString aTarget);
    // Remove an element from the shelf
    void remove(in AString anId);
    // Delete all elements in the Shelf. Be careful when using this function!
    void clear();
};


