#include "nsISupports.idl" interface nsILuceneIndexReader; interface nsILuceneAnalyzer; interface nsILuceneQuery; interface nsILuceneIndexSearcher; interface nsILuceneIndexWriter; interface nsILuceneField; interface nsILuceneDocument; interface nsIFile; interface nsILuceneHighlighter; [scriptable, uuid(cdd81324-29d2-4112-9834-5798be7e14bc)] interface nsILuceneFactory : nsISupports { /* * Some constants to mimick the NS_ERROR_GENERATE_FAILURE macro for * computing nsresult values. Don't use these :) */ const unsigned long XPCL_NS_ERROR_SEVERITY_ERROR = 1; const unsigned long XPCL_NS_ERROR_MODULE_GENERAL = 51; const unsigned long XPCL_NS_ERROR_MODULE_BASE_OFFSET = 0x45; const unsigned long XPCL_ERR_BASE = (XPCL_NS_ERROR_SEVERITY_ERROR << 31) | ((XPCL_NS_ERROR_MODULE_GENERAL + XPCL_NS_ERROR_MODULE_BASE_OFFSET) << 16); /* * Exceptions that clucene throws, these are returned as nsresult values */ const unsigned long XPCL_ERR_IO = XPCL_ERR_BASE | 1; const unsigned long XPCL_ERR_NullPointer = XPCL_ERR_BASE | 2; const unsigned long XPCL_ERR_Runtime = XPCL_ERR_BASE | 3; const unsigned long XPCL_ERR_IllegalArgument = XPCL_ERR_BASE | 4; const unsigned long XPCL_ERR_Parse = XPCL_ERR_BASE | 5; const unsigned long XPCL_ERR_TokenMgr = XPCL_ERR_BASE | 6; const unsigned long XPCL_ERR_UnsupportedOperation = XPCL_ERR_BASE | 7; const unsigned long XPCL_ERR_InvalidState = XPCL_ERR_BASE | 8; const unsigned long XPCL_ERR_IndexOutOfBounds = XPCL_ERR_BASE | 9; const unsigned long XPCL_ERR_TooManyClauses = XPCL_ERR_BASE | 10; const unsigned long XPCL_ERR_RAMTransaction = XPCL_ERR_BASE | 11; const unsigned long XPCL_ERR_InvalidCast = XPCL_ERR_BASE | 12; nsILuceneIndexReader getIndexReader(in nsIFile index); nsILuceneAnalyzer getAnalyzer(in unsigned long analyzerType); nsILuceneQuery parseQuery(in AString query, in AString field, in nsILuceneAnalyzer analyzer); nsILuceneIndexSearcher getIndexSearcher(in nsILuceneIndexReader indexReader); nsILuceneIndexWriter getIndexWriter(in nsIFile index, in nsILuceneAnalyzer analyzer, in boolean create, in boolean closeDir); nsILuceneField createTextStringField(in AString name, in AString value, in boolean storeTermVector); nsILuceneField createTextKeywordField(in AString name, in AString value); nsILuceneDocument createDocument(); nsILuceneHighlighter createHighlighter(in nsILuceneQuery query, in AString fragmentSeparator, in short maxNumFragmentsRequired, in AString preTag, in AString postTag); nsILuceneQuery createSingleTermQuery(in AString name, in AString value); }; %{C++ // {8c11474d-805b-43ff-bdbf-4f21cf78fe1d} #define XPCLUCENEFACTORY_CID \ { 0x8c11474d, 0x805b, 0x43ff, \ { 0xbd, 0xbf, 0x4f, 0x21, 0xcf, 0x78, 0xfe, 0x1d } } #define XPCLUCENEFACTORY_CONTRACTID "@skrul.com/xpclucene-factory;1" #define XPCLUCENEFACTORY_CLASSNAME "XpcLuceneFactory" %}