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 | Private Attributes
nsAbDirectoryDataSource Class Reference

The addressbook data source. More...

#include <nsDirectoryDataSource.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIABLISTENER
NS_DECL_NSIOBSERVER 
nsAbDirectoryDataSource (void)
virtual ~nsAbDirectoryDataSource (void)
virtual nsresult Init ()
NS_IMETHOD GetURI (char **uri)
NS_IMETHOD GetTarget (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsIRDFNode **target)
NS_IMETHOD GetTargets (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsISimpleEnumerator **targets)
NS_IMETHOD Assert (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv)
NS_IMETHOD HasAssertion (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv, PRBool *hasAssertion)
NS_IMETHOD HasArcOut (nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *result)
NS_IMETHOD ArcLabelsOut (nsIRDFResource *source, nsISimpleEnumerator **labels)
NS_IMETHOD IsCommandEnabled (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, PRBool *aResult)
NS_IMETHOD DoCommand (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
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 onItemAdded (in nsISupports parentDir, in nsISupports item)
 Called when an address book item (book, card or list) is added.
void onItemRemoved (in nsISupports parentDir, in nsISupports item)
 Called when an address book, mailing list or card is removed.
void onItemPropertyChanged (in nsISupports item, in string property, in wstring oldValue, in wstring newValue)
 Called when an address book item is changed.
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.

Protected Member Functions

nsresult createDirectoryNode (nsIAbDirectory *directory, nsIRDFResource *property, nsIRDFNode **target)
nsresult createDirectoryNameNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryUriNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryChildNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryIsMailListNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryIsRemoteNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryIsSecureNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryIsWriteableNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult createDirectoryTreeNameSortNode (nsIAbDirectory *directory, nsIRDFNode **target)
nsresult getDirectoryArcLabelsOut (nsIAbDirectory *directory, nsISupportsArray **arcs)
nsresult DoModifyDirectory (nsISupportsArray *parentDir, nsISupportsArray *arguments)
nsresult DoDeleteFromDirectory (nsISupportsArray *parentDirs, nsISupportsArray *delDirs)
nsresult DoDeleteCardsFromDirectory (nsIAbDirectory *directory, nsISupportsArray *delDirs)
nsresult DoDirectoryAssert (nsIAbDirectory *directory, nsIRDFResource *property, nsIRDFNode *target)
nsresult DoDirectoryHasAssertion (nsIAbDirectory *directory, nsIRDFResource *property, nsIRDFNode *target, PRBool tv, PRBool *hasAssertion)
nsresult GetTargetHasAssertion (nsIRDFDataSource *dataSource, nsIRDFResource *dirResource, nsIRDFResource *property, PRBool tv, nsIRDFNode *target, PRBool *hasAssertion)
nsresult CreateCollationKey (const nsString &aSource, PRUint8 **aKey, PRUint32 *aLength)
nsresult createNode (const PRUnichar *str, nsIRDFNode **node)
nsresult createBlobNode (PRUint8 *value, PRUint32 &length, nsIRDFNode **node, nsIRDFService *rdfService)
nsresult NotifyPropertyChanged (nsIRDFResource *resource, nsIRDFResource *propertyResource, const PRUnichar *oldValue, const PRUnichar *newValue)
nsresult NotifyObservers (nsIRDFResource *subject, nsIRDFResource *property, nsIRDFNode *object, PRBool assert, PRBool change)
nsresult CreateProxyObservers ()
nsresult CreateProxyObserver (nsIRDFObserver *observer, nsIRDFObserver **proxyObserver)

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< nsIRDFResourcekNC_Child
nsCOMPtr< nsIRDFResourcekNC_DirName
nsCOMPtr< nsIRDFResourcekNC_CardChild
nsCOMPtr< nsIRDFResourcekNC_DirUri
nsCOMPtr< nsIRDFResourcekNC_IsMailList
nsCOMPtr< nsIRDFResourcekNC_IsRemote
nsCOMPtr< nsIRDFResourcekNC_IsSecure
nsCOMPtr< nsIRDFResourcekNC_IsWriteable
nsCOMPtr< nsIRDFResourcekNC_DirTreeNameSort
nsCOMPtr< nsICollationmCollationKeyGenerator
nsCOMPtr< nsIRDFResourcekNC_Modify
nsCOMPtr< nsIRDFResourcekNC_Delete
nsCOMPtr< nsIRDFResourcekNC_DeleteCards
nsCOMPtr< nsIRDFNodekTrueLiteral
nsCOMPtr< nsIRDFNodekFalseLiteral

Private Member Functions

nsresult Cleanup ()

Private Attributes

PRBool mInitialized

Detailed Description

The addressbook data source.

Definition at line 56 of file nsDirectoryDataSource.h.


Constructor & Destructor Documentation

Definition at line 79 of file nsDirectoryDataSource.cpp.

{
}

Definition at line 83 of file nsDirectoryDataSource.cpp.

{
}

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 329 of file nsDirectoryDataSource.cpp.

{
  nsCOMPtr<nsISupportsArray> arcs;
  nsresult rv = NS_RDF_NO_VALUE;

  nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(source, &rv));
  if (NS_SUCCEEDED(rv)) {
    rv = getDirectoryArcLabelsOut(directory, getter_AddRefs(arcs));
  }
  else {
    // how to return an empty cursor?
    // for now return a 0-length nsISupportsArray
    NS_NewISupportsArray(getter_AddRefs(arcs));
  }

  nsArrayEnumerator* cursor =
    new nsArrayEnumerator(arcs);
  
  if (cursor == nsnull)
    return NS_ERROR_OUT_OF_MEMORY;
  NS_ADDREF(cursor);
  *labels = cursor;
  
  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:

Definition at line 278 of file nsDirectoryDataSource.cpp.

{
       nsresult rv;
       nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(source, &rv));
       //We don't handle tv = PR_FALSE at the moment.
       if(NS_SUCCEEDED(rv) && tv)
              return DoDirectoryAssert(directory, property, target);
       else
              return NS_ERROR_FAILURE;
}

Here is the call 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 nsAbRDFDataSource::assertEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 108 of file nsAbRDFDataSource.cpp.

{
  nsAbRDFNotification *note = (nsAbRDFNotification *)aData;
  nsIRDFObserver* observer = (nsIRDFObserver *)aElement;
  
  observer->OnAssert(note->datasource,
                     note->subject,
                     note->property,
                     note->object);
  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 nsAbRDFDataSource::changeEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 96 of file nsAbRDFDataSource.cpp.

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

  observer->OnChange(note->datasource,
                     note->subject,
                     note->property,
                     nsnull, note->object);
  return PR_TRUE;
}

Here is the caller graph for this function:

Definition at line 87 of file nsDirectoryDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr <nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
  NS_ENSURE_SUCCESS(rv,rv);

  rv = rdf->UnregisterDataSource(this);
  NS_ENSURE_SUCCESS(rv,rv);

  nsCOMPtr<nsIAddrBookSession> abSession = do_GetService(NS_ADDRBOOKSESSION_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv,rv);

  rv = abSession->RemoveAddressBookListener(this);
  NS_ENSURE_SUCCESS(rv,rv);
  
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsAbRDFDataSource::createBlobNode ( PRUint8 value,
PRUint32 length,
nsIRDFNode **  node,
nsIRDFService rdfService 
) [protected, inherited]

Definition at line 83 of file nsAbRDFDataSource.cpp.

{
  NS_ENSURE_ARG_POINTER(node);
  NS_ENSURE_ARG_POINTER(rdfService);

  *node = nsnull;
  nsCOMPtr<nsIRDFBlob> blob;
  nsresult rv = rdfService->GetBlobLiteral(value, length, getter_AddRefs(blob));
  NS_ENSURE_SUCCESS(rv,rv);
  NS_IF_ADDREF(*node = blob);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbDirectoryDataSource::CreateCollationKey ( const nsString aSource,
PRUint8 **  aKey,
PRUint32 aLength 
) [protected]

Definition at line 768 of file nsDirectoryDataSource.cpp.

{
  NS_ENSURE_ARG_POINTER(aKey);
  NS_ENSURE_ARG_POINTER(aLength);

  nsresult rv;
  if (!mCollationKeyGenerator)
  {
    nsCOMPtr<nsILocaleService> localeSvc = do_GetService(NS_LOCALESERVICE_CONTRACTID,&rv); 
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsILocale> locale; 
    rv = localeSvc->GetApplicationLocale(getter_AddRefs(locale));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr <nsICollationFactory> factory = do_CreateInstance(kCollationFactoryCID, &rv); 
    NS_ENSURE_SUCCESS(rv, rv);

    rv = factory->CreateCollation(locale, getter_AddRefs(mCollationKeyGenerator));
    NS_ENSURE_SUCCESS(rv, rv);
  }

  return mCollationKeyGenerator->AllocateRawSortKey(nsICollation::kCollationCaseInSensitive, aSource, aKey, aLength);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 602 of file nsDirectoryDataSource.cpp.

{
       nsCOMPtr<nsISupportsArray> pAddressLists;
       directory->GetAddressLists(getter_AddRefs(pAddressLists));

       if (pAddressLists)
       {
              PRUint32 total = 0;
              pAddressLists->Count(&total);

              if (total)
              {
                     PRBool isMailList = PR_FALSE;
                     directory->GetIsMailList(&isMailList);
                     if (!isMailList)
      {
        // fetch the last element 
        nsCOMPtr<nsIRDFResource> mailList = do_QueryElementAt(pAddressLists, total - 1);
        NS_IF_ADDREF(*target = mailList);
      } 
    } // if total
  } // if pAddressLists
       
  return (*target ? NS_OK : NS_RDF_NO_VALUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 666 of file nsDirectoryDataSource.cpp.

{
  nsresult rv;
  PRBool isMailList;
  rv = directory->GetIsMailList(&isMailList);
  NS_ENSURE_SUCCESS(rv, rv);
  
  NS_IF_ADDREF(*target = (isMailList ? kTrueLiteral : kFalseLiteral));
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 630 of file nsDirectoryDataSource.cpp.

{
  PRBool isRemote;
  nsresult rv = directory->GetIsRemote(&isRemote);
  NS_ENSURE_SUCCESS(rv, rv);
  
  NS_IF_ADDREF(*target = (isRemote ? kTrueLiteral : kFalseLiteral));
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 642 of file nsDirectoryDataSource.cpp.

{
  PRBool IsSecure;
  nsresult rv = directory->GetIsSecure(&IsSecure);
  NS_ENSURE_SUCCESS(rv, rv);
  
  NS_IF_ADDREF(*target = (IsSecure ? kTrueLiteral : kFalseLiteral));
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 654 of file nsDirectoryDataSource.cpp.

{
  PRBool isWriteable;
  nsresult rv = directory->GetOperations(&isWriteable);
  NS_ENSURE_SUCCESS(rv, rv);
  
  NS_IF_ADDREF(*target = ((isWriteable & nsIAbDirectory::opWrite) ? kTrueLiteral : kFalseLiteral));
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 574 of file nsDirectoryDataSource.cpp.

{
       nsresult rv = NS_OK;

        nsXPIDLString name;
       rv = directory->GetDirName(getter_Copies(name));
       NS_ENSURE_SUCCESS(rv, rv);
       rv = createNode(name.get(), target);
  NS_ENSURE_SUCCESS(rv,rv);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbDirectoryDataSource::createDirectoryNode ( nsIAbDirectory directory,
nsIRDFResource property,
nsIRDFNode **  target 
) [protected]

Definition at line 548 of file nsDirectoryDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;
  
  if ((kNC_DirName == property))
         rv = createDirectoryNameNode(directory, target);
  else if ((kNC_DirUri == property))
         rv = createDirectoryUriNode(directory, target);
  else if ((kNC_Child == property))
         rv = createDirectoryChildNode(directory, target);
  else if ((kNC_IsMailList == property))
         rv = createDirectoryIsMailListNode(directory, target);
  else if ((kNC_IsRemote == property))
         rv = createDirectoryIsRemoteNode(directory, target);
  else if ((kNC_IsSecure == property))
         rv = createDirectoryIsSecureNode(directory, target);
  else if ((kNC_IsWriteable == property))
         rv = createDirectoryIsWriteableNode(directory, target);
  else if ((kNC_DirTreeNameSort == property))
    rv = createDirectoryTreeNameSortNode(directory, target);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 679 of file nsDirectoryDataSource.cpp.

{
  nsXPIDLString name;
  nsresult rv = directory->GetDirName(getter_Copies(name));
       NS_ENSURE_SUCCESS(rv, rv);

  /* sort addressbooks in this order - Personal Addressbook, Collected Addresses, MDB, LDAP -
   * by prefixing address book names with numbers and using the xul sort service.
   *
   *  0Personal Address Book
   *  1Collected Address Book
   *  2MAB1
   *    5MAB1LIST1
   *    5MAB1LIST2
   *  2MAB2
   *    5MAB2LIST1
   *    5MAB2LIST2
   *  3LDAP1
   *  3LDAP2
   *  4MAPI1
   *  4MAPI2
   */

  // Get isMailList
  PRBool isMailList = PR_FALSE;
  rv = directory->GetIsMailList(&isMailList);
  NS_ENSURE_SUCCESS(rv, rv);

  nsAutoString sortString;

  if (isMailList)
    // Mailing Lists don't need a top level sort position.
    sortString.AppendInt(5);
  else
  {
    // If its not a mailing list, find out what else we need to know.
    nsCOMPtr<nsIRDFResource> resource = do_QueryInterface(directory);
    const char *uri = nsnull;
    rv = resource->GetValueConst(&uri);
    NS_ENSURE_SUCCESS(rv,rv);

    // Get directory type.
    nsCOMPtr <nsIAbDirectoryProperties> properties;
    rv = directory->GetDirectoryProperties(getter_AddRefs(properties));
    NS_ENSURE_SUCCESS(rv, rv);

    PRUint32 dirType;
    rv = properties->GetDirType(&dirType);
    NS_ENSURE_SUCCESS(rv, rv);

    PRInt32 position;
    rv = properties->GetPosition(&position);
    NS_ENSURE_SUCCESS(rv, rv);

    // top level sort will be by position. Sort by type under that...
    sortString.Append((PRUnichar) (position + 'a'));

    if (dirType == PABDirectory)
    {
      if (strcmp(uri, kPersonalAddressbookUri) == 0)
        sortString.AppendInt(0);  // Personal addrbook
      else if (strcmp(uri, kCollectedAddressbookUri) == 0)
        sortString.AppendInt(1);  // Collected addrbook
      else
        sortString.AppendInt(2);  // Normal addrbook 
    }
    else if (dirType == LDAPDirectory)
      sortString.AppendInt(3);    // LDAP addrbook
    else if (dirType == MAPIDirectory)
      sortString.AppendInt(4);    // MAPI addrbook
    else
      sortString.AppendInt(6);    // everything else comes last
  }

  sortString += name;
  PRUint8 *sortKey = nsnull;
  PRUint32 sortKeyLength;
  rv = CreateCollationKey(sortString, &sortKey, &sortKeyLength);
  NS_ENSURE_SUCCESS(rv, rv);
  nsCOMPtr <nsIRDFService> rdfService = do_GetService (NS_RDF_CONTRACTID "/rdf-service;1", &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  createBlobNode(sortKey, sortKeyLength, target, rdfService);
  NS_ENSURE_SUCCESS(rv, rv);
  PR_Free(sortKey);

  return NS_OK;

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 587 of file nsDirectoryDataSource.cpp.

{
  nsCOMPtr<nsIRDFResource> source(do_QueryInterface(directory));

  nsXPIDLCString uri;
  nsresult rv = source->GetValue(getter_Copies(uri));
  NS_ENSURE_SUCCESS(rv, rv);
  nsAutoString nameString; nameString.AssignWithConversion(uri);
  rv = createNode(nameString.get(), target);
  NS_ENSURE_SUCCESS(rv,rv);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbRDFDataSource::createNode ( const PRUnichar str,
nsIRDFNode **  node 
) [protected, inherited]

Definition at line 68 of file nsAbRDFDataSource.cpp.

{
       *node = nsnull;
       nsresult rv; 
    nsCOMPtr<nsIRDFService> rdf(do_GetService("@mozilla.org/rdf/rdf-service;1", &rv)); 
       NS_ENSURE_SUCCESS(rv, rv); // always check this before proceeding 
       nsCOMPtr<nsIRDFLiteral> value;
       rv = rdf->GetLiteral(str, getter_AddRefs(value));
       if (NS_SUCCEEDED(rv)) 
       {
              NS_IF_ADDREF(*node = value);
       }
       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbRDFDataSource::CreateProxyObserver ( nsIRDFObserver observer,
nsIRDFObserver **  proxyObserver 
) [protected, inherited]

Definition at line 132 of file nsAbRDFDataSource.cpp.

{
       nsresult rv;

       nsCOMPtr<nsIEventQueueService> eventQSvc = do_GetService (NS_EVENTQUEUESERVICE_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);

       // Get the UI event queue
       nsCOMPtr<nsIEventQueue> uiQueue;
       rv = eventQSvc->GetSpecialEventQueue (
                     nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
                     getter_AddRefs (uiQueue));
       NS_ENSURE_SUCCESS(rv, rv);

       nsCOMPtr<nsIProxyObjectManager> proxyMgr = 
              do_GetService(NS_XPCOMPROXY_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);

       // Proxy the observer on the UI queue
       /*
        * TODO
        * Currenly using PROXY_ASYNC, however
        * this can flood the event queue if
        * rate of events on the observer is
        * greater that the time to process the
        * events.
        * This causes the UI to pause.
        */
       rv = proxyMgr->GetProxyForObject (uiQueue,
              NS_GET_IID(nsIRDFObserver),
              observer,
              PROXY_ASYNC | PROXY_ALWAYS,
              (void** )proxyObserver);

       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 170 of file nsAbRDFDataSource.cpp.

{
       nsresult rv = NS_OK;

       PRUint32 nObservers;
       mObservers->Count (&nObservers);

       if (!mProxyObservers)
       {
              rv = NS_NewISupportsArray(getter_AddRefs(mProxyObservers));
              NS_ENSURE_SUCCESS(rv, rv);
       }

       PRUint32 nProxyObservers;
       mProxyObservers->Count (&nProxyObservers);

       /*
        * For all the outstanding observers that
        * have not been proxied
        */
       for (PRUint32 i = nProxyObservers; i < nObservers; i++)
       {
              nsCOMPtr<nsISupports> supports;
              rv = mObservers->GetElementAt (i, getter_AddRefs (supports));
              NS_ENSURE_SUCCESS(rv, rv);

              nsCOMPtr<nsIRDFObserver> observer (do_QueryInterface (supports, &rv));
              NS_ENSURE_SUCCESS(rv, rv);
              
              // Create the proxy
              nsCOMPtr<nsIRDFObserver> proxyObserver;
              rv = CreateProxyObserver (observer, getter_AddRefs (proxyObserver));
              NS_ENSURE_SUCCESS(rv, rv);

              mProxyObservers->AppendElement(proxyObserver);
       }

       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 403 of file nsDirectoryDataSource.cpp.

  {

Here is the call 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:

Definition at line 814 of file nsDirectoryDataSource.cpp.

{
       nsresult rv = NS_OK;
       PRUint32 itemCount;
       rv = arguments->Count(&itemCount);
       NS_ENSURE_SUCCESS(rv, rv);
       
       nsCOMPtr<nsISupportsArray> cardArray;
       NS_NewISupportsArray(getter_AddRefs(cardArray));

       //Split up deleted items into different type arrays to be passed to the folder
       //for deletion.
       PRUint32 item;
       for(item = 0; item < itemCount; item++)
       {
    nsCOMPtr<nsIAbCard> deletedCard(do_QueryElementAt(arguments, item));
              if (deletedCard)
              {
      rv = cardArray->AppendElement(deletedCard);
      NS_ENSURE_SUCCESS(rv, rv);
              }
       }
       PRUint32 cnt;
       rv = cardArray->Count(&cnt);
       NS_ENSURE_SUCCESS(rv, rv);
       if (cnt > 0)
              rv = directory->DeleteCards(cardArray);
       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 793 of file nsDirectoryDataSource.cpp.

{
       PRUint32 item, itemCount;
       nsresult rv = parentDirs->Count(&itemCount);
       NS_ENSURE_SUCCESS(rv, rv);

       for (item = 0; item < itemCount; item++) 
       {
              nsCOMPtr<nsIAbDirectory> parent = do_QueryElementAt(parentDirs, item, &rv);
              if (NS_SUCCEEDED(rv)) 
              {
                     nsCOMPtr<nsIAbDirectory> deletedDir(do_QueryElementAt(delDirs, item));
                     if(deletedDir)
                     {
                            rv = parent->DeleteDirectory(deletedDir);
                     }
              }
       }
       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbDirectoryDataSource::DoDirectoryAssert ( nsIAbDirectory directory,
nsIRDFResource property,
nsIRDFNode target 
) [protected]

Definition at line 845 of file nsDirectoryDataSource.cpp.

{
       nsresult rv = NS_ERROR_FAILURE;
       return rv;
}

Here is the caller graph for this function:

nsresult nsAbDirectoryDataSource::DoDirectoryHasAssertion ( nsIAbDirectory directory,
nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
PRBool hasAssertion 
) [protected]

Definition at line 852 of file nsDirectoryDataSource.cpp.

{
       nsresult rv = NS_OK;
       if (!hasAssertion)
              return NS_ERROR_NULL_POINTER;

       //We're not keeping track of negative assertions on directory.
       if (!tv)
       {
              *hasAssertion = PR_FALSE;
              return NS_OK;
       }

       if ((kNC_CardChild == property))
       {
              nsCOMPtr<nsIAbCard> card(do_QueryInterface(target, &rv));
              if(NS_SUCCEEDED(rv))
                     rv = directory->HasCard(card, hasAssertion);
       }
       else if ((kNC_Child == property))
       {
              nsCOMPtr<nsIAbDirectory> newDirectory(do_QueryInterface(target, &rv));
              if(NS_SUCCEEDED(rv))
                     rv = directory->HasDirectory(newDirectory, hasAssertion);
       }
       else if ((kNC_IsMailList == property) || (kNC_IsRemote == property) ||
                     (kNC_IsSecure == property) || (kNC_IsWriteable == property))
       {
              nsCOMPtr<nsIRDFResource> dirResource(do_QueryInterface(directory, &rv));
              NS_ENSURE_SUCCESS(rv, rv);
              rv = GetTargetHasAssertion(this, dirResource, property, tv, target, hasAssertion);
       }
       else 
              *hasAssertion = PR_FALSE;

       return rv;

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 467 of file nsDirectoryDataSource.cpp.

{
  PRUint32 itemCount;
  // Parent dir count should be 1.
  nsresult rv = parentDir->Count(&itemCount);
  NS_ENSURE_SUCCESS(rv, rv);
  NS_ASSERTION(itemCount == 1, "DoModifyDirectory() must have parent directory count = 1.");
  if (itemCount != 1)
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIAbDirectory> parent = do_QueryElementAt(parentDir, 0, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  // Argument count should be 2. 1st one is nsIAbDirectory and 2nd is nsIAbDirectoryProperties.
  nsCOMPtr<nsISupportsArray> resourceArray = do_QueryElementAt(arguments, 0, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  rv = resourceArray->Count(&itemCount);
  NS_ENSURE_SUCCESS(rv, rv);
  NS_ASSERTION(itemCount == 2, "DoModifyDirectory() must have resource argument count = 2.");
  if (itemCount != 2)
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIAbDirectory> modifiedDir = do_QueryElementAt(resourceArray, 0, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  nsCOMPtr<nsIAbDirectoryProperties> properties = do_QueryElementAt(resourceArray, 1, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  if (modifiedDir && properties)
    rv = parent->ModifyDirectory(modifiedDir, properties);
  return rv;
}

Here is the call graph for this function:

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:

Definition at line 357 of file nsDirectoryDataSource.cpp.

{
  nsresult rv;
  rv = NS_NewISupportsArray(arcs);
  NS_ENSURE_SUCCESS(rv, rv);
  
  (*arcs)->AppendElement(kNC_DirName);
  (*arcs)->AppendElement(kNC_Child);
  (*arcs)->AppendElement(kNC_CardChild);
  (*arcs)->AppendElement(kNC_DirUri);
  (*arcs)->AppendElement(kNC_IsMailList);
  (*arcs)->AppendElement(kNC_IsRemote);
  (*arcs)->AppendElement(kNC_IsSecure);
  (*arcs)->AppendElement(kNC_IsWriteable);
  (*arcs)->AppendElement(kNC_DirTreeNameSort);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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:

Definition at line 208 of file nsDirectoryDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;
  // we only have positive assertions in the mail data source.
  if (! tv)
    return NS_RDF_NO_VALUE;

  nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(source, &rv));
  if (NS_SUCCEEDED(rv) && directory)
    rv = createDirectoryNode(directory, property, target);
  else
    return NS_RDF_NO_VALUE;
  return rv;
}

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:

nsresult nsAbDirectoryDataSource::GetTargetHasAssertion ( nsIRDFDataSource dataSource,
nsIRDFResource dirResource,
nsIRDFResource property,
PRBool  tv,
nsIRDFNode target,
PRBool hasAssertion 
) [protected]

Definition at line 892 of file nsDirectoryDataSource.cpp.

{
       nsresult rv;
       if(!hasAssertion)
              return NS_ERROR_NULL_POINTER;

       nsCOMPtr<nsIRDFNode> currentTarget;

       rv = dataSource->GetTarget(dirResource, property,tv, getter_AddRefs(currentTarget));
       if(NS_SUCCEEDED(rv))
       {
              nsCOMPtr<nsIRDFLiteral> value1(do_QueryInterface(target));
              nsCOMPtr<nsIRDFLiteral> value2(do_QueryInterface(currentTarget));
              if(value1 && value2)
                     //If the two values are equal then it has this assertion
                     *hasAssertion = (value1 == value2);
       }
       else
              rv = NS_NOINTERFACE;

       return rv;

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 227 of file nsDirectoryDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;
  NS_ENSURE_ARG_POINTER(targets);
  
  nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(source, &rv));
  if (NS_SUCCEEDED(rv) && directory)
  {
    if ((kNC_Child == property))
    {
      return directory->GetChildNodes(targets);
    }
    else if((kNC_DirName == property) ||
      (kNC_DirUri == property) ||
      (kNC_IsMailList == property) ||
      (kNC_IsRemote == property) ||
      (kNC_IsSecure == property) ||
      (kNC_IsWriteable == property) ||
      (kNC_DirTreeNameSort == property)) 
    { 
      nsSingletonEnumerator* cursor =
        new nsSingletonEnumerator(property);
      if (cursor == nsnull)
        return NS_ERROR_OUT_OF_MEMORY;
      NS_ADDREF(cursor);
      *targets = cursor;
      return NS_OK;
    }
    else if((kNC_CardChild == property))
    { 
      nsCOMPtr<nsIEnumerator> cardChild;
      
      rv = directory->GetChildCards(getter_AddRefs(cardChild));
      if (NS_SUCCEEDED(rv) && cardChild)
      {
        nsAdapterEnumerator* cursor =
          new nsAdapterEnumerator(cardChild);
        if (cursor == nsnull)
          return NS_ERROR_OUT_OF_MEMORY;
        NS_ADDREF(cursor);
        *targets = cursor;
        return NS_OK;
      }
    }
  }
  return NS_NewEmptyEnumerator(targets);
}

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:

Definition at line 200 of file nsDirectoryDataSource.cpp.

{
  if ((*uri = nsCRT::strdup("rdf:addressdirectory")) == nsnull)
    return NS_ERROR_OUT_OF_MEMORY;
  else
    return NS_OK;
}
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.

Definition at line 308 of file nsDirectoryDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(aSource, &rv));
  if (NS_SUCCEEDED(rv)) {
    *result = (aArc == kNC_DirName ||
               aArc == kNC_Child ||
               aArc == kNC_CardChild ||
               aArc == kNC_DirUri ||
               aArc == kNC_IsMailList ||
               aArc == kNC_IsRemote ||
               aArc == kNC_IsSecure ||
               aArc == kNC_IsWriteable ||
               aArc == kNC_DirTreeNameSort);
  }
  else {
    *result = PR_FALSE;
  }
  return NS_OK;
}

Here is the call graph for this function:

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

Equivalent to enumerating ArcLabelsOut and comparing for the specified arc.

NS_IMETHODIMP nsAbDirectoryDataSource::HasAssertion ( nsIRDFResource source,
nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
PRBool hasAssertion 
)

Definition at line 292 of file nsDirectoryDataSource.cpp.

{
       nsresult rv;
       nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(source, &rv));
       if(NS_SUCCEEDED(rv))
              return DoDirectoryHasAssertion(directory, property, target, tv, hasAssertion);
       else
              *hasAssertion = PR_FALSE;
       return NS_OK;
}

Here is the call graph for this function:

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:

Definition at line 127 of file nsDirectoryDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIAddrBookSession> abSession = 
    do_GetService(NS_ADDRBOOKSESSION_CONTRACTID, &rv); 
  NS_ENSURE_SUCCESS(rv,rv);
  
  // this listener cares about all events
  rv = abSession->AddAddressBookListener(this, nsIAddrBookSession::all);
  NS_ENSURE_SUCCESS(rv,rv);

  nsCOMPtr <nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
  NS_ENSURE_SUCCESS(rv,rv);
  
  rv = rdf->RegisterDataSource(this, PR_FALSE);
  NS_ENSURE_SUCCESS(rv,rv);
 
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CHILD),
                        getter_AddRefs(kNC_Child));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DIRNAME),
                        getter_AddRefs(kNC_DirName));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CARDCHILD),
                        getter_AddRefs(kNC_CardChild));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DIRURI),
                        getter_AddRefs(kNC_DirUri));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISMAILLIST),
                        getter_AddRefs(kNC_IsMailList));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISREMOTE),
                        getter_AddRefs(kNC_IsRemote));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISSECURE),
                        getter_AddRefs(kNC_IsSecure));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISWRITEABLE),
                        getter_AddRefs(kNC_IsWriteable));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DIRTREENAMESORT), getter_AddRefs(kNC_DirTreeNameSort));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MODIFY), getter_AddRefs(kNC_Modify));  
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DELETE),
                        getter_AddRefs(kNC_Delete));  
  NS_ENSURE_SUCCESS(rv,rv);
  rv = rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DELETECARDS),
                        getter_AddRefs(kNC_DeleteCards));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = createNode(NS_LITERAL_STRING("true").get(), getter_AddRefs(kTrueLiteral));
  NS_ENSURE_SUCCESS(rv,rv);
  rv = createNode(NS_LITERAL_STRING("false").get(), getter_AddRefs(kFalseLiteral));
  NS_ENSURE_SUCCESS(rv,rv);

  nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
  NS_ENSURE_SUCCESS(rv,rv);

  // since the observer (this) supports weak ref, 
  // and we call AddObserver() with PR_TRUE for ownsWeak
  // we don't need to remove our observer from the from the observer service
  rv = observerService->AddObserver(this, "profile-do-change", PR_TRUE);
  NS_ENSURE_SUCCESS(rv,rv);
  rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);
  NS_ENSURE_SUCCESS(rv,rv);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 377 of file nsDirectoryDataSource.cpp.

  {

Here is the call 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 nsAbRDFDataSource::NotifyObservers ( nsIRDFResource subject,
nsIRDFResource property,
nsIRDFNode object,
PRBool  assert,
PRBool  change 
) [protected, inherited]

Definition at line 210 of file nsAbRDFDataSource.cpp.

{
       NS_ASSERTION(!(change && assert),
                 "Can't change and assert at the same time!\n");

       if(!mLock)
       {
              NS_ERROR("Error in AutoLock resource in nsAbRDFDataSource::NotifyObservers()");
              return NS_ERROR_OUT_OF_MEMORY;
       }

       nsresult rv;

       nsAutoLock lockGuard (mLock);

       if (!mObservers)
              return NS_OK;


       // Get the current thread
       nsCOMPtr<nsIThread> currentThread;
       rv = nsIThread::GetCurrent (getter_AddRefs(currentThread));
       NS_ENSURE_SUCCESS (rv, rv);

       // Get the main thread, which is the UI thread
       /*
        * TODO
        * Is the main thread always guaranteed to be
        * the UI thread?
        *
        * Note that this also binds the data source
        * to the UI which is supposedly the only
        * place where it is used, but what about
        * RDF datasources that are not UI specific
        * but are used in the UI?
        */
       nsCOMPtr<nsIThread> uiThread;
       rv = nsIThread::GetMainThread (getter_AddRefs(uiThread));
       NS_ENSURE_SUCCESS (rv, rv);

       nsCOMPtr<nsISupportsArray> observers;
       if (currentThread == uiThread)
       {
              /*
               * Since this is the UI Thread use the
               * observers list directly for performance
               */
              observers = mObservers;
       }
       else
       {
              /*
               * This is a different thread to the UI
               * thread need to use proxies to the
               * observers
               *
               * Create the proxies
               */
              rv = CreateProxyObservers ();
              NS_ENSURE_SUCCESS (rv, rv);

              observers = mProxyObservers;
       }

       nsAbRDFNotification note = { this, subject, property, object };
       if (change)
              observers->EnumerateForwards(changeEnumFunc, &note);
       else if (assert)
              observers->EnumerateForwards(assertEnumFunc, &note);
       else
              observers->EnumerateForwards(unassertEnumFunc, &note);

       return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbRDFDataSource::NotifyPropertyChanged ( nsIRDFResource resource,
nsIRDFResource propertyResource,
const PRUnichar oldValue,
const PRUnichar newValue 
) [protected, inherited]

Definition at line 289 of file nsAbRDFDataSource.cpp.

{
       nsCOMPtr<nsIRDFNode> newValueNode;
       createNode(newValue, getter_AddRefs(newValueNode));
       NotifyObservers(resource, propertyResource, newValueNode, PR_FALSE, PR_TRUE);
       return NS_OK;
}

Here is the call 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.
void nsIAbListener::onItemAdded ( in nsISupports  parentDir,
in nsISupports  item 
) [inherited]

Called when an address book item (book, card or list) is added.

Parameters:
parentDirThe parent of the item being added.
itemThe item being added to the database (a directory or card).
void nsIAbListener::onItemPropertyChanged ( in nsISupports  item,
in string  property,
in wstring  oldValue,
in wstring  newValue 
) [inherited]

Called when an address book item is changed.

Note the current implementation means that property is either the literal string "DirName" or null, with oldValue and newValue being specified if the property is "DirName" otherwise they are null.

Parameters:
itemThe item being updated (a directory or a card).
propertyThe property of the item being changed.
oldValueThe old value of the item property being changed if it is known, null otherwise.
newValueThe new value of the item property being changed.
void nsIAbListener::onItemRemoved ( in nsISupports  parentDir,
in nsISupports  item 
) [inherited]

Called when an address book, mailing list or card is removed.

This is partially configurable when setting up the listener via nsIAddrBookSession

Parameters:
parentDirThe parent of the item being removed, this may be an empty directory in the case of a top level address book.
itemThe item being removed from the database.

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 nsAbRDFDataSource::unassertEnumFunc ( nsISupports *  aElement,
void aData 
) [static, protected, inherited]

Definition at line 120 of file nsAbRDFDataSource.cpp.

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

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

Here is the caller graph for this function:


Member Data Documentation

Definition at line 168 of file nsDirectoryDataSource.h.

Definition at line 152 of file nsDirectoryDataSource.h.

Definition at line 150 of file nsDirectoryDataSource.h.

Definition at line 163 of file nsDirectoryDataSource.h.

Definition at line 164 of file nsDirectoryDataSource.h.

Definition at line 151 of file nsDirectoryDataSource.h.

Definition at line 158 of file nsDirectoryDataSource.h.

Definition at line 153 of file nsDirectoryDataSource.h.

Definition at line 154 of file nsDirectoryDataSource.h.

Definition at line 155 of file nsDirectoryDataSource.h.

Definition at line 156 of file nsDirectoryDataSource.h.

Definition at line 157 of file nsDirectoryDataSource.h.

Definition at line 162 of file nsDirectoryDataSource.h.

Definition at line 167 of file nsDirectoryDataSource.h.

Definition at line 159 of file nsDirectoryDataSource.h.

Definition at line 60 of file nsDirectoryDataSource.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.


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