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
|
|
|
|
|
|
|
/* DOM object representing values in DOM computed style */
|
|
|
|
|
|
|
|
#ifndef nsROCSSPrimitiveValue_h___
|
|
|
|
#define nsROCSSPrimitiveValue_h___
|
|
|
|
|
|
|
|
#include "nsIDOMCSSPrimitiveValue.h"
|
|
|
|
#include "nsCoord.h"
|
2007-07-22 10:58:37 -07:00
|
|
|
#include "nsCSSKeywords.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-06-03 13:11:34 -07:00
|
|
|
class nsIURI;
|
|
|
|
class nsDOMCSSRGBColor;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-08 04:15:00 -07:00
|
|
|
/**
|
|
|
|
* Read-only CSS primitive value - a DOM object representing values in DOM
|
|
|
|
* computed style.
|
|
|
|
*/
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsROCSSPrimitiveValue : public nsIDOMCSSPrimitiveValue
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIDOMCSSPrimitiveValue
|
|
|
|
NS_DECL_NSIDOMCSSPRIMITIVEVALUE
|
|
|
|
|
|
|
|
// nsIDOMCSSValue
|
|
|
|
NS_DECL_NSIDOMCSSVALUE
|
|
|
|
|
|
|
|
// nsROCSSPrimitiveValue
|
2010-08-13 02:58:04 -07:00
|
|
|
nsROCSSPrimitiveValue();
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsROCSSPrimitiveValue();
|
|
|
|
|
2010-06-03 13:11:34 -07:00
|
|
|
void SetNumber(float aValue);
|
2012-08-22 08:56:38 -07:00
|
|
|
void SetNumber(int32_t aValue);
|
|
|
|
void SetNumber(uint32_t aValue);
|
2010-06-03 13:11:34 -07:00
|
|
|
void SetPercent(float aValue);
|
|
|
|
void SetAppUnits(nscoord aValue);
|
|
|
|
void SetAppUnits(float aValue);
|
|
|
|
void SetIdent(nsCSSKeyword aKeyword);
|
2007-07-22 10:58:37 -07:00
|
|
|
// FIXME: CSS_STRING should imply a string with "" and a need for escaping.
|
2012-08-22 08:56:38 -07:00
|
|
|
void SetString(const nsACString& aString, uint16_t aType = CSS_STRING);
|
2007-07-22 10:58:37 -07:00
|
|
|
// FIXME: CSS_STRING should imply a string with "" and a need for escaping.
|
2012-08-22 08:56:38 -07:00
|
|
|
void SetString(const nsAString& aString, uint16_t aType = CSS_STRING);
|
2010-06-03 13:11:34 -07:00
|
|
|
void SetURI(nsIURI *aURI);
|
|
|
|
void SetColor(nsDOMCSSRGBColor* aColor);
|
|
|
|
void SetRect(nsIDOMRect* aRect);
|
|
|
|
void SetTime(float aValue);
|
|
|
|
void Reset();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
private:
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t mType;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
union {
|
|
|
|
nscoord mAppUnits;
|
|
|
|
float mFloat;
|
|
|
|
nsDOMCSSRGBColor* mColor;
|
|
|
|
nsIDOMRect* mRect;
|
|
|
|
PRUnichar* mString;
|
|
|
|
nsIURI* mURI;
|
2009-01-22 17:28:14 -08:00
|
|
|
nsCSSKeyword mKeyword;
|
2007-03-22 10:30:00 -07:00
|
|
|
} mValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsROCSSPrimitiveValue_h___ */
|
|
|
|
|