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

[scriptable, uuid(7cbe15f4-1334-4a33-9ffe-def30eda7fa9)]
interface flockIRDFSourceUtils : nsISupports {

  void init(in nsIRDFDataSource aDataSource, in nsIRDFResource aSource);

  readonly attribute nsIRDFResource parent;
  void deleteAllTargets(in nsIRDFResource aProperty);
  void emptyContainer();
  void destroy();

  PRTime dateValue(in nsIRDFNode aNode);
  PRTime getDateTarget(in AUTF8String aProperty);
  void setDateTarget(in AUTF8String aProperty, in PRTime aValue);

  AString litValue(in nsIRDFNode aNode);
  AString getLitTarget(in AUTF8String aProperty);
  void setLitTarget(in AUTF8String aProperty, in AString aValue);

  nsIRDFNode getTarget(in AUTF8String aProperty);
  void setTarget( in AUTF8String aProperty, in nsIRDFNode aTarget);

  AUTF8String insertSortedOn(in AUTF8String aSortCriteria,
                      in nsIRDFResource aChild2Insert, in PRInt32 aMaxCount);
};


%{C++

// a2d69996-8039-4291-b7be-a6d997002389
#define FLOCK_RDFSOURCEUTILS_CID \
{ 0xa2d69996, 0x8039, 0x4291, { 0xb7, 0xbe, 0xa6, 0xd9, 0x97, 0x00, 0x23, 0x89 } }
#define FLOCK_RDFSOURCEUTILS_CLASSNAME "Flock RDF Source Utils"
#define FLOCK_RDFSOURCEUTILS_CONTRACTID "@flock.com/rdf-source-utils;1"

%}
