2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsXBLProtoImplProperty_h__
|
|
|
|
#define nsXBLProtoImplProperty_h__
|
|
|
|
|
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsString.h"
|
2011-11-03 13:39:08 -07:00
|
|
|
#include "nsXBLSerialize.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsXBLProtoImplMember.h"
|
|
|
|
|
|
|
|
class nsXBLProtoImplProperty: public nsXBLProtoImplMember
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsXBLProtoImplProperty(const PRUnichar* aName,
|
|
|
|
const PRUnichar* aGetter,
|
|
|
|
const PRUnichar* aSetter,
|
|
|
|
const PRUnichar* aReadOnly);
|
2011-11-03 13:39:08 -07:00
|
|
|
|
2011-11-20 19:09:16 -08:00
|
|
|
nsXBLProtoImplProperty(const PRUnichar* aName, const bool aIsReadOnly);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsXBLProtoImplProperty();
|
|
|
|
|
|
|
|
void AppendGetterText(const nsAString& aGetter);
|
|
|
|
void AppendSetterText(const nsAString& aSetter);
|
|
|
|
|
|
|
|
void SetGetterLineNumber(PRUint32 aLineNumber);
|
|
|
|
void SetSetterLineNumber(PRUint32 aLineNumber);
|
|
|
|
|
|
|
|
virtual nsresult InstallMember(nsIScriptContext* aContext,
|
|
|
|
nsIContent* aBoundElement,
|
2012-05-05 02:00:06 -07:00
|
|
|
JSObject* aScriptObject,
|
|
|
|
JSObject* aTargetClassObject,
|
2007-03-22 10:30:00 -07:00
|
|
|
const nsCString& aClassStr);
|
|
|
|
virtual nsresult CompileMember(nsIScriptContext* aContext,
|
|
|
|
const nsCString& aClassStr,
|
2011-11-26 02:06:40 -08:00
|
|
|
JSObject* aClassObject);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-10-29 06:45:07 -07:00
|
|
|
virtual void Trace(TraceCallback aCallback, void *aClosure) const;
|
2007-05-24 07:10:02 -07:00
|
|
|
|
2011-11-03 13:39:08 -07:00
|
|
|
nsresult Read(nsIScriptContext* aContext,
|
|
|
|
nsIObjectInputStream* aStream,
|
|
|
|
XBLBindingSerializeDetails aType);
|
|
|
|
virtual nsresult Write(nsIScriptContext* aContext,
|
|
|
|
nsIObjectOutputStream* aStream);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
union {
|
|
|
|
// The raw text for the getter (prior to compilation).
|
|
|
|
nsXBLTextWithLineNumber* mGetterText;
|
|
|
|
// The JS object for the getter (after compilation)
|
|
|
|
JSObject * mJSGetterObject;
|
|
|
|
};
|
|
|
|
|
|
|
|
union {
|
|
|
|
// The raw text for the setter (prior to compilation).
|
|
|
|
nsXBLTextWithLineNumber* mSetterText;
|
|
|
|
// The JS object for the setter (after compilation)
|
|
|
|
JSObject * mJSSetterObject;
|
|
|
|
};
|
|
|
|
|
2012-02-28 15:11:11 -08:00
|
|
|
unsigned mJSAttributes; // A flag for all our JS properties (getter/setter/readonly/shared/enum)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsCompiled;
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsXBLProtoImplProperty_h__
|