Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
nsMsgFilterDataSource Class Reference

#include <nsMsgFilterDataSource.h>

Inheritance diagram for nsMsgFilterDataSource:
Inheritance graph
[legend]
Collaboration diagram for nsMsgFilterDataSource:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsMsgFilterDataSource ()
virtual ~nsMsgFilterDataSource ()
NS_IMETHOD GetTargets (nsIRDFResource *source, nsIRDFResource *property, PRBool aTruthValue, nsISimpleEnumerator **_retval)
NS_IMETHOD GetTarget (nsIRDFResource *aSource, nsIRDFResource *aProperty, PRBool aTruthValue, nsIRDFNode **aResult)
NS_IMETHOD ArcLabelsOut (nsIRDFResource *source, nsISimpleEnumerator **_retval)
virtual nsresult Init ()
NS_DECL_ISUPPORTS
NS_DECL_NSIMSGRDFDATASOURCE
NS_DECL_NSIRDFDATASOURCE
virtual NS_DECL_NSIOBSERVER
void 
Cleanup ()
nsIRDFResource GetSource (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find an RDF resource that points to a given node over the specified arc & truth value.
nsISimpleEnumerator GetSources (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find all RDF resources that point to a given node over the specified arc & truth value.
nsIRDFNode GetTarget (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find a child of that is related to the source by the given arc arc and truth value.
nsISimpleEnumerator GetTargets (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find all children of that are related to the source by the given arc arc and truth value.
void Assert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Add an assertion to the graph.
void Unassert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 Remove an assertion from the graph.
void Change (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aOldTarget, in nsIRDFNode aNewTarget)
 Change an assertion from.
void Move (in nsIRDFResource aOldSource, in nsIRDFResource aNewSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 'Move' an assertion from
boolean HasAssertion (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Query whether an assertion exists in this graph.
void AddObserver (in nsIRDFObserver aObserver)
 Add an observer to this data source.
void RemoveObserver (in nsIRDFObserver aObserver)
 Remove an observer from this data source.
nsISimpleEnumerator ArcLabelsIn (in nsIRDFNode aNode)
 Get a cursor to iterate over all the arcs that point into a node.
nsISimpleEnumerator ArcLabelsOut (in nsIRDFResource aSource)
 Get a cursor to iterate over all the arcs that originate in a resource.
nsISimpleEnumerator GetAllResources ()
 Retrieve all of the resources that the data source currently refers to.
boolean IsCommandEnabled (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Returns whether a given command is enabled for a set of sources.
void DoCommand (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Perform the specified command on set of sources.
nsISimpleEnumerator GetAllCmds (in nsIRDFResource aSource)
 Returns the set of all commands defined for a given source.
boolean hasArcIn (in nsIRDFNode aNode, in nsIRDFResource aArc)
 Returns true if the specified node is pointed to by the specified arc.
boolean hasArcOut (in nsIRDFResource aSource, in nsIRDFResource aArc)
 Returns true if the specified node has the specified outward arc.
void beginUpdateBatch ()
 Notify observers that the datasource is about to send several notifications at once.
void endUpdateBatch ()
 Notify observers that the datasource has completed issuing a notification group.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Public Attributes

readonly attribute string URI
 The "URI" of the data source.
attribute nsIMsgWindow window

Protected Member Functions

nsIRDFServicegetRDFService ()
nsresult NotifyObservers (nsIRDFResource *subject, nsIRDFResource *property, nsIRDFNode *newObject, nsIRDFNode *oldObject, PRBool assert, PRBool change)
virtual nsresult NotifyPropertyChanged (nsIRDFResource *resource, nsIRDFResource *propertyResource, nsIRDFNode *newNode, nsIRDFNode *oldNode=nsnull)
nsresult GetTransactionManager (nsISupportsArray *sources, nsITransactionManager **aTransactionManager)

Static Protected Member Functions

static PRBool assertEnumFunc (nsISupports *aElement, void *aData)
static PRBool unassertEnumFunc (nsISupports *aElement, void *aData)
static PRBool changeEnumFunc (nsISupports *aElement, void *aData)

Protected Attributes

nsCOMPtr< nsIMsgWindowmWindow
PRBool m_shuttingDown
PRBool mInitialized

Private Member Functions

nsresult getFilterTarget (nsIMsgFilter *aFilter, nsIRDFResource *aProperty, PRBool aTruthValue, nsIRDFNode **aResult)
nsresult getFilterListTarget (nsIMsgFilterList *aFilter, nsIRDFResource *aProperty, PRBool aTruthValue, nsIRDFNode **aResult)
nsresult getFilterListTargets (nsIMsgFilterList *aFilter, nsIRDFResource *aSource, nsIRDFResource *aProperty, PRBool aTruthValue, nsISupportsArray *aResult)

Static Private Member Functions

static nsresult initGlobalObjects (nsIRDFService *rdf)
static nsresult cleanupGlobalObjects ()
static nsresult getServerArcsOut ()
static nsresult getFilterArcsOut ()

Static Private Attributes

static nsrefcnt mGlobalRefCount = 0
static nsCOMPtr< nsISupportsArraymFilterListArcsOut
static nsCOMPtr< nsISupportsArraymFilterArcsOut
static nsCOMPtr< nsIRDFResourcekNC_Child
static nsCOMPtr< nsIRDFResourcekNC_Name
static nsCOMPtr< nsIRDFResourcekNC_Enabled
static nsCOMPtr< nsIRDFLiteralkTrueLiteral

Detailed Description

Definition at line 49 of file nsMsgFilterDataSource.h.


Constructor & Destructor Documentation

Definition at line 63 of file nsMsgFilterDataSource.cpp.

Here is the call graph for this function:

Definition at line 69 of file nsMsgFilterDataSource.cpp.

Here is the call graph for this function:


Member Function Documentation

Add an observer to this data source.

If the datasource supports observers, the datasource source should hold a strong reference to the observer.

Here is the caller graph for this function:

Get a cursor to iterate over all the arcs that point into a node.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that labels points to a valid (but possible empty) nsISimpleEnumerator object.

Here is the caller graph for this function:

Definition at line 218 of file nsMsgFilterDataSource.cpp.

{
    nsresult rv;
    nsCOMPtr<nsISupportsArray> arcs;

    nsCOMPtr<nsISupports> filterDelegate;
    
    rv = aSource->GetDelegate("filter", NS_GET_IID(nsISupports),
                              (void **)getter_AddRefs(filterDelegate));
    
    if (NS_FAILED(rv)) return NS_RDF_NO_VALUE;

    //
    // nsIMsgFilterList
    //
    nsCOMPtr<nsIMsgFilterList> filterList =
        do_QueryInterface(filterDelegate, &rv);
    
    if (NS_SUCCEEDED(rv)) {
        arcs = mFilterListArcsOut;
    
    } else {

        //
        // nsIMsgFilter
        //
        nsCOMPtr<nsIMsgFilter> filter =
            do_QueryInterface(filterDelegate, &rv);
        
        if (NS_SUCCEEDED(rv))
            arcs = mFilterArcsOut;
        
        else {
            NS_WARNING("GetTargets(): unknown filter delegate!\n");

        }
    }

    if (!arcs) {
        *aResult = nsnull;
        return NS_RDF_NO_VALUE;
    }

    nsArrayEnumerator* enumerator =
        new nsArrayEnumerator(arcs);
    NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);
  
    *aResult = enumerator;
    NS_ADDREF(*aResult);

    return NS_OK;
}

Here is the call graph for this function:

Get a cursor to iterate over all the arcs that originate in a resource.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that labels points to a valid (but possible empty) nsISimpleEnumerator object.

Here is the caller graph for this function:

void nsIRDFDataSource::Assert ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Add an assertion to the graph.

Here is the caller graph for this function:

PRBool nsMsgRDFDataSource::assertEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 401 of file nsMsgRDFDataSource.cpp.

{
  nsMsgRDFNotification *note = (nsMsgRDFNotification *)aData;
  nsIRDFObserver* observer = (nsIRDFObserver *)aElement;
  
  observer->OnAssert(note->datasource,
                     note->subject,
                     note->property,
                     note->newObject);
  return PR_TRUE;
}

Here is the caller graph for this function:

Notify observers that the datasource is about to send several notifications at once.

This must be followed by calling endUpdateBatch(), otherwise viewers will get out of sync.

void nsIRDFDataSource::Change ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aOldTarget,
in nsIRDFNode  aNewTarget 
) [inherited]

Change an assertion from.

[aSource]--[aProperty]-->[aOldTarget]

to

[aSource]--[aProperty]-->[aNewTarget]

Here is the caller graph for this function:

PRBool nsMsgRDFDataSource::changeEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 427 of file nsMsgRDFDataSource.cpp.

{
  nsMsgRDFNotification* note = (nsMsgRDFNotification *)aData;
  nsIRDFObserver* observer = (nsIRDFObserver *)aElement;

  observer->OnChange(note->datasource,
                     note->subject,
                     note->property,
                     note->oldObject, note->newObject);
  return PR_TRUE;
}

Here is the caller graph for this function:

void nsMsgRDFDataSource::Cleanup ( ) [virtual, inherited]

Reimplemented in nsMsgRecentFoldersDataSource, nsMsgFlatFolderDataSource, nsMsgAccountManagerDataSource, and nsMsgFolderDataSource.

Definition at line 92 of file nsMsgRDFDataSource.cpp.

{
    nsresult rv;
    mRDFService = nsnull;
    
    // release ourselves from the observer service
    nsCOMPtr<nsIObserverService> obs = do_GetService("@mozilla.org/observer-service;1",
                                                     &rv);
    if (NS_SUCCEEDED(rv)) {
        rv = obs->RemoveObserver(NS_STATIC_CAST(nsIObserver*, this),
                                 NS_XPCOM_SHUTDOWN_OBSERVER_ID);
    }
    
    // release the window
       mWindow = nsnull;

    mInitialized = PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 77 of file nsMsgFilterDataSource.cpp.

Here is the caller graph for this function:

void nsIRDFDataSource::DoCommand ( in nsISupportsArray  aSources,
in nsIRDFResource  aCommand,
in nsISupportsArray  aArguments 
) [inherited]

Perform the specified command on set of sources.

Here is the caller graph for this function:

Notify observers that the datasource has completed issuing a notification group.

Returns the set of all commands defined for a given source.

Here is the caller graph for this function:

Retrieve all of the resources that the data source currently refers to.

Here is the caller graph for this function:

static nsresult nsMsgFilterDataSource::getFilterArcsOut ( ) [static, private]
nsresult nsMsgFilterDataSource::getFilterListTarget ( nsIMsgFilterList aFilter,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsIRDFNode **  aResult 
) [private]

Definition at line 350 of file nsMsgFilterDataSource.cpp.

{

    // here we probably need to answer to the #child property
    // so that RDF realizes this is a container
    return NS_ERROR_NOT_IMPLEMENTED;
}

Here is the caller graph for this function:

nsresult nsMsgFilterDataSource::getFilterListTargets ( nsIMsgFilterList aFilter,
nsIRDFResource aSource,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsISupportsArray aResult 
) [private]

Definition at line 283 of file nsMsgFilterDataSource.cpp.

{
    nsresult rv;

    // get the URI of the source resource, say mailbox://username@host/folder
    // from there we'll append ";filter", and then enumerate the
    // filters to get all the resources like
    // mailbox://username@host/folder;filterName=abcd

    // a better way to do this might be to ask the filter
    // what folder it's in. Then we wouldn't need aSource
    const char* filterListUri;
    aSource->GetValueConst(&filterListUri);

    nsCAutoString filterUri(filterListUri);
    filterUri.Append(";filterName=");

    // we'll use the length of this base string to truncate the string later
    PRInt32 baseFilterUriLength = filterUri.Length();

    // now start looping through the filters
    // we're not actually touching any filters here, just creating
    // resources that correspond to them.
    PRUint32 filterCount;
    rv = aFilterList->GetFilterCount(&filterCount);
    if (NS_FAILED(rv)) return rv;

    PRUint32 i;
    for (i=0; i<filterCount; i++) {
        nsCOMPtr<nsIMsgFilter> filter;
        rv = aFilterList->GetFilterAt(i, getter_AddRefs(filter));
        if (NS_FAILED(rv)) continue;

        PRBool isTemporary;
        rv = filter->GetTemporary(&isTemporary);
        NS_ASSERTION(NS_SUCCEEDED(rv), "GetTemporary() failed");
        if (isTemporary)
          continue;

        nsXPIDLString filterName;
        rv = filter->GetFilterName(getter_Copies(filterName));
        if (NS_FAILED(rv)) return rv;

        nsAutoString filterString(filterName);

        char *utf8Name = ToNewUTF8String(filterString);
        filterUri.Append(utf8Name);
        Recycle(utf8Name);
        
        nsCOMPtr<nsIRDFResource> filterResource;
        rv = getRDFService()->GetResource(filterUri,
                              getter_AddRefs(filterResource));
        if (NS_SUCCEEDED(rv))
            aResult->AppendElement(filterResource);

        // now reduce the URI back to the base uri
        filterUri.Truncate(baseFilterUriLength);
    }
    
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFilterDataSource::getFilterTarget ( nsIMsgFilter aFilter,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsIRDFNode **  aResult 
) [private]

Definition at line 363 of file nsMsgFilterDataSource.cpp.

{

    if (aProperty == kNC_Name.get()) {
        nsXPIDLString filterName;
        aFilter->GetFilterName(getter_Copies(filterName));
        return createNode((const PRUnichar*)filterName, aResult,
                          getRDFService());
        
    } else if (aProperty == kNC_Enabled.get()) {
        PRBool enabled;
        aFilter->GetEnabled(&enabled);
        if (enabled) {
            *aResult = kTrueLiteral;
            NS_ADDREF(*aResult);
            return NS_OK;
        }
    }
    
    return NS_RDF_NO_VALUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIRDFService * nsMsgRDFDataSource::getRDFService ( ) [protected, inherited]

Definition at line 356 of file nsMsgRDFDataSource.cpp.

{
    if (!mRDFService && !m_shuttingDown) {
        nsresult rv;
        mRDFService = do_GetService(kRDFServiceCID, &rv);
        if (NS_FAILED(rv)) return nsnull;
    }
    
    return mRDFService;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult nsMsgFilterDataSource::getServerArcsOut ( ) [static, private]
nsIRDFResource nsIRDFDataSource::GetSource ( in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Find an RDF resource that points to a given node over the specified arc & truth value.

Returns:
NS_RDF_NO_VALUE if there is no source that leads to the target with the specified property.

Here is the caller graph for this function:

nsISimpleEnumerator nsIRDFDataSource::GetSources ( in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Find all RDF resources that point to a given node over the specified arc & truth value.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that nsISimpleEnumerator points to a valid (but possibly empty) cursor.

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgFilterDataSource::GetTarget ( nsIRDFResource aSource,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsIRDFNode **  aResult 
)

Definition at line 174 of file nsMsgFilterDataSource.cpp.

{
    nsresult rv;
    *aResult = nsnull;

    
    nsCOMPtr<nsISupports> filterDelegate;
    aSource->GetDelegate("filter", NS_GET_IID(nsISupports),
                         (void **)getter_AddRefs(filterDelegate));

    //
    // nsIMsgFilterList
    //
    nsCOMPtr<nsIMsgFilterList> filterList =
        do_QueryInterface(filterDelegate, &rv);

    if (NS_SUCCEEDED(rv))
        rv = getFilterListTarget(filterList, aProperty, aTruthValue, aResult);
    else {

        //
        // nsIMsgFilter
        //
        nsCOMPtr<nsIMsgFilter> filter =
            do_QueryInterface(filterDelegate, &rv);
        if (NS_SUCCEEDED(rv))
            rv = getFilterTarget(filter, aProperty, aTruthValue, aResult);
        
        else {
            NS_WARNING("GetTarget(): unknown filter delegate!\n");
        }
    }

    if (*aResult)
        return NS_OK;

    return NS_RDF_NO_VALUE;
}

Here is the call graph for this function:

nsIRDFNode nsIRDFDataSource::GetTarget ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in boolean  aTruthValue 
) [inherited]

Find a child of that is related to the source by the given arc arc and truth value.

Returns:
NS_RDF_NO_VALUE if there is no target accessable from the source via the specified property.

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgFilterDataSource::GetTargets ( nsIRDFResource source,
nsIRDFResource property,
PRBool  aTruthValue,
nsISimpleEnumerator **  _retval 
)

Definition at line 109 of file nsMsgFilterDataSource.cpp.

{
    nsresult rv;
    
    nsCOMPtr<nsISupportsArray> resourceList;
    rv = NS_NewISupportsArray(getter_AddRefs(resourceList));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsISupports> filterDelegate;
    
    // first see if it's a filter list
    rv = aSource->GetDelegate("filter", NS_GET_IID(nsISupports),
                             (void **)getter_AddRefs(filterDelegate));

    if (NS_FAILED(rv)) {
        // no filter delegate
        nsSingletonEnumerator *cursor = new nsSingletonEnumerator(nsnull);
        NS_ENSURE_TRUE(cursor, NS_ERROR_OUT_OF_MEMORY);
        
        *aResult = cursor;
        NS_ADDREF(*aResult);
        return NS_OK;
    }
        

    //
    // nsIMsgFilterList
    //
    nsCOMPtr<nsIMsgFilterList> filterList =
        do_QueryInterface(filterDelegate, &rv);
    
    if (NS_SUCCEEDED(rv)) {
        rv = getFilterListTargets(filterList, aSource, aProperty,
                                  aTruthValue, resourceList);
    }
    else {

        //
        // nsIMsgFilter
        //
        nsCOMPtr<nsIMsgFilter> filter =
            do_QueryInterface(filterDelegate, &rv);

        if (NS_SUCCEEDED(rv)) {
            // filters do not have multiple targets, right?
            // do we have to call GetTarget and return the result?
        }

        else {
            NS_WARNING("ArcLabelsOut(): unknown filter delegate!\n");
        }
    }
    
    nsArrayEnumerator *cursor = new nsArrayEnumerator(resourceList);
    NS_ENSURE_TRUE(cursor, NS_ERROR_OUT_OF_MEMORY);
    
    *aResult = cursor;
    NS_ADDREF(*aResult);
    return NS_OK;
}

Here is the call graph for this function:

nsISimpleEnumerator nsIRDFDataSource::GetTargets ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in boolean  aTruthValue 
) [inherited]

Find all children of that are related to the source by the given arc arc and truth value.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that nsISimpleEnumerator points to a valid (but possibly empty) cursor.

Here is the caller graph for this function:

nsresult nsMsgRDFDataSource::GetTransactionManager ( nsISupportsArray sources,
nsITransactionManager **  aTransactionManager 
) [protected, inherited]

Definition at line 439 of file nsMsgRDFDataSource.cpp.

{
  if(!aTransactionManager)
    return NS_ERROR_NULL_POINTER;
  
  *aTransactionManager = nsnull;
  nsresult rv = NS_OK;
  
  nsCOMPtr<nsITransactionManager> transactionManager;
  
  PRUint32 cnt;
  
  rv = aSources->Count(&cnt);
  if (NS_FAILED(rv)) return rv;
  
  if (cnt > 0)
  {
    transactionManager = do_QueryElementAt(aSources, 0, &rv);
    if (NS_SUCCEEDED(rv) && transactionManager)
    {
      aSources->RemoveElementAt(0);
      NS_IF_ADDREF(*aTransactionManager = transactionManager);
    }
  }
  
  return NS_OK;      
}

Here is the call graph for this function:

boolean nsIRDFDataSource::hasArcIn ( in nsIRDFNode  aNode,
in nsIRDFResource  aArc 
) [inherited]

Returns true if the specified node is pointed to by the specified arc.

Equivalent to enumerating ArcLabelsIn and comparing for the specified arc.

Returns true if the specified node has the specified outward arc.

Equivalent to enumerating ArcLabelsOut and comparing for the specified arc.

boolean nsIRDFDataSource::HasAssertion ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Query whether an assertion exists in this graph.

Here is the caller graph for this function:

nsresult nsMsgRDFDataSource::Init ( void  ) [virtual, inherited]

Reimplemented in nsMsgFlatFolderDataSource, nsMsgAccountManagerDataSource, and nsMsgFolderDataSource.

Definition at line 70 of file nsMsgRDFDataSource.cpp.

{
    nsresult rv=NS_OK;

    if (mInitialized)
        return NS_ERROR_ALREADY_INITIALIZED;
    
    /* Add an observer to XPCOM shutdown */
    nsCOMPtr<nsIObserverService> obs = do_GetService("@mozilla.org/observer-service;1",
                                                     &rv);
    if (NS_FAILED(rv)) return rv;
    rv = obs->AddObserver(NS_STATIC_CAST(nsIObserver*, this), NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);
    if (NS_FAILED(rv)) return rv;

    /* Get and keep the rdf service. Will be released by the observer */
    getRDFService();
    
    mInitialized=PR_TRUE;
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

boolean nsIRDFDataSource::IsCommandEnabled ( in nsISupportsArray  aSources,
in nsIRDFResource  aCommand,
in nsISupportsArray  aArguments 
) [inherited]

Returns whether a given command is enabled for a set of sources.

Here is the caller graph for this function:

void nsIRDFDataSource::Move ( in nsIRDFResource  aOldSource,
in nsIRDFResource  aNewSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget 
) [inherited]

'Move' an assertion from

[aOldSource]--[aProperty]-->[aTarget]

to

[aNewSource]--[aProperty]-->[aTarget]

Here is the caller graph for this function:

nsresult nsMsgRDFDataSource::NotifyObservers ( nsIRDFResource subject,
nsIRDFResource property,
nsIRDFNode newObject,
nsIRDFNode oldObject,
PRBool  assert,
PRBool  change 
) [protected, inherited]

Definition at line 378 of file nsMsgRDFDataSource.cpp.

{
    NS_ASSERTION(!(change && assert),
                 "Can't change and assert at the same time!\n");
    
       if(mObservers)
       {
              nsMsgRDFNotification note = { this, subject, property, newObject, oldObject };
              if(change)
                     mObservers->EnumerateForwards(changeEnumFunc, &note);
              else if (assert)
                     mObservers->EnumerateForwards(assertEnumFunc, &note);
              else
                     mObservers->EnumerateForwards(unassertEnumFunc, &note);
  }
       return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgRDFDataSource::NotifyPropertyChanged ( nsIRDFResource resource,
nsIRDFResource propertyResource,
nsIRDFNode newNode,
nsIRDFNode oldNode = nsnull 
) [protected, virtual, inherited]

Reimplemented in nsMsgRecentFoldersDataSource, and nsMsgUnreadFoldersDataSource.

Definition at line 367 of file nsMsgRDFDataSource.cpp.

{

  NotifyObservers(resource, propertyResource, newNode, oldNode, PR_FALSE, PR_TRUE);
  return NS_OK;

}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.

Remove an observer from this data source.

Here is the caller graph for this function:

void nsIRDFDataSource::Unassert ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget 
) [inherited]

Remove an assertion from the graph.

Here is the caller graph for this function:

PRBool nsMsgRDFDataSource::unassertEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 414 of file nsMsgRDFDataSource.cpp.

{
  nsMsgRDFNotification* note = (nsMsgRDFNotification *)aData;
  nsIRDFObserver* observer = (nsIRDFObserver *)aElement;

  observer->OnUnassert(note->datasource,
                       note->subject,
                       note->property,
                       note->newObject);
  return PR_TRUE;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 100 of file nsMsgFilterDataSource.h.

Definition at line 102 of file nsMsgFilterDataSource.h.

Definition at line 101 of file nsMsgFilterDataSource.h.

Definition at line 103 of file nsMsgFilterDataSource.h.

Definition at line 88 of file nsMsgRDFDataSource.h.

Definition at line 97 of file nsMsgFilterDataSource.h.

Definition at line 96 of file nsMsgFilterDataSource.h.

Definition at line 88 of file nsMsgFilterDataSource.h.

PRBool nsMsgRDFDataSource::mInitialized [protected, inherited]

Definition at line 89 of file nsMsgRDFDataSource.h.

Definition at line 86 of file nsMsgRDFDataSource.h.

readonly attribute string nsIRDFDataSource::URI [inherited]

The "URI" of the data source.

This used by the RDF service's |GetDataSource()| method to cache datasources.

Definition at line 56 of file nsIRDFDataSource.idl.

Definition at line 47 of file nsIMsgRDFDataSource.idl.


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