michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * A common base class for representing WebIDL callback interface types in C++. michael@0: * michael@0: * This class implements common functionality like lifetime management, michael@0: * initialization with the callback object, and setup of the call environment. michael@0: * Subclasses corresponding to particular callback interface types should michael@0: * provide methods that actually do the various necessary calls. michael@0: */ michael@0: michael@0: #ifndef mozilla_dom_CallbackInterface_h michael@0: #define mozilla_dom_CallbackInterface_h michael@0: michael@0: #include "mozilla/dom/CallbackObject.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class CallbackInterface : public CallbackObject michael@0: { michael@0: public: michael@0: explicit CallbackInterface(JS::Handle aCallback, michael@0: nsIGlobalObject *aIncumbentGlobal) michael@0: : CallbackObject(aCallback, aIncumbentGlobal) michael@0: { michael@0: } michael@0: michael@0: protected: michael@0: bool GetCallableProperty(JSContext* cx, const char* aPropName, michael@0: JS::MutableHandle aCallable); michael@0: michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_CallbackFunction_h