Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
nsSVGValue Class Reference

#include <nsSVGValue.h>

Inherits nsISVGValue.

Inherited by nsSVGAngle, nsSVGAnimatedAngle, nsSVGAnimatedEnumeration, nsSVGAnimatedLength, nsSVGAnimatedLengthList, nsSVGAnimatedNumber, nsSVGAnimatedNumberList, nsSVGAnimatedPreserveAspectRatio, nsSVGAnimatedRect, nsSVGAnimatedString, nsSVGAnimatedTransformList, nsSVGClassValue, nsSVGEnum, nsSVGGenericStringValue, nsSVGGradientFrame, nsSVGLength, nsSVGLengthList, nsSVGMatrix, nsSVGNumber, nsSVGNumberList, nsSVGPathSegArcAbs, nsSVGPathSegArcRel, nsSVGPathSegClosePath, nsSVGPathSegCurvetoCubicAbs, nsSVGPathSegCurvetoCubicRel, nsSVGPathSegCurvetoCubicSmoothAbs, nsSVGPathSegCurvetoCubicSmoothRel, nsSVGPathSegCurvetoQuadraticAbs, nsSVGPathSegCurvetoQuadraticRel, nsSVGPathSegCurvetoQuadraticSmoothAbs, nsSVGPathSegCurvetoQuadraticSmoothRel, nsSVGPathSegLinetoAbs, nsSVGPathSegLinetoHorizontalAbs, nsSVGPathSegLinetoHorizontalRel, nsSVGPathSegLinetoRel, nsSVGPathSegLinetoVerticalAbs, nsSVGPathSegLinetoVerticalRel, nsSVGPathSegList, nsSVGPathSegMovetoAbs, nsSVGPathSegMovetoRel, nsSVGPoint, nsSVGPointList, nsSVGPreserveAspectRatio, nsSVGRect, nsSVGStringProxyValue, nsSVGTransform, and nsSVGTransformList.

Collaboration diagram for nsSVGValue:
Collaboration graph
[legend]

List of all members.

Public Types

enum  modificationType { mod_other = 0, mod_context, mod_die }

Public Member Functions

NS_IMETHOD AddObserver (nsISVGValueObserver *observer)
NS_IMETHOD RemoveObserver (nsISVGValueObserver *observer)
NS_IMETHOD BeginBatchUpdate ()
NS_IMETHOD EndBatchUpdate ()
typedef NS_STDCALL_FUNCPROTO (nsresult, SVGObserverNotifyFunction, nsISVGValueObserver, DidModifySVGObservable,(nsISVGValue *, nsISVGValue::modificationType))
NS_IMETHOD SetValueString (const nsAString &aValue)=0
NS_IMETHOD GetValueString (nsAString &aValue)=0

Protected Member Functions

 nsSVGValue ()
virtual ~nsSVGValue ()
void WillModify (modificationType aModType=mod_other)
void DidModify (modificationType aModType=mod_other)
void ReleaseObservers ()
void NotifyObservers (SVGObserverNotifyFunction f, modificationType aModType)
PRInt32 GetModifyNestCount ()

Private Member Functions

virtual void OnDidModify ()

Private Attributes

nsSmallVoidArray mObservers
PRInt32 mModifyNestCount

Friends

class nsSVGValueAutoNotifier

Detailed Description

Definition at line 48 of file nsSVGValue.h.


Member Enumeration Documentation

Enumerator:
mod_other 
mod_context 
mod_die 

Definition at line 68 of file nsISVGValue.h.


Constructor & Destructor Documentation

nsSVGValue::nsSVGValue ( ) [protected]

Definition at line 42 of file nsSVGValue.cpp.

    : mModifyNestCount(0)
{
}
nsSVGValue::~nsSVGValue ( ) [protected, virtual]

Definition at line 47 of file nsSVGValue.cpp.

Here is the call graph for this function:


Member Function Documentation

Implements nsISVGValue.

Definition at line 97 of file nsSVGValue.cpp.

{
  nsIWeakReference* wr = NS_GetWeakReference(observer);
  if (!wr) return NS_ERROR_FAILURE;
  mObservers.AppendElement((void*)wr);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsISVGValue.

Definition at line 119 of file nsSVGValue.cpp.

{
  WillModify();
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 86 of file nsSVGValue.cpp.

{
  NS_ASSERTION(mModifyNestCount>0, "unbalanced Will/DidModify calls");
  if (--mModifyNestCount == 0) {
    OnDidModify();
    NotifyObservers(&nsISVGValueObserver::DidModifySVGObservable, aModType);
  }
}

Here is the call graph for this function:

Implements nsISVGValue.

Definition at line 126 of file nsSVGValue.cpp.

{
  DidModify();
  return NS_OK;
}

Here is the call graph for this function:

PRInt32 nsSVGValue::GetModifyNestCount ( ) [inline, protected]

Definition at line 79 of file nsSVGValue.h.

{ return mModifyNestCount; }
NS_IMETHOD nsISVGValue::GetValueString ( nsAString &  aValue) [pure virtual, inherited]
void nsSVGValue::NotifyObservers ( SVGObserverNotifyFunction  f,
modificationType  aModType 
) [protected]

Definition at line 66 of file nsSVGValue.cpp.

{
  PRInt32 count = mObservers.Count();
  for (PRInt32 i = 0; i < count; ++i) {
    nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
    nsCOMPtr<nsISVGValueObserver> observer = do_QueryReferent(wr);
    if (observer)
       (NS_STATIC_CAST(nsISVGValueObserver*,observer)->*f)(this, aModType);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

typedef nsSVGValue::NS_STDCALL_FUNCPROTO ( nsresult  ,
SVGObserverNotifyFunction  ,
nsISVGValueObserver  ,
DidModifySVGObservable  ,
(nsISVGValue *, nsISVGValue::modificationType  
)
virtual void nsSVGValue::OnDidModify ( ) [inline, private, virtual]

Definition at line 81 of file nsSVGValue.h.

{}; // hook that will be called before observers are notified

Here is the caller graph for this function:

Definition at line 53 of file nsSVGValue.cpp.

{
  PRInt32 count = mObservers.Count();
  PRInt32 i;
  for (i = 0; i < count; ++i) {
    nsIWeakReference* wr = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
    NS_RELEASE(wr);
  }
  while (i)
    mObservers.RemoveElementAt(--i);
}

Here is the caller graph for this function:

Implements nsISVGValue.

Definition at line 106 of file nsSVGValue.cpp.

{
  nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(observer);
  if (!wr) return NS_ERROR_FAILURE;
  PRInt32 i = mObservers.IndexOf((void*)wr);
  if (i<0) return NS_ERROR_FAILURE;
  nsIWeakReference* wr2 = NS_STATIC_CAST(nsIWeakReference*,mObservers.ElementAt(i));
  NS_RELEASE(wr2);
  mObservers.RemoveElementAt(i);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsISVGValue::SetValueString ( const nsAString &  aValue) [pure virtual, inherited]

Definition at line 79 of file nsSVGValue.cpp.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class nsSVGValueAutoNotifier [friend]

Definition at line 59 of file nsSVGValue.h.


Member Data Documentation

Definition at line 84 of file nsSVGValue.h.

nsSmallVoidArray nsSVGValue::mObservers [private]

Definition at line 81 of file nsSVGValue.h.


The documentation for this class was generated from the following files: