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 "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,
|
2012-12-17 12:22:38 -08:00
|
|
|
const PRUnichar* aReadOnly,
|
|
|
|
uint32_t aLineNumber);
|
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);
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
void SetGetterLineNumber(uint32_t aLineNumber);
|
|
|
|
void SetSetterLineNumber(uint32_t aLineNumber);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-02-08 06:24:21 -08:00
|
|
|
virtual nsresult InstallMember(JSContext* aCx,
|
2013-05-29 14:56:10 -07:00
|
|
|
JS::Handle<JSObject*> aTargetClassObject);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual nsresult CompileMember(nsIScriptContext* aContext,
|
|
|
|
const nsCString& aClassStr,
|
2013-05-29 14:56:10 -07:00
|
|
|
JS::Handle<JSObject*> aClassObject);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-05-29 14:56:10 -07:00
|
|
|
virtual void Trace(const TraceCallbacks& aCallback, void *aClosure);
|
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,
|
2013-05-29 14:56:10 -07:00
|
|
|
nsIObjectOutputStream* aStream);
|
2011-11-03 13:39:08 -07:00
|
|
|
|
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__
|