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

#ifndef __flockLucene_h__
#define __flockLucene_h__

#include "flockILucene.h"

#include "nsIObserver.h"
#include "nsIEventTarget.h"
#include "nsIProxyObjectManager.h"

#include "nsCOMPtr.h"


class flockLuceneImpl;

class flockLucene : public flockILucene,
                    public nsIObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKILUCENE
  NS_DECL_NSIOBSERVER

  static flockLucene* GetSingleton();

private:
  flockLucene() NS_HIDDEN;
  ~flockLucene() NS_HIDDEN;

  nsresult Shutdown();

  nsresult GetProxyForObject(nsIEventTarget *aTarget, REFNSIID aIID,
                             nsISupports *aObject, PRInt32 aProxyType,
                             void **aProxy);

  nsCOMPtr<flockLuceneImpl> mLuceneImpl;

  nsCOMPtr<flockILucene> mProxyAsync;
  nsCOMPtr<flockILucene> mProxySync;

  nsCOMPtr<nsIProxyObjectManager> mProxyManager;
};

#endif
