File:  [mozdev] / abimoz / plugin / pnWPPluginScriptablePeer.h
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Fri Oct 25 14:42:28 2002 UTC (15 years, 1 month ago) by mikep
Branches: MAIN
CVS tags: HEAD
Upgraded to Mozilla 1.2b and abiword 1.0.3.

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 *  ***** BEGIN LICENSE BLOCK *****
 * Version: GPL 2.0
 *
 * The contents of this file are subject to the GNU General Public License 
 * Version 2.0 (the "License"); you may not use this file except in 
 * compliance with the License. You may obtain a copy of the License at
 * http://www.fsf.org/licenses/gpl.txt
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 * 
 * The Original Code is OEone Penzilla Code.
 * 
 * The Initial Developer of the Original Code is
 * OEone Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1999-2002
 * the Initial Developer. All Rights Reserved.
 * Some portions are based on xine code.
 * 
 * Contributor(s): 
 * 
 * 
 * ***** END LICENSE BLOCK *****
 */


// ==============================
// ! Scriptability related code !
// ==============================
//
// pnMozXineScriptablePeer - xpconnect scriptable peer
//

#ifndef __pnIWPPluginScriptablePeer_h__
#define __pnIWPPluginScriptablePeer_h__

#include "nsWPPluginControl.h"
#include "nsIClassInfo.h"

class nsWPPluginInstance;

// We must implement nsIClassInfo because it signals the
// Mozilla Security Manager to allow calls from JavaScript.

class nsClassInfoMixin : public nsIClassInfo
{
  // These flags are used by the DOM and security systems to signal that 
  // JavaScript callers are allowed to call this object's scritable methods.
  NS_IMETHOD GetFlags(PRUint32 *aFlags)
    {*aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
     return NS_OK;}
  NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
    {*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
     return NS_OK;}
  // The rest of the methods can safely return error codes...
  NS_IMETHOD GetInterfaces(PRUint32 *count, nsIID * **array)
    {return NS_ERROR_NOT_IMPLEMENTED;}
  NS_IMETHOD GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
    {return NS_ERROR_NOT_IMPLEMENTED;}
  NS_IMETHOD GetContractID(char * *aContractID)
    {return NS_ERROR_NOT_IMPLEMENTED;}
  NS_IMETHOD GetClassDescription(char * *aClassDescription)
    {return NS_ERROR_NOT_IMPLEMENTED;}
  NS_IMETHOD GetClassID(nsCID * *aClassID)
    {return NS_ERROR_NOT_IMPLEMENTED;}
  NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
    {return NS_ERROR_NOT_IMPLEMENTED;}
};

class pnWPPluginScriptablePeer : public nsIWPPluginInstance,
                                public nsClassInfoMixin
{
public:
  pnWPPluginScriptablePeer(nsWPPluginInstance* plugin);
  ~pnWPPluginScriptablePeer();

  NS_DECL_ISUPPORTS
  NS_DECL_NSIWPPLUGININSTANCE

protected:
  nsWPPluginInstance* mPlugin;
};

#endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>