Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Events
nsMsgUnreadFoldersDataSource Class Reference

#include <nsMsgFolderDataSource.h>

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

List of all members.

Public Member Functions

 nsMsgUnreadFoldersDataSource ()
virtual ~nsMsgUnreadFoldersDataSource ()
virtual nsresult NotifyPropertyChanged (nsIRDFResource *resource, nsIRDFResource *propertyResource, nsIRDFNode *newNode, nsIRDFNode *oldNode=nsnull)
virtual nsresult Init ()
virtual void Cleanup ()
NS_IMETHOD GetURI (char **uri)
NS_IMETHOD GetTargets (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsISimpleEnumerator **targets)
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.
NS_IMETHOD GetTarget (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsIRDFNode **target)
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.
NS_IMETHOD HasAssertion (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv, PRBool *hasAssertion)
boolean HasAssertion (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Query whether an assertion exists in this graph.
NS_IMETHOD GetSource (nsIRDFResource *property, nsIRDFNode *target, PRBool tv, nsIRDFResource **source)
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.
NS_IMETHOD GetSources (nsIRDFResource *property, nsIRDFNode *target, PRBool tv, nsISimpleEnumerator **sources)
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.
NS_IMETHOD Assert (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv)
void Assert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Add an assertion to the graph.
NS_IMETHOD Unassert (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target)
void Unassert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 Remove an assertion from the graph.
NS_IMETHOD HasArcOut (nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *result)
NS_IMETHOD ArcLabelsIn (nsIRDFNode *node, nsISimpleEnumerator **labels)
nsISimpleEnumerator ArcLabelsIn (in nsIRDFNode aNode)
 Get a cursor to iterate over all the arcs that point into a node.
NS_IMETHOD ArcLabelsOut (nsIRDFResource *source, nsISimpleEnumerator **labels)
nsISimpleEnumerator ArcLabelsOut (in nsIRDFResource aSource)
 Get a cursor to iterate over all the arcs that originate in a resource.
NS_IMETHOD GetAllResources (nsISimpleEnumerator **aResult)
nsISimpleEnumerator GetAllResources ()
 Retrieve all of the resources that the data source currently refers to.
NS_IMETHOD GetAllCmds (nsIRDFResource *source, nsISimpleEnumerator **commands)
nsISimpleEnumerator GetAllCmds (in nsIRDFResource aSource)
 Returns the set of all commands defined for a given source.
NS_IMETHOD IsCommandEnabled (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, PRBool *aResult)
boolean IsCommandEnabled (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Returns whether a given command is enabled for a set of sources.
NS_IMETHOD DoCommand (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
void DoCommand (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Perform the specified command on set of sources.
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
void AddObserver (in nsIRDFObserver aObserver)
 Add an observer to this data source.
void RemoveObserver (in nsIRDFObserver aObserver)
 Remove an observer from this data 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|.
void OnItemAdded (in nsIRDFResource parentItem, in nsISupports item)
void OnItemRemoved (in nsIRDFResource parentItem, in nsISupports item)
void OnItemPropertyChanged (in nsIRDFResource item, in nsIAtom property, in string oldValue, in string newValue)
void OnItemIntPropertyChanged (in nsIRDFResource item, in nsIAtom property, in long oldValue, in long newValue)
void OnItemBoolPropertyChanged (in nsIRDFResource item, in nsIAtom property, in boolean oldValue, in boolean newValue)
void OnItemUnicharPropertyChanged (in nsIRDFResource item, in nsIAtom property, in wstring oldValue, in wstring newValue)
void OnItemPropertyFlagChanged (in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldFlag, in unsigned long newFlag)
void OnItemEvent (in nsIMsgFolder item, in nsIAtom event)

Public Attributes

readonly attribute string URI
 The "URI" of the data source.
attribute nsIMsgWindow window
const folderListenerNotifyFlagValue added = 0x1
const folderListenerNotifyFlagValue removed = 0x2
const folderListenerNotifyFlagValue propertyChanged = 0x4
const folderListenerNotifyFlagValue intPropertyChanged = 0x8
const folderListenerNotifyFlagValue boolPropertyChanged = 0x10
const folderListenerNotifyFlagValue unicharPropertyChanged = 0x20
const folderListenerNotifyFlagValue propertyFlagChanged = 0x40

Protected Member Functions

virtual PRBool WantsThisFolder (nsIMsgFolder *folder)
virtual nsresult GetFolderDisplayName (nsIMsgFolder *folder, PRUnichar **folderName)
PRBool ResourceIsOurRoot (nsIRDFResource *resource)
virtual nsresult OnItemAddedOrRemoved (nsIRDFResource *parentItem, nsISupports *item, PRBool added)
nsresult GetSenderName (nsAutoString &sender, nsAutoString *senderUserName)
nsresult createFolderNode (nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode **target)
nsresult createFolderNameNode (nsIMsgFolder *folder, nsIRDFNode **target, PRBool sort)
nsresult createFolderOpenNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderTreeNameNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderTreeSimpleNameNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderSpecialNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderServerTypeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createServerIsDeferredNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderRedirectorTypeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanCreateFoldersOnServerNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanFileMessagesOnServerNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderIsServerNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderIsSecureNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanSubscribeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderSupportsOfflineNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanFileMessagesNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanCreateSubfoldersNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanRenameNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderCanCompactNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createTotalMessagesNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createUnreadMessagesNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderSizeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createCharsetNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createBiffStateNodeFromFolder (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createBiffStateNodeFromFlag (PRUint32 flag, nsIRDFNode **target)
nsresult createHasUnreadMessagesNode (nsIMsgFolder *folder, PRBool aIncludeSubfolders, nsIRDFNode **target)
nsresult createNewMessagesNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderNoSelectNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderVirtualNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createInVFEditSearchScopeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderImapSharedNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderSynchronizeNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderSyncDisabledNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createCanSearchMessages (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult createFolderChildNode (nsIMsgFolder *folder, nsIRDFNode **target)
nsresult getFolderArcLabelsOut (nsISupportsArray **arcs)
nsresult DoDeleteFromFolder (nsIMsgFolder *folder, nsISupportsArray *arguments, nsIMsgWindow *msgWindow, PRBool reallyDelete)
nsresult DoCopyToFolder (nsIMsgFolder *dstFolder, nsISupportsArray *arguments, nsIMsgWindow *msgWindow, PRBool isMove)
nsresult DoFolderCopyToFolder (nsIMsgFolder *dstFolder, nsISupportsArray *arguments, nsIMsgWindow *msgWindow, PRBool isMoveFolder)
nsresult DoNewFolder (nsIMsgFolder *folder, nsISupportsArray *arguments, nsIMsgWindow *window)
nsresult DoFolderAssert (nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target)
nsresult DoFolderUnassert (nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target)
nsresult DoFolderHasAssertion (nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target, PRBool tv, PRBool *hasAssertion)
nsresult GetBiffStateString (PRUint32 biffState, nsCAutoString &biffStateStr)
nsresult CreateUnreadMessagesNameString (PRInt32 unreadMessages, nsAutoString &nameString)
nsresult CreateArcsOutEnumerator ()
nsresult OnUnreadMessagePropertyChanged (nsIRDFResource *folderResource, PRInt32 oldValue, PRInt32 newValue)
nsresult OnTotalMessagePropertyChanged (nsIRDFResource *folderResource, PRInt32 oldValue, PRInt32 newValue)
nsresult OnFolderSizePropertyChanged (nsIRDFResource *folderResource, PRInt32 oldValue, PRInt32 newValue)
 nsresult nsMsgFolderDataSource::OnUnreadMessagePropertyChanged(nsIMsgFolder *folder, PRInt32 oldValue, PRInt32 newValue) { nsCOMPtr<nsIRDFResource> folderResource = do_QueryInterface(folder); if(folderResource) { First send a regular unread message changed notification nsCOMPtr<nsIRDFNode> newNode;
nsresult NotifyFolderTreeNameChanged (nsIMsgFolder *folder, nsIRDFResource *folderResource, PRInt32 aUnreadMessages)
nsresult NotifyFolderTreeSimpleNameChanged (nsIMsgFolder *folder, nsIRDFResource *folderResource)
nsresult NotifyFolderNameChanged (nsIMsgFolder *folder, nsIRDFResource *folderResource)
nsresult NotifyAncestors (nsIMsgFolder *aFolder, nsIRDFResource *aPropertyResource, nsIRDFNode *aNode)
nsresult GetNumMessagesNode (PRInt32 numMessages, nsIRDFNode **node)
nsresult GetFolderSizeNode (PRInt32 folderSize, nsIRDFNode **node)
nsresult CreateLiterals (nsIRDFService *rdf)
nsIRDFServicegetRDFService ()
nsresult NotifyObservers (nsIRDFResource *subject, nsIRDFResource *property, nsIRDFNode *newObject, nsIRDFNode *oldObject, PRBool assert, PRBool change)
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

nsCOMArray< nsIMsgFolderm_folders
nsCOMPtr< nsIRDFResourcem_rootResource
nsCString m_dsName
nsCOMPtr< nsIRDFNodekTrueLiteral
nsCOMPtr< nsIRDFNodekFalseLiteral
nsCOMPtr< nsISupportsArraykFolderArcsOutArray
nsCOMPtr< nsIMsgWindowmWindow
PRBool m_shuttingDown
PRBool mInitialized

Static Protected Attributes

static nsIRDFResourcekNC_Child = nsnull
static nsIRDFResourcekNC_Folder = nsnull
static nsIRDFResourcekNC_Name = nsnull
static nsIRDFResourcekNC_Open = nsnull
static nsIRDFResourcekNC_FolderTreeName = nsnull
static nsIRDFResourcekNC_FolderTreeSimpleName = nsnull
static nsIRDFResourcekNC_NameSort = nsnull
static nsIRDFResourcekNC_FolderTreeNameSort = nsnull
static nsIRDFResourcekNC_Columns
static nsIRDFResourcekNC_MSGFolderRoot
static nsIRDFResourcekNC_SpecialFolder = nsnull
static nsIRDFResourcekNC_ServerType = nsnull
static nsIRDFResourcekNC_IsDeferred = nsnull
static nsIRDFResourcekNC_RedirectorType = nsnull
static nsIRDFResourcekNC_CanCreateFoldersOnServer = nsnull
static nsIRDFResourcekNC_CanFileMessagesOnServer = nsnull
static nsIRDFResourcekNC_IsServer = nsnull
static nsIRDFResourcekNC_IsSecure = nsnull
static nsIRDFResourcekNC_CanSubscribe = nsnull
static nsIRDFResourcekNC_SupportsOffline = nsnull
static nsIRDFResourcekNC_CanFileMessages = nsnull
static nsIRDFResourcekNC_CanCreateSubfolders = nsnull
static nsIRDFResourcekNC_CanRename = nsnull
static nsIRDFResourcekNC_CanCompact = nsnull
static nsIRDFResourcekNC_TotalMessages = nsnull
static nsIRDFResourcekNC_TotalUnreadMessages = nsnull
static nsIRDFResourcekNC_FolderSize = nsnull
static nsIRDFResourcekNC_Charset = nsnull
static nsIRDFResourcekNC_BiffState = nsnull
static nsIRDFResourcekNC_HasUnreadMessages = nsnull
static nsIRDFResourcekNC_NewMessages = nsnull
static nsIRDFResourcekNC_SubfoldersHaveUnreadMessages = nsnull
static nsIRDFResourcekNC_NoSelect = nsnull
static nsIRDFResourcekNC_ImapShared = nsnull
static nsIRDFResourcekNC_Synchronize = nsnull
static nsIRDFResourcekNC_SyncDisabled = nsnull
static nsIRDFResourcekNC_CanSearchMessages = nsnull
static nsIRDFResourcekNC_VirtualFolder = nsnull
static nsIRDFResourcekNC_InVFEditSearchScope = nsnull
static nsIRDFResourcekNC_UnreadFolders = nsnull
static nsIRDFResourcekNC_FavoriteFolders = nsnull
static nsIRDFResourcekNC_RecentFolders = nsnull
static nsIRDFResourcekNC_Delete = nsnull
static nsIRDFResourcekNC_ReallyDelete = nsnull
static nsIRDFResourcekNC_NewFolder = nsnull
static nsIRDFResourcekNC_GetNewMessages = nsnull
static nsIRDFResourcekNC_Copy = nsnull
static nsIRDFResourcekNC_Move = nsnull
static nsIRDFResourcekNC_CopyFolder = nsnull
static nsIRDFResourcekNC_MoveFolder = nsnull
static nsIRDFResourcekNC_MarkAllMessagesRead = nsnull
static nsIRDFResourcekNC_Compact = nsnull
static nsIRDFResourcekNC_CompactAll = nsnull
static nsIRDFResourcekNC_Rename = nsnull
static nsIRDFResourcekNC_EmptyTrash = nsnull
static nsIRDFResourcekNC_DownloadFlagged = nsnull
static nsIAtomkTotalMessagesAtom = nsnull
static nsIAtomkTotalUnreadMessagesAtom = nsnull
static nsIAtomkFolderSizeAtom = nsnull
static nsIAtomkBiffStateAtom = nsnull
static nsIAtomkNewMessagesAtom = nsnull
static nsIAtomkNameAtom = nsnull
static nsIAtomkSynchronizeAtom = nsnull
static nsIAtomkOpenAtom = nsnull
static nsIAtomkIsDeferredAtom = nsnull
static nsrefcnt gFolderResourceRefCnt = 0
static nsIAtomkCanFileMessagesAtom = nsnull
static nsIAtomkInVFEditSearchScopeAtom = nsnull
static PRUnicharkKiloByteString = nsnull
static PRUnicharkMegaByteString = nsnull

Events

const
folderListenerNotifyFlagValue=0 
x80
const folderListenerNotifyFlagValue all = 0xFFFFFFFF

Detailed Description

Definition at line 339 of file nsMsgFolderDataSource.h.


Constructor & Destructor Documentation

Definition at line 342 of file nsMsgFolderDataSource.h.

{m_dsName = "mailnewsunreadfolders";}

Definition at line 343 of file nsMsgFolderDataSource.h.

{}

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:

Definition at line 651 of file nsMsgFolderDataSource.cpp.

{
  return nsMsgRDFDataSource::ArcLabelsIn(node, labels);
}

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 657 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;
  nsCOMPtr<nsISupportsArray> arcsArray;
  
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  if (NS_SUCCEEDED(rv)) 
  {
    arcsArray = kFolderArcsOutArray;
    rv = NS_NewArrayEnumerator(labels, arcsArray);
  }
  else 
  {
    rv = NS_NewEmptyEnumerator(labels);
  }
  
  return rv;
}

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:

NS_IMETHODIMP nsMsgFolderDataSource::Assert ( nsIRDFResource source,
nsIRDFResource property,
nsIRDFNode target,
PRBool  tv 
) [inherited]

Definition at line 555 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  //We don't handle tv = PR_FALSE at the moment.
  if(NS_SUCCEEDED(rv) && tv)
    return DoFolderAssert(folder, property, target);
  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 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 nsMsgFlatFolderDataSource::Cleanup ( ) [virtual, inherited]

Reimplemented from nsMsgFolderDataSource.

Reimplemented in nsMsgRecentFoldersDataSource.

Definition at line 2291 of file nsMsgFolderDataSource.cpp.

Here is the call graph for this function:

Definition at line 377 of file nsMsgFolderDataSource.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createBiffStateNodeFromFlag ( PRUint32  flag,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1661 of file nsMsgFolderDataSource.cpp.

{
  const PRUnichar *biffStateStr;

  switch (flag) {
    case nsIMsgFolder::nsMsgBiffState_NewMail:
      biffStateStr = NS_LITERAL_STRING("NewMail").get();
      break;
    case nsIMsgFolder::nsMsgBiffState_NoMail:
      biffStateStr = NS_LITERAL_STRING("NoMail").get();
      break;
    default:
      biffStateStr = NS_LITERAL_STRING("UnknownMail").get();
      break;
  }

  createNode(biffStateStr, target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createBiffStateNodeFromFolder ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1648 of file nsMsgFolderDataSource.cpp.

{
  PRUint32 biffState;
  nsresult rv = folder->GetBiffState(&biffState);
  if(NS_FAILED(rv)) return rv;

  rv = createBiffStateNodeFromFlag(biffState, target);
  NS_ENSURE_SUCCESS(rv,rv);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createCanSearchMessages ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1436 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;

  PRBool canSearchMessages;
  rv = server->GetCanSearchMessages(&canSearchMessages);
  if (NS_FAILED(rv)) return rv;
  
  *target = (canSearchMessages) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createCharsetNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1636 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLCString charset;
  nsresult rv = folder->GetCharset(getter_Copies(charset));
  if (NS_SUCCEEDED(rv))
    createNode(NS_ConvertASCIItoUCS2(charset).get(), target, getRDFService());
  else
    createNode(EmptyString().get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderCanCompactNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1578 of file nsMsgFolderDataSource.cpp.

{
  PRBool canCompact;
  nsresult rv = folder->GetCanCompact(&canCompact);
  if (NS_FAILED(rv)) return rv;

  *target = (canCompact) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 1273 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;
  
  PRBool canCreateFoldersOnServer;
  rv = server->GetCanCreateFoldersOnServer(&canCreateFoldersOnServer);
  if (NS_FAILED(rv)) return rv;

  if (canCreateFoldersOnServer)
    *target = kTrueLiteral;
  else
    *target = kFalseLiteral;
  NS_IF_ADDREF(*target);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1551 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool canCreateSubfolders;
  rv = folder->GetCanCreateSubfolders(&canCreateSubfolders);
  if (NS_FAILED(rv)) return rv;

  *target = (canCreateSubfolders) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderCanFileMessagesNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1537 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool canFileMessages;
  rv = folder->GetCanFileMessages(&canFileMessages);
  if (NS_FAILED(rv)) return rv;

  *target = (canFileMessages) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 1296 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;

  PRBool canFileMessagesOnServer;
  rv = server->GetCanFileMessagesOnServer(&canFileMessagesOnServer);
  if (NS_FAILED(rv)) return rv;
  
  *target = (canFileMessagesOnServer) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderCanRenameNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1565 of file nsMsgFolderDataSource.cpp.

{
  PRBool canRename;
  nsresult rv = folder->GetCanRename(&canRename);
  if (NS_FAILED(rv)) return rv;

  *target = (canRename) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderCanSubscribeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1509 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool canSubscribe;
  rv = folder->GetCanSubscribe(&canSubscribe);
  if (NS_FAILED(rv)) return rv;

  *target = (canSubscribe) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderChildNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1972 of file nsMsgFolderDataSource.cpp.

{
  nsCOMPtr<nsIEnumerator> subFolders;
  nsresult rv = folder->GetSubFolders(getter_AddRefs(subFolders));
  if (NS_FAILED(rv))
    return NS_RDF_NO_VALUE;
  
  rv = subFolders->First();
  if (NS_SUCCEEDED(rv)) 
  {
    nsCOMPtr<nsISupports> firstFolder;
    rv = subFolders->CurrentItem(getter_AddRefs(firstFolder));
    if (NS_SUCCEEDED(rv)) 
      firstFolder->QueryInterface(NS_GET_IID(nsIRDFResource), (void**)target);
  }
  return NS_FAILED(rv) ? NS_RDF_NO_VALUE : rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderImapSharedNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1375 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool imapShared; 
  rv = folder->GetImapShared(&imapShared);
  if (NS_FAILED(rv)) return rv;

  *target = (imapShared) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderIsSecureNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1479 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool isSecure = PR_FALSE;

  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));

  if (NS_SUCCEEDED(rv) && server) {
    nsCOMPtr<nsINntpIncomingServer> nntpIncomingServer = do_QueryInterface(server);

    if(nntpIncomingServer)  
      rv = server->GetIsSecure(&isSecure);
    else {
      PRInt32 socketType;
      rv = server->GetSocketType(&socketType);
      if (NS_SUCCEEDED(rv) && (socketType == nsIMsgIncomingServer::alwaysUseTLS || 
                              socketType == nsIMsgIncomingServer::useSSL))
        isSecure = PR_TRUE;
    }
  }

  *target = (isSecure) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderIsServerNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1317 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool isServer;
  rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;

  *target = nsnull;

  if (isServer)
    *target = kTrueLiteral;
  else
    *target = kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderNameNode ( nsIMsgFolder folder,
nsIRDFNode **  target,
PRBool  sort 
) [protected, inherited]

Definition at line 1111 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  if (sort) 
  {
    PRUint8 *sortKey=nsnull;
    PRUint32 sortKeyLength;
    rv = folder->GetSortKey(&sortKey, &sortKeyLength);
    NS_ENSURE_SUCCESS(rv, rv);
    createBlobNode(sortKey, sortKeyLength, target, getRDFService());
    PR_Free(sortKey);
  }
  else 
  {
    nsXPIDLString name;
    rv = folder->GetName(getter_Copies(name));
    if (NS_FAILED(rv)) 
      return rv;
    createNode(name.get(), target, getRDFService());
  }
    
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderNode ( nsIMsgFolder folder,
nsIRDFResource property,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1025 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;

  if (kNC_NameSort == property)
    rv = createFolderNameNode(folder, target, PR_TRUE);
  else if(kNC_FolderTreeNameSort == property)
    rv = createFolderNameNode(folder, target, PR_TRUE);
  else if (kNC_Name == property)
    rv = createFolderNameNode(folder, target, PR_FALSE);
  else if(kNC_Open == property)
    rv = createFolderOpenNode(folder, target);
  else if (kNC_FolderTreeName == property)
    rv = createFolderTreeNameNode(folder, target);
  else if (kNC_FolderTreeSimpleName == property)
    rv = createFolderTreeSimpleNameNode(folder, target);
  else if ((kNC_SpecialFolder == property))
    rv = createFolderSpecialNode(folder,target);
  else if ((kNC_ServerType == property))
    rv = createFolderServerTypeNode(folder, target);
  else if ((kNC_IsDeferred == property))
    rv = createServerIsDeferredNode(folder, target);
  else if ((kNC_RedirectorType == property))
    rv = createFolderRedirectorTypeNode(folder, target);
  else if ((kNC_CanCreateFoldersOnServer == property))
    rv = createFolderCanCreateFoldersOnServerNode(folder, target);
  else if ((kNC_CanFileMessagesOnServer == property))
    rv = createFolderCanFileMessagesOnServerNode(folder, target);
  else if ((kNC_IsServer == property))
    rv = createFolderIsServerNode(folder, target);
  else if ((kNC_IsSecure == property))
    rv = createFolderIsSecureNode(folder, target);
  else if ((kNC_CanSubscribe == property))
    rv = createFolderCanSubscribeNode(folder, target);
  else if ((kNC_SupportsOffline == property))
    rv = createFolderSupportsOfflineNode(folder, target);
  else if ((kNC_CanFileMessages == property))
    rv = createFolderCanFileMessagesNode(folder, target);
  else if ((kNC_CanCreateSubfolders == property))
    rv = createFolderCanCreateSubfoldersNode(folder, target);
  else if ((kNC_CanRename == property))
    rv = createFolderCanRenameNode(folder, target);
  else if ((kNC_CanCompact == property))
    rv = createFolderCanCompactNode(folder, target);
  else if ((kNC_TotalMessages == property))
    rv = createTotalMessagesNode(folder, target);
  else if ((kNC_TotalUnreadMessages == property))
    rv = createUnreadMessagesNode(folder, target);
  else if ((kNC_FolderSize == property))
    rv = createFolderSizeNode(folder, target);
  else if ((kNC_Charset == property))
    rv = createCharsetNode(folder, target);
  else if ((kNC_BiffState == property))
    rv = createBiffStateNodeFromFolder(folder, target);
  else if ((kNC_HasUnreadMessages == property))
    rv = createHasUnreadMessagesNode(folder, PR_FALSE, target);
  else if ((kNC_NewMessages == property))
    rv = createNewMessagesNode(folder, target);
  else if ((kNC_SubfoldersHaveUnreadMessages == property))
    rv = createHasUnreadMessagesNode(folder, PR_TRUE, target);
  else if ((kNC_Child == property))
    rv = createFolderChildNode(folder, target);
  else if ((kNC_NoSelect == property))
    rv = createFolderNoSelectNode(folder, target);
  else if ((kNC_VirtualFolder == property))
    rv = createFolderVirtualNode(folder, target);
  else if (kNC_InVFEditSearchScope == property)
    rv = createInVFEditSearchScopeNode(folder, target);
  else if ((kNC_ImapShared == property))
    rv = createFolderImapSharedNode(folder, target);
  else if ((kNC_Synchronize == property))
    rv = createFolderSynchronizeNode(folder, target);
  else if ((kNC_SyncDisabled == property))
    rv = createFolderSyncDisabledNode(folder, target);
  else if ((kNC_CanSearchMessages == property))
    rv = createCanSearchMessages(folder, target);


  if (NS_FAILED(rv)) return NS_RDF_NO_VALUE;
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderNoSelectNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1336 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool noSelect;
  rv = folder->GetNoSelect(&noSelect);
  if (NS_FAILED(rv)) return rv;

  *target = (noSelect) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderOpenNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1456 of file nsMsgFolderDataSource.cpp.

{
  NS_ENSURE_ARG_POINTER(target);

  // call GetSubFolders() to ensure mFlags is set correctly 
  // from the folder cache on startup
  nsCOMPtr<nsIEnumerator> subFolders;
  nsresult rv = folder->GetSubFolders(getter_AddRefs(subFolders));
  if (NS_FAILED(rv))
    return NS_RDF_NO_VALUE;

  PRBool closed;
  rv = folder->GetFlag(MSG_FOLDER_FLAG_ELIDED, &closed);              
  if (NS_FAILED(rv)) 
    return rv;

  *target = (closed) ? kFalseLiteral : kTrueLiteral;

  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderRedirectorTypeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1256 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;

  nsXPIDLCString redirectorType;
  rv = server->GetRedirectorType(getter_Copies(redirectorType));
  if (NS_FAILED(rv)) return rv;

  createNode(NS_ConvertASCIItoUCS2(redirectorType).get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderServerTypeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1217 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;

  nsXPIDLCString serverType;
  rv = server->GetType(getter_Copies(serverType));
  if (NS_FAILED(rv)) return rv;

  createNode(NS_ConvertASCIItoUCS2(serverType).get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderSizeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1614 of file nsMsgFolderDataSource.cpp.

{
  PRBool isServer;
  nsresult rv = folder->GetIsServer(&isServer);
  NS_ENSURE_SUCCESS(rv, rv);
  
  PRInt32 folderSize;
  if(isServer)
    folderSize = kDisplayBlankCount;
  else
  {
    // XXX todo, we are asserting here for news
    // for offline news, we'd know the size on disk, right?
    rv = folder->GetSizeOnDisk((PRUint32 *) &folderSize);
    NS_ENSURE_SUCCESS(rv, rv);
  }
  GetFolderSizeNode(folderSize, target);
  
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderSpecialNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1182 of file nsMsgFolderDataSource.cpp.

{
  PRUint32 flags;
  nsresult rv = folder->GetFlags(&flags);
  if(NS_FAILED(rv)) 
    return rv;
  
  nsAutoString specialFolderString;
  if (flags & MSG_FOLDER_FLAG_INBOX)
    specialFolderString.AssignLiteral("Inbox");
  else if (flags & MSG_FOLDER_FLAG_TRASH)
    specialFolderString.AssignLiteral("Trash");
  else if (flags & MSG_FOLDER_FLAG_QUEUE)
    specialFolderString.AssignLiteral("Unsent Messages");
  else if (flags & MSG_FOLDER_FLAG_SENTMAIL)
    specialFolderString.AssignLiteral("Sent");
  else if (flags & MSG_FOLDER_FLAG_DRAFTS)
    specialFolderString.AssignLiteral("Drafts");
  else if (flags & MSG_FOLDER_FLAG_TEMPLATES)
    specialFolderString.AssignLiteral("Templates");
  else if (flags & MSG_FOLDER_FLAG_JUNK)
    specialFolderString.AssignLiteral("Junk");
  else if (flags & MSG_FOLDER_FLAG_VIRTUAL)
    specialFolderString.AssignLiteral("Virtual");
  else {
    // XXX why do this at all? or just ""
    specialFolderString.AssignLiteral("none");
  }
  
  createNode(specialFolderString.get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderSupportsOfflineNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1523 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool supportsOffline;
  rv = folder->GetSupportsOffline(&supportsOffline);
  NS_ENSURE_SUCCESS(rv,rv);
 
  *target = (supportsOffline) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderSyncDisabledNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1406 of file nsMsgFolderDataSource.cpp.

{
  
  nsresult rv;
  PRBool isServer;
  nsCOMPtr<nsIMsgIncomingServer> server;

  rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;
    
  rv = folder->GetServer(getter_AddRefs(server));
  if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;

  nsXPIDLCString serverType;
  rv = server->GetType(getter_Copies(serverType));
  if (NS_FAILED(rv)) return rv;

  *target = nsnull;

  if (nsCRT::strcasecmp(serverType, "none")==0 || nsCRT::strcasecmp(serverType, "pop3")==0
      || isServer)
    *target = kTrueLiteral;
  else
    *target = kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderSynchronizeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1390 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRBool sync;
  rv = folder->GetFlag(MSG_FOLDER_FLAG_OFFLINE, &sync);        
  if (NS_FAILED(rv)) return rv;

  *target = nsnull;

  *target = (sync) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderTreeNameNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1142 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString name;
  nsresult rv = GetFolderDisplayName(folder, getter_Copies(name));
  if (NS_FAILED(rv)) return rv;
  nsAutoString nameString(name);
  PRInt32 unreadMessages;

  rv = folder->GetNumUnread(PR_FALSE, &unreadMessages);
  if(NS_SUCCEEDED(rv)) 
    CreateUnreadMessagesNameString(unreadMessages, nameString);       

  createNode(nameString.get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderTreeSimpleNameNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1159 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString name;
  nsresult rv = GetFolderDisplayName(folder, getter_Copies(name));
  if (NS_FAILED(rv)) return rv;

  createNode(name.get(), target, getRDFService());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createFolderVirtualNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1362 of file nsMsgFolderDataSource.cpp.

{
  PRUint32 folderFlags;
  folder->GetFlags(&folderFlags);

  *target = (folderFlags & MSG_FOLDER_FLAG_VIRTUAL) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createHasUnreadMessagesNode ( nsIMsgFolder folder,
PRBool  aIncludeSubfolders,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1703 of file nsMsgFolderDataSource.cpp.

{
  PRBool isServer;
  nsresult rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;

  *target = kFalseLiteral;

  PRInt32 totalUnreadMessages;
  if(!isServer)
  {
    rv = folder->GetNumUnread(aIncludeSubfolders, &totalUnreadMessages);
    if(NS_FAILED(rv)) return rv;
    // if we're including sub-folders, we're trying to find out if child folders
    // have unread. If so, we subtract the unread msgs in the current folder.
    if (aIncludeSubfolders)
    {
      PRInt32 numUnreadInFolder;
      rv = folder->GetNumUnread(PR_FALSE, &numUnreadInFolder);
      NS_ENSURE_SUCCESS(rv, rv);
      // don't subtract if numUnread is negative (which means we don't know the unread count)
      if (numUnreadInFolder > 0) 
        totalUnreadMessages -= numUnreadInFolder;
    }
    *target = (totalUnreadMessages > 0) ? kTrueLiteral : kFalseLiteral;
  }

  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createInVFEditSearchScopeNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1350 of file nsMsgFolderDataSource.cpp.

{
  PRBool inVFEditSearchScope = PR_FALSE;
  folder->GetInVFEditSearchScope(&inVFEditSearchScope);

  *target = inVFEditSearchScope ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 330 of file nsMsgFolderDataSource.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createNewMessagesNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1857 of file nsMsgFolderDataSource.cpp.

{
  
  nsresult rv;
  
  PRBool isServer;
  rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;
  
  *target = kFalseLiteral;
  
  //PRInt32 totalNewMessages;
  PRBool isNewMessages;
  if(!isServer)
  {
    rv = folder->GetHasNewMessages(&isNewMessages);
    if(NS_FAILED(rv)) return rv;
    *target = (isNewMessages) ? kTrueLiteral : kFalseLiteral;
  }
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createServerIsDeferredNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1234 of file nsMsgFolderDataSource.cpp.

{
  PRBool isDeferred = PR_FALSE;
  nsCOMPtr <nsIMsgIncomingServer> incomingServer;
  folder->GetServer(getter_AddRefs(incomingServer));
  if (incomingServer)
  {
    nsCOMPtr <nsIPop3IncomingServer> pop3Server = do_QueryInterface(incomingServer);
    if (pop3Server)
    {
      nsXPIDLCString deferredToServer;
      pop3Server->GetDeferredToAccount(getter_Copies(deferredToServer));
      isDeferred = !deferredToServer.IsEmpty();
    }
  }
  *target = (isDeferred) ? kTrueLiteral : kFalseLiteral;
  NS_IF_ADDREF(*target);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createTotalMessagesNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1592 of file nsMsgFolderDataSource.cpp.

{

  PRBool isServer;
  nsresult rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;
  
  PRInt32 totalMessages;
  if(isServer)
    totalMessages = kDisplayBlankCount;
  else
  {
    rv = folder->GetTotalMessages(PR_FALSE, &totalMessages);
    if(NS_FAILED(rv)) return rv;
  }
  GetNumMessagesNode(totalMessages, target);
  
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::CreateUnreadMessagesNameString ( PRInt32  unreadMessages,
nsAutoString nameString 
) [protected, inherited]

Definition at line 1169 of file nsMsgFolderDataSource.cpp.

{
  //Only do this if unread messages are positive
  if(unreadMessages > 0)
  {
    nameString.Append(NS_LITERAL_STRING(" (").get());
    nameString.AppendInt(unreadMessages);
    nameString.Append(NS_LITERAL_STRING(")").get());
  }
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::createUnreadMessagesNode ( nsIMsgFolder folder,
nsIRDFNode **  target 
) [protected, inherited]

Definition at line 1682 of file nsMsgFolderDataSource.cpp.

{
  PRBool isServer;
  nsresult rv = folder->GetIsServer(&isServer);
  if (NS_FAILED(rv)) return rv;
  
  PRInt32 totalUnreadMessages;
  if(isServer)
    totalUnreadMessages = kDisplayBlankCount;
  else
  {
    rv = folder->GetNumUnread(PR_FALSE, &totalUnreadMessages);
    if(NS_FAILED(rv)) return rv;
  }
  GetNumMessagesNode(totalUnreadMessages, target);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgFolderDataSource::DoCommand ( nsISupportsArray aSources,
nsIRDFResource aCommand,
nsISupportsArray aArguments 
) [inherited]

Definition at line 802 of file nsMsgFolderDataSource.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:

nsresult nsMsgFolderDataSource::DoCopyToFolder ( nsIMsgFolder dstFolder,
nsISupportsArray arguments,
nsIMsgWindow msgWindow,
PRBool  isMove 
) [protected, inherited]

Definition at line 1992 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRUint32 itemCount;
  rv = arguments->Count(&itemCount);
  if (NS_FAILED(rv)) return rv;
  
  //need source folder and at least one item to copy
  if(itemCount < 2)
    return NS_ERROR_FAILURE;
  
  
  nsCOMPtr<nsIMsgFolder> srcFolder(do_QueryElementAt(arguments, 0));
  if(!srcFolder)
    return NS_ERROR_FAILURE;
  
  arguments->RemoveElementAt(0);
  itemCount--;
  
  nsCOMPtr<nsISupportsArray> messageArray;
  NS_NewISupportsArray(getter_AddRefs(messageArray));
  
  for(PRUint32 i = 0; i < itemCount; i++)
  {
    
    nsCOMPtr<nsISupports> supports = getter_AddRefs(arguments->ElementAt(i));
    nsCOMPtr<nsIMsgDBHdr> message(do_QueryInterface(supports));
    if (message)
    {
      messageArray->AppendElement(supports);
    }
    
  }
  
  //Call copyservice with dstFolder, srcFolder, messages, isMove, and txnManager
  nsCOMPtr<nsIMsgCopyService> copyService = 
    do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv,rv);
  
  return copyService->CopyMessages(srcFolder, messageArray, dstFolder, isMove, 
    nsnull, msgWindow, PR_TRUE/* allowUndo */);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::DoDeleteFromFolder ( nsIMsgFolder folder,
nsISupportsArray arguments,
nsIMsgWindow msgWindow,
PRBool  reallyDelete 
) [protected, inherited]

Definition at line 2078 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_OK;
  PRUint32 itemCount;
  rv = arguments->Count(&itemCount);
  if (NS_FAILED(rv)) return rv;
  
  nsCOMPtr<nsISupportsArray> messageArray, folderArray;
  NS_NewISupportsArray(getter_AddRefs(messageArray));
  NS_NewISupportsArray(getter_AddRefs(folderArray));
  
  //Split up deleted items into different type arrays to be passed to the folder
  //for deletion.
  for(PRUint32 item = 0; item < itemCount; item++)
  {
    nsCOMPtr<nsISupports> supports = getter_AddRefs(arguments->ElementAt(item));
    nsCOMPtr<nsIMsgDBHdr> deletedMessage(do_QueryInterface(supports));
    nsCOMPtr<nsIMsgFolder> deletedFolder(do_QueryInterface(supports));
    if (deletedMessage)
    {
      messageArray->AppendElement(supports);
    }
    else if(deletedFolder)
    {
      folderArray->AppendElement(supports);
    }
  }
  PRUint32 cnt;
  rv = messageArray->Count(&cnt);
  if (NS_FAILED(rv)) return rv;
  if (cnt > 0)
    rv = folder->DeleteMessages(messageArray, msgWindow, reallyDelete, PR_FALSE, nsnull, PR_TRUE /*allowUndo*/);
  
  rv = folderArray->Count(&cnt);
  if (NS_FAILED(rv)) return rv;
  if (cnt > 0)
  {
    nsCOMPtr<nsIMsgFolder> folderToDelete = do_QueryElementAt(folderArray, 0);
    PRUint32 folderFlags = 0;
    if (folderToDelete)
    {
      folderToDelete->GetFlags(&folderFlags);
      if (folderFlags & MSG_FOLDER_FLAG_VIRTUAL)
      {
        NS_ENSURE_ARG_POINTER(msgWindow);
        nsCOMPtr<nsIStringBundleService> sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
        nsCOMPtr<nsIStringBundle> sMessengerStringBundle;
        nsXPIDLString confirmMsg;

        if (NS_SUCCEEDED(rv) && sBundleService) 
          rv = sBundleService->CreateBundle(MESSENGER_STRING_URL, getter_AddRefs(sMessengerStringBundle));
        NS_ENSURE_SUCCESS(rv, rv);
        sMessengerStringBundle->GetStringFromName(NS_LITERAL_STRING("confirmSavedSearchDeleteMessage").get(), getter_Copies(confirmMsg));

        nsCOMPtr<nsIPrompt> dialog;
        rv = msgWindow->GetPromptDialog(getter_AddRefs(dialog));
        if (NS_SUCCEEDED(rv))
        {
          PRBool dialogResult;
          rv = dialog->Confirm(nsnull, confirmMsg, &dialogResult);
          if (!dialogResult)
            return NS_OK;
        }
      }
    }
    rv = folder->DeleteSubFolders(folderArray, msgWindow);
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::DoFolderAssert ( nsIMsgFolder folder,
nsIRDFResource property,
nsIRDFNode target 
) [protected, inherited]

Definition at line 2165 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  if((kNC_Charset == property))
  {
    nsCOMPtr<nsIRDFLiteral> literal(do_QueryInterface(target));
    if(literal)
    {
      const PRUnichar* value;
      rv = literal->GetValueConst(&value);
      if(NS_SUCCEEDED(rv))
        rv = folder->SetCharset(NS_LossyConvertUCS2toASCII(value).get());
    }
    else
      rv = NS_ERROR_FAILURE;
  }
  else if (kNC_Open == property && target == kTrueLiteral)
      rv = folder->ClearFlag(MSG_FOLDER_FLAG_ELIDED);

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::DoFolderCopyToFolder ( nsIMsgFolder dstFolder,
nsISupportsArray arguments,
nsIMsgWindow msgWindow,
PRBool  isMoveFolder 
) [protected, inherited]

Definition at line 2036 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  PRUint32 itemCount;
  rv = arguments->Count(&itemCount);
  if (NS_FAILED(rv)) return rv;
  
  //need at least one item to copy
  if(itemCount < 1)
    return NS_ERROR_FAILURE;
  
  if (!isMoveFolder)   // copy folder not on the same server
  {
    //Call copyservice with dstFolder, srcFolder, folders and isMoveFolder
    nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv); 
    if(NS_SUCCEEDED(rv))
    {
      rv = copyService->CopyFolders(arguments, dstFolder, isMoveFolder, 
        nsnull, msgWindow);
      
    }
  }
  else    //within the same server therefore no need for copy service 
  {
    
    nsCOMPtr<nsIMsgFolder> msgFolder;
    for (PRUint32 i=0;i< itemCount; i++)
    {
      msgFolder = do_QueryElementAt(arguments, i, &rv);
      if (NS_SUCCEEDED(rv))
      {
        rv = dstFolder->CopyFolder(msgFolder, isMoveFolder , msgWindow, nsnull);
        NS_ASSERTION((NS_SUCCEEDED(rv)),"Copy folder failed.");
      }
    }
  }
  
  return rv;
  //return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::DoFolderHasAssertion ( nsIMsgFolder folder,
nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
PRBool hasAssertion 
) [protected, inherited]

Definition at line 2198 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_OK;
  if(!hasAssertion)
    return NS_ERROR_NULL_POINTER;
  
  //We're not keeping track of negative assertions on folders.
  if(!tv)
  {
    *hasAssertion = PR_FALSE;
    return NS_OK;
  }
  
  if((kNC_Child == property))
  {
    nsCOMPtr<nsIMsgFolder> childFolder(do_QueryInterface(target, &rv));
    if(NS_SUCCEEDED(rv))
    {
      nsCOMPtr<nsIMsgFolder> childsParent;
      rv = childFolder->GetParent(getter_AddRefs(childsParent));
      *hasAssertion = (NS_SUCCEEDED(rv) && childsParent && folder
        && (childsParent.get() == folder));
    }
  }
  else if ((kNC_Name == property) ||
    (kNC_Open == property) ||
    (kNC_FolderTreeName == property) ||
    (kNC_FolderTreeSimpleName == property) ||
    (kNC_SpecialFolder == property) ||
    (kNC_ServerType == property) ||
    (kNC_IsDeferred == property) ||
    (kNC_RedirectorType == property) ||
    (kNC_CanCreateFoldersOnServer == property) ||
    (kNC_CanFileMessagesOnServer == property) ||
    (kNC_IsServer == property) ||
    (kNC_IsSecure == property) ||
    (kNC_CanSubscribe == property) ||
    (kNC_SupportsOffline == property) ||
    (kNC_CanFileMessages == property) ||
    (kNC_CanCreateSubfolders == property) ||
    (kNC_CanRename == property) ||
    (kNC_CanCompact == property) ||
    (kNC_TotalMessages == property) ||
    (kNC_TotalUnreadMessages == property) ||
    (kNC_FolderSize == property) ||
    (kNC_Charset == property) ||
    (kNC_BiffState == property) ||
    (kNC_HasUnreadMessages == property) ||
    (kNC_NoSelect == property)  ||
    (kNC_Synchronize == property) ||
    (kNC_SyncDisabled == property) ||
    (kNC_VirtualFolder == property) ||
    (kNC_CanSearchMessages == property))
  {
    nsCOMPtr<nsIRDFResource> folderResource(do_QueryInterface(folder, &rv));
    
    if(NS_FAILED(rv))
      return rv;
    
    rv = GetTargetHasAssertion(this, folderResource, 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:

nsresult nsMsgFolderDataSource::DoFolderUnassert ( nsIMsgFolder folder,
nsIRDFResource property,
nsIRDFNode target 
) [protected, inherited]

Definition at line 2188 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  if((kNC_Open == property) && target == kTrueLiteral)
      rv = folder->SetFlag(MSG_FOLDER_FLAG_ELIDED);

  return rv;
}

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::DoNewFolder ( nsIMsgFolder folder,
nsISupportsArray arguments,
nsIMsgWindow window 
) [protected, inherited]

Definition at line 2150 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_OK;
  nsCOMPtr<nsIRDFLiteral> literal = do_QueryElementAt(arguments, 0, &rv);
  if(NS_SUCCEEDED(rv))
  {
    nsXPIDLString name;
    literal->GetValue(getter_Copies(name));
    
    rv = folder->CreateSubfolder(name, window);
    
  }
  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.

Definition at line 728 of file nsMsgFolderDataSource.cpp.

Here is the call graph for this function:

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

Here is the caller graph for this function:

Definition at line 721 of file nsMsgFolderDataSource.cpp.

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

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::GetBiffStateString ( PRUint32  biffState,
nsCAutoString biffStateStr 
) [protected, inherited]

Definition at line 678 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  rv = NS_NewISupportsArray(arcs);
  if(NS_FAILED(rv))
    return rv;
  
  (*arcs)->AppendElement(kNC_Name);
  (*arcs)->AppendElement(kNC_Open);
  (*arcs)->AppendElement(kNC_FolderTreeName);
  (*arcs)->AppendElement(kNC_FolderTreeSimpleName);
  (*arcs)->AppendElement(kNC_SpecialFolder);
  (*arcs)->AppendElement(kNC_ServerType);
  (*arcs)->AppendElement(kNC_IsDeferred);
  (*arcs)->AppendElement(kNC_RedirectorType);
  (*arcs)->AppendElement(kNC_CanCreateFoldersOnServer);
  (*arcs)->AppendElement(kNC_CanFileMessagesOnServer);
  (*arcs)->AppendElement(kNC_IsServer);
  (*arcs)->AppendElement(kNC_IsSecure);
  (*arcs)->AppendElement(kNC_CanSubscribe);
  (*arcs)->AppendElement(kNC_SupportsOffline);
  (*arcs)->AppendElement(kNC_CanFileMessages);
  (*arcs)->AppendElement(kNC_CanCreateSubfolders);
  (*arcs)->AppendElement(kNC_CanRename);
  (*arcs)->AppendElement(kNC_CanCompact);
  (*arcs)->AppendElement(kNC_TotalMessages);
  (*arcs)->AppendElement(kNC_TotalUnreadMessages);
  (*arcs)->AppendElement(kNC_FolderSize);
  (*arcs)->AppendElement(kNC_Charset);
  (*arcs)->AppendElement(kNC_BiffState);
  (*arcs)->AppendElement(kNC_Child);
  (*arcs)->AppendElement(kNC_NoSelect);
  (*arcs)->AppendElement(kNC_VirtualFolder);
  (*arcs)->AppendElement(kNC_InVFEditSearchScope);
  (*arcs)->AppendElement(kNC_ImapShared);
  (*arcs)->AppendElement(kNC_Synchronize);
  (*arcs)->AppendElement(kNC_SyncDisabled);
  (*arcs)->AppendElement(kNC_CanSearchMessages);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFlatFolderDataSource::GetFolderDisplayName ( nsIMsgFolder folder,
PRUnichar **  folderName 
) [protected, virtual, inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2450 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString curFolderName;
  folder->GetName(getter_Copies(curFolderName));
  PRUint32 foldersCount = m_folders.Count();
  nsXPIDLString otherFolderName;
  for (PRUint32 index = 0; index < foldersCount; index++)
  {
    if (folder == m_folders[index]) // ignore ourselves.
      continue;
    m_folders[index]->GetName(getter_Copies(otherFolderName));
    if (otherFolderName.Equals(curFolderName))
    {
      nsCOMPtr <nsIMsgIncomingServer> server;
      folder->GetServer(getter_AddRefs(server));
      if (server)
      {
        nsXPIDLString serverName;
        server->GetPrettyName(getter_Copies(serverName));
        curFolderName.Append(NS_LITERAL_STRING(" - "));
        curFolderName.Append(serverName);
        *folderName = ToNewUnicode(curFolderName);
        return (*folderName) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
      }
    }
  }
  // check if folder name is unique - if not, append account name
  return folder->GetAbbreviatedName(folderName);
}

Here is the call graph for this function:

nsresult nsMsgFolderDataSource::GetFolderSizeNode ( PRInt32  folderSize,
nsIRDFNode **  node 
) [protected, inherited]

Definition at line 1947 of file nsMsgFolderDataSource.cpp.

{
  PRUint32 folderSize = aFolderSize;
  if (folderSize == kDisplayBlankCount || folderSize == 0)
    createNode(EmptyString().get(), aNode, getRDFService());
  else if(folderSize == kDisplayQuestionCount)
    createNode(NS_LITERAL_STRING("???").get(), aNode, getRDFService());
  else
  {
    nsAutoString sizeString;
    // use Round or Ceil - bug #251202
    folderSize = DIVISIONWITHCEIL(folderSize, 1024);  // normalize into k;
    PRBool sizeInMB = (folderSize > 999); // 999, not 1024 - bug #251204

    // kKiloByteString/kMegaByteString are localized strings that we use
    // to get the right format to add on the "KB"/"MB" or equivalent
    nsTextFormatter::ssprintf(sizeString,
                              (sizeInMB) ? kMegaByteString : kKiloByteString,
                              (sizeInMB) ? DIVISIONWITHCEIL(folderSize, 1024) : folderSize);
    createNode(sizeString.get(), aNode, getRDFService());
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::GetNumMessagesNode ( PRInt32  numMessages,
nsIRDFNode **  node 
) [protected, inherited]

Definition at line 1932 of file nsMsgFolderDataSource.cpp.

{
  PRUint32 numMessages = aNumMessages;
  if(numMessages == kDisplayQuestionCount)
    createNode(NS_LITERAL_STRING("???").get(), node, getRDFService());
  else if (numMessages == kDisplayBlankCount || numMessages == 0)
    createNode(EmptyString().get(), node, getRDFService());
  else
    createIntNode(numMessages, node, getRDFService());
  return NS_OK;
}

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:

nsresult nsMsgFolderDataSource::GetSenderName ( nsAutoString sender,
nsAutoString senderUserName 
) [protected, inherited]
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:

NS_IMETHODIMP nsMsgFolderDataSource::GetSource ( nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
nsIRDFResource **  source 
) [inherited]

Definition at line 416 of file nsMsgFolderDataSource.cpp.

{
  NS_ASSERTION(PR_FALSE, "not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}
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 nsMsgFolderDataSource::GetSources ( nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
nsISimpleEnumerator **  sources 
) [inherited]

Definition at line 461 of file nsMsgFolderDataSource.cpp.

{
  return NS_RDF_NO_VALUE;
}
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 nsMsgFlatFolderDataSource::GetTarget ( nsIRDFResource source,
nsIRDFResource property,
PRBool  tv,
nsIRDFNode **  target 
) [inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2297 of file nsMsgFolderDataSource.cpp.

{
  return (property == kNC_Child) 
    ? NS_RDF_NO_VALUE
    : nsMsgFolderDataSource::GetTarget(source, property, tv, target);
}
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:

NS_IMETHODIMP nsMsgFlatFolderDataSource::GetTargets ( nsIRDFResource source,
nsIRDFResource property,
PRBool  tv,
nsISimpleEnumerator **  targets 
) [inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2308 of file nsMsgFolderDataSource.cpp.

{
  if (kNC_Child != property)
    return nsMsgFolderDataSource::GetTargets(source, property, tv, targets);

  nsresult rv = NS_RDF_NO_VALUE;
  if(!targets)
    return NS_ERROR_NULL_POINTER;

  if (ResourceIsOurRoot(source))
  {
    // need an enumerator that gives all folders with unread
    nsCOMPtr <nsIMsgAccountManager> accountManager = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv,rv);

    nsCOMPtr<nsISupportsArray> allServers;
    rv = accountManager->GetAllServers(getter_AddRefs(allServers));
    nsCOMPtr <nsISupportsArray> allFolders = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);;
    if (NS_SUCCEEDED(rv) && allServers)
    {
      PRUint32 count = 0;
      allServers->Count(&count);
      PRUint32 i;
      for (i = 0; i < count; i++) 
      {
        nsCOMPtr<nsIMsgIncomingServer> server = do_QueryElementAt(allServers, i);
        if (server)
        {
          nsCOMPtr <nsIMsgFolder> rootFolder;
          server->GetRootFolder(getter_AddRefs(rootFolder));
          if (rootFolder)
          {
            nsCOMPtr<nsIEnumerator> subFolders;
            rv = rootFolder->GetSubFolders(getter_AddRefs(subFolders));

            PRUint32 lastEntry;
            allFolders->Count(&lastEntry);
            rv = rootFolder->ListDescendents(allFolders);
            PRUint32 newLastEntry;
            allFolders->Count(&newLastEntry);
            for (PRUint32 newEntryIndex = lastEntry; newEntryIndex < newLastEntry;)
            {
              nsCOMPtr <nsIMsgFolder> curFolder = do_QueryElementAt(allFolders, newEntryIndex);
              if (!WantsThisFolder(curFolder))
              {
                allFolders->RemoveElementAt(newEntryIndex);
                newLastEntry--;
              }
              else
              {
                // unfortunately, we need a separate array for this since
                // ListDescendents takes an nsISupportsArray. But we want
                // to use an nsCOMArrray for the DS since that's the 
                // preferred mechanism.
                m_folders.AppendObject(curFolder);
                newEntryIndex++;
              }
            }
          }
        }
      }
      return NS_NewArrayEnumerator(targets, allFolders);
    }
  }
  nsSingletonEnumerator* cursor = new nsSingletonEnumerator(property);
  if (cursor == nsnull)
    return NS_ERROR_OUT_OF_MEMORY;
  NS_ADDREF(*targets = cursor);
  return NS_OK;
}

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

NS_IMETHODIMP nsMsgFlatFolderDataSource::GetURI ( char **  uri) [inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2383 of file nsMsgFolderDataSource.cpp.

{
  nsCAutoString uri("rdf:");
  uri.Append(m_dsName);
  return (*aUri = ToNewCString(uri))
    ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

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.

NS_IMETHODIMP nsMsgFolderDataSource::HasArcOut ( nsIRDFResource aSource,
nsIRDFResource aArc,
PRBool result 
) [inherited]

Definition at line 606 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(aSource, &rv));
  if (NS_SUCCEEDED(rv)) 
  {
    *result = (aArc == kNC_Name ||
      aArc == kNC_Open ||
      aArc == kNC_FolderTreeName ||
      aArc == kNC_FolderTreeSimpleName ||
      aArc == kNC_SpecialFolder ||
      aArc == kNC_ServerType ||
      aArc == kNC_IsDeferred ||
      aArc == kNC_RedirectorType ||
      aArc == kNC_CanCreateFoldersOnServer ||
      aArc == kNC_CanFileMessagesOnServer ||
      aArc == kNC_IsServer ||
      aArc == kNC_IsSecure ||
      aArc == kNC_CanSubscribe ||
      aArc == kNC_SupportsOffline ||
      aArc == kNC_CanFileMessages ||
      aArc == kNC_CanCreateSubfolders ||
      aArc == kNC_CanRename ||
      aArc == kNC_CanCompact ||
      aArc == kNC_TotalMessages ||
      aArc == kNC_TotalUnreadMessages ||
      aArc == kNC_FolderSize ||
      aArc == kNC_Charset ||
      aArc == kNC_BiffState ||
      aArc == kNC_Child ||
      aArc == kNC_NoSelect ||
      aArc == kNC_VirtualFolder ||
      aArc == kNC_InVFEditSearchScope ||
      aArc == kNC_ImapShared ||
      aArc == kNC_Synchronize ||
      aArc == kNC_SyncDisabled ||
      aArc == kNC_CanSearchMessages);
  }
  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.

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:

NS_IMETHODIMP nsMsgFlatFolderDataSource::HasAssertion ( nsIRDFResource source,
nsIRDFResource property,
nsIRDFNode target,
PRBool  tv,
PRBool hasAssertion 
) [inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2391 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  // we need to check if the folder belongs in this datasource.
  if (NS_SUCCEEDED(rv) && property != kNC_Open && property != kNC_Child)
  {
    if (WantsThisFolder(folder) && (kNC_Child != property))
      return DoFolderHasAssertion(folder, property, target, tv, hasAssertion);
  }
  else if (property == kNC_Child && ResourceIsOurRoot(source)) // check if source is us
  {
    folder = do_QueryInterface(target);
    if (folder)
    {
      nsCOMPtr<nsIMsgFolder> parentMsgFolder;
      folder->GetParentMsgFolder(getter_AddRefs(parentMsgFolder));
      // a folder without a parent must be getting deleted as part of
      // the rename operation and is thus a folder we are 
      // no longer interested in
      if (parentMsgFolder && WantsThisFolder(folder))
      {
        *hasAssertion = PR_TRUE;
        return NS_OK;
      }
    }
  }
  *hasAssertion = PR_FALSE;
  return NS_OK;
}

Here is the call graph for this function:

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

Reimplemented from nsMsgFolderDataSource.

Definition at line 2279 of file nsMsgFolderDataSource.cpp.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgFolderDataSource::IsCommandEnabled ( nsISupportsArray aSources,
nsIRDFResource aCommand,
nsISupportsArray aArguments,
PRBool aResult 
) [inherited]

Definition at line 760 of file nsMsgFolderDataSource.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 nsMsgFolderDataSource::NotifyAncestors ( nsIMsgFolder aFolder,
nsIRDFResource aPropertyResource,
nsIRDFNode aNode 
) [protected, inherited]

Definition at line 1814 of file nsMsgFolderDataSource.cpp.

{
  PRBool isServer = PR_FALSE;
  nsresult rv = aFolder->GetIsServer(&isServer);
  NS_ENSURE_SUCCESS(rv,rv);
 
  if (isServer)
    // done, stop
    return NS_OK;
  
  nsCOMPtr <nsIMsgFolder> parentMsgFolder;
  rv = aFolder->GetParentMsgFolder(getter_AddRefs(parentMsgFolder));
  NS_ENSURE_SUCCESS(rv,rv);
  if (!parentMsgFolder)
    return NS_OK;

  rv = parentMsgFolder->GetIsServer(&isServer);
  NS_ENSURE_SUCCESS(rv,rv);
 
  // don't need to notify servers either.
  if (isServer) 
    // done, stop
    return NS_OK;

  nsCOMPtr<nsIRDFResource> parentFolderResource = do_QueryInterface(parentMsgFolder,&rv);
  NS_ENSURE_SUCCESS(rv,rv);

  // if we're setting the subFoldersHaveUnreadMessages property to false, check
  // if the folder really doesn't have subfolders with unread messages.
  if (aPropertyResource == kNC_SubfoldersHaveUnreadMessages && aNode == kFalseLiteral)
  {
    nsCOMPtr <nsIRDFNode> unreadMsgsNode;
    createHasUnreadMessagesNode(parentMsgFolder, PR_TRUE, getter_AddRefs(unreadMsgsNode));
    aNode = unreadMsgsNode;
  }
  NotifyPropertyChanged(parentFolderResource, aPropertyResource, aNode);

  return NotifyAncestors(parentMsgFolder, aPropertyResource, aNode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::NotifyFolderNameChanged ( nsIMsgFolder folder,
nsIRDFResource folderResource 
) [protected, inherited]

Definition at line 1767 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString name;
  nsresult rv = aFolder->GetName(getter_Copies(name));

  if (NS_SUCCEEDED(rv)) {
    nsCOMPtr<nsIRDFNode> newNameNode;
    createNode(name.get(), getter_AddRefs(newNameNode), getRDFService());
    NotifyPropertyChanged(folderResource, kNC_Name, newNameNode);
  }
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsMsgFolderDataSource::NotifyFolderTreeNameChanged ( nsIMsgFolder folder,
nsIRDFResource folderResource,
PRInt32  aUnreadMessages 
) [protected, inherited]

Definition at line 1795 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString name;
  nsresult rv = GetFolderDisplayName(aFolder, getter_Copies(name));
  if (NS_SUCCEEDED(rv)) {
    nsAutoString newNameString(name);
                     
    CreateUnreadMessagesNameString(aUnreadMessages, newNameString);   
                     
    nsCOMPtr<nsIRDFNode> newNameNode;
    createNode(newNameString.get(), getter_AddRefs(newNameNode), getRDFService());
    NotifyPropertyChanged(aFolderResource, kNC_FolderTreeName, newNameNode);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFolderDataSource::NotifyFolderTreeSimpleNameChanged ( nsIMsgFolder folder,
nsIRDFResource folderResource 
) [protected, inherited]

Definition at line 1781 of file nsMsgFolderDataSource.cpp.

{
  nsXPIDLString abbreviatedName;
  nsresult rv = GetFolderDisplayName(aFolder, getter_Copies(abbreviatedName));
  if (NS_SUCCEEDED(rv)) {
    nsCOMPtr<nsIRDFNode> newNameNode;
    createNode(abbreviatedName.get(), getter_AddRefs(newNameNode), getRDFService());
    NotifyPropertyChanged(folderResource, kNC_FolderTreeSimpleName, newNameNode);
  }

  return NS_OK;
}

Here is the call 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 nsMsgUnreadFoldersDataSource::NotifyPropertyChanged ( nsIRDFResource resource,
nsIRDFResource propertyResource,
nsIRDFNode newNode,
nsIRDFNode oldNode = nsnull 
) [virtual]

Reimplemented from nsMsgRDFDataSource.

Definition at line 2488 of file nsMsgFolderDataSource.cpp.

{
  // check if it's the has unread property that's changed; if so, see if we need
  // to add this folder to the view.
  // Then, call base class.
  if (kNC_HasUnreadMessages == property)
  {
    nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(resource));
    if (folder)
    {
      PRInt32 numUnread;
      folder->GetNumUnread(PR_FALSE, &numUnread);
      if (numUnread > 0)
      {
        if (m_folders.IndexOf(folder) == kNotFound)
          m_folders.AppendObject(folder);
        NotifyObservers(kNC_UnreadFolders, kNC_Child, resource, nsnull, PR_TRUE, PR_FALSE);
      }
    }
  }
  return nsMsgFolderDataSource::NotifyPropertyChanged(resource, property, 
                                                newNode, oldNode);
}

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.
nsresult nsMsgFolderDataSource::OnFolderSizePropertyChanged ( nsIRDFResource folderResource,
PRInt32  oldValue,
PRInt32  newValue 
) [protected, inherited]

nsresult nsMsgFolderDataSource::OnUnreadMessagePropertyChanged(nsIMsgFolder *folder, PRInt32 oldValue, PRInt32 newValue) { nsCOMPtr<nsIRDFResource> folderResource = do_QueryInterface(folder); if(folderResource) { First send a regular unread message changed notification nsCOMPtr<nsIRDFNode> newNode;

          GetNumMessagesNode(newValue, getter_AddRefs(newNode));
          NotifyPropertyChanged(folderResource, kNC_TotalUnreadMessages, newNode);

Now see if hasUnreadMessages has changed nsCOMPtr<nsIRDFNode> oldHasUnreadMessages; nsCOMPtr<nsIRDFNode> newHasUnreadMessages; if(oldValue <=0 && newValue >0) { oldHasUnreadMessages = kFalseLiteral; newHasUnreadMessages = kTrueLiteral; NotifyPropertyChanged(folderResource, kNC_HasUnreadMessages, newHasUnreadMessages); } else if(oldValue > 0 && newValue <= 0) { newHasUnreadMessages = kFalseLiteral; NotifyPropertyChanged(folderResource, kNC_HasUnreadMessages, newHasUnreadMessages); } } return NS_OK; }

Definition at line 1914 of file nsMsgFolderDataSource.cpp.

{
  nsCOMPtr<nsIRDFNode> newNode;
  GetFolderSizeNode(newValue, getter_AddRefs(newNode));
  NotifyPropertyChanged(folderResource, kNC_FolderSize, newNode);
  return NS_OK;
}

Here is the call graph for this function:

void nsIFolderListener::OnItemAdded ( in nsIRDFResource  parentItem,
in nsISupports  item 
) [inherited]

Here is the caller graph for this function:

nsresult nsMsgFlatFolderDataSource::OnItemAddedOrRemoved ( nsIRDFResource parentItem,
nsISupports *  item,
PRBool  added 
) [protected, virtual, inherited]

Reimplemented from nsMsgFolderDataSource.

Definition at line 2427 of file nsMsgFolderDataSource.cpp.

{
  // When a folder is added or removed, parentItem is the parent folder and item is the folder being
  // added or removed. In a flat data source, there is no arc in the graph between the parent folder
  // and the folder being added or removed. Our flat data source root (i.e. mailnewsunreadfolders:/) has 
  // an arc with the child property to every folder in the data source.  We must change parentItem
  // to be our data source root before calling nsMsgFolderDataSource::OnItemAddedOrRemoved. This ensures
  // that datasource listeners such as the template builder properly handle add and remove 
  // notifications on the flat datasource.
  return nsMsgFolderDataSource::OnItemAddedOrRemoved(m_rootResource, item, added);
}
void nsIFolderListener::OnItemBoolPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in boolean  oldValue,
in boolean  newValue 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemEvent ( in nsIMsgFolder  item,
in nsIAtom  event 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemIntPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in long  oldValue,
in long  newValue 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in string  oldValue,
in string  newValue 
) [inherited]
void nsIFolderListener::OnItemPropertyFlagChanged ( in nsIMsgDBHdr  item,
in nsIAtom  property,
in unsigned long  oldFlag,
in unsigned long  newFlag 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemRemoved ( in nsIRDFResource  parentItem,
in nsISupports  item 
) [inherited]
void nsIFolderListener::OnItemUnicharPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in wstring  oldValue,
in wstring  newValue 
) [inherited]
nsresult nsMsgFolderDataSource::OnTotalMessagePropertyChanged ( nsIRDFResource folderResource,
PRInt32  oldValue,
PRInt32  newValue 
) [protected, inherited]

Definition at line 1923 of file nsMsgFolderDataSource.cpp.

{
  nsCOMPtr<nsIRDFNode> newNode;
  GetNumMessagesNode(newValue, getter_AddRefs(newNode));
  NotifyPropertyChanged(folderResource, kNC_TotalMessages, newNode);
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsMsgFolderDataSource::OnUnreadMessagePropertyChanged ( nsIRDFResource folderResource,
PRInt32  oldValue,
PRInt32  newValue 
) [protected, inherited]

Definition at line 1735 of file nsMsgFolderDataSource.cpp.

{
  nsCOMPtr<nsIMsgFolder> folder = do_QueryInterface(folderResource);
  if(folder)
  {
    //First send a regular unread message changed notification
    nsCOMPtr<nsIRDFNode> newNode;

    GetNumMessagesNode(newValue, getter_AddRefs(newNode));
    NotifyPropertyChanged(folderResource, kNC_TotalUnreadMessages, newNode);
       
    //Now see if hasUnreadMessages has changed
    if(oldValue <=0 && newValue >0)
    {
      NotifyPropertyChanged(folderResource, kNC_HasUnreadMessages, kTrueLiteral);
      NotifyAncestors(folder, kNC_SubfoldersHaveUnreadMessages, kTrueLiteral);
    }
    else if(oldValue > 0 && newValue <= 0)
    {
      NotifyPropertyChanged(folderResource, kNC_HasUnreadMessages, kFalseLiteral);
      // this isn't quite right - parents could still have other children with 
      // unread messages. NotifyAncestors will have to figure that out...
      NotifyAncestors(folder, kNC_SubfoldersHaveUnreadMessages, kFalseLiteral);
    }

    //We will have to change the folderTreeName if the unread column is hidden
    NotifyFolderTreeNameChanged(folder, folderResource, newValue);
  }
  return NS_OK;
}

Here is the call graph for this function:

Remove an observer from this data source.

Here is the caller graph for this function:

PRBool nsMsgFlatFolderDataSource::ResourceIsOurRoot ( nsIRDFResource resource) [protected, inherited]

Definition at line 2439 of file nsMsgFolderDataSource.cpp.

{
  return m_rootResource.get() == resource;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgFolderDataSource::Unassert ( nsIRDFResource source,
nsIRDFResource property,
nsIRDFNode target 
) [inherited]

Definition at line 568 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  NS_ENSURE_SUCCESS(rv,rv);
  return DoFolderUnassert(folder, property, target);
}

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

Reimplemented from nsMsgFlatFolderDataSource.

Definition at line 2481 of file nsMsgFolderDataSource.cpp.

{
  PRInt32 numUnread;
  folder->GetNumUnread(PR_FALSE, &numUnread);
  return numUnread > 0;
}

Member Data Documentation

Definition at line 49 of file nsIFolderListener.idl.

Definition at line 69 of file nsIFolderListener.idl.

nsrefcnt nsMsgFolderDataSource::gFolderResourceRefCnt = 0 [static, protected, inherited]

Definition at line 291 of file nsMsgFolderDataSource.h.

Definition at line 63 of file nsIFolderListener.idl.

nsIAtom * nsMsgFolderDataSource::kBiffStateAtom = nsnull [static, protected, inherited]

Definition at line 285 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kCanFileMessagesAtom = nsnull [static, protected, inherited]

Definition at line 292 of file nsMsgFolderDataSource.h.

Definition at line 279 of file nsMsgFolderDataSource.h.

Definition at line 295 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kFolderSizeAtom = nsnull [static, protected, inherited]

Definition at line 284 of file nsMsgFolderDataSource.h.

Definition at line 293 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kIsDeferredAtom = nsnull [static, protected, inherited]

Definition at line 290 of file nsMsgFolderDataSource.h.

PRUnichar * nsMsgFolderDataSource::kKiloByteString = nsnull [static, protected, inherited]

Definition at line 297 of file nsMsgFolderDataSource.h.

PRUnichar * nsMsgFolderDataSource::kMegaByteString = nsnull [static, protected, inherited]

Definition at line 298 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kNameAtom = nsnull [static, protected, inherited]

Definition at line 287 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_BiffState = nsnull [static, protected, inherited]

Definition at line 248 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_CanCompact = nsnull [static, protected, inherited]

Definition at line 243 of file nsMsgFolderDataSource.h.

Definition at line 234 of file nsMsgFolderDataSource.h.

Definition at line 241 of file nsMsgFolderDataSource.h.

Definition at line 240 of file nsMsgFolderDataSource.h.

Definition at line 235 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_CanRename = nsnull [static, protected, inherited]

Definition at line 242 of file nsMsgFolderDataSource.h.

Definition at line 256 of file nsMsgFolderDataSource.h.

Definition at line 238 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Charset = nsnull [static, protected, inherited]

Definition at line 247 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Child = nsnull [static, protected, inherited]

Definition at line 220 of file nsMsgFolderDataSource.h.

nsIRDFResource* nsMsgFolderDataSource::kNC_Columns [static, protected, inherited]

Definition at line 228 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Compact = nsnull [static, protected, inherited]

Definition at line 272 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_CompactAll = nsnull [static, protected, inherited]

Definition at line 273 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Copy = nsnull [static, protected, inherited]

Definition at line 267 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_CopyFolder = nsnull [static, protected, inherited]

Definition at line 269 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Delete = nsnull [static, protected, inherited]

Definition at line 263 of file nsMsgFolderDataSource.h.

Definition at line 276 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_EmptyTrash = nsnull [static, protected, inherited]

Definition at line 275 of file nsMsgFolderDataSource.h.

Definition at line 260 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Folder = nsnull [static, protected, inherited]

Definition at line 221 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_FolderSize = nsnull [static, protected, inherited]

Definition at line 246 of file nsMsgFolderDataSource.h.

Definition at line 224 of file nsMsgFolderDataSource.h.

Definition at line 227 of file nsMsgFolderDataSource.h.

Definition at line 225 of file nsMsgFolderDataSource.h.

Definition at line 266 of file nsMsgFolderDataSource.h.

Definition at line 249 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_ImapShared = nsnull [static, protected, inherited]

Definition at line 253 of file nsMsgFolderDataSource.h.

Definition at line 258 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_IsDeferred = nsnull [static, protected, inherited]

Definition at line 232 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_IsSecure = nsnull [static, protected, inherited]

Definition at line 237 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_IsServer = nsnull [static, protected, inherited]

Definition at line 236 of file nsMsgFolderDataSource.h.

Definition at line 271 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Move = nsnull [static, protected, inherited]

Definition at line 268 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_MoveFolder = nsnull [static, protected, inherited]

Definition at line 270 of file nsMsgFolderDataSource.h.

Definition at line 229 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Name = nsnull [static, protected, inherited]

Definition at line 222 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_NameSort = nsnull [static, protected, inherited]

Definition at line 226 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_NewFolder = nsnull [static, protected, inherited]

Definition at line 265 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_NewMessages = nsnull [static, protected, inherited]

Definition at line 250 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_NoSelect = nsnull [static, protected, inherited]

Definition at line 252 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Open = nsnull [static, protected, inherited]

Definition at line 223 of file nsMsgFolderDataSource.h.

Definition at line 264 of file nsMsgFolderDataSource.h.

Definition at line 261 of file nsMsgFolderDataSource.h.

Definition at line 233 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Rename = nsnull [static, protected, inherited]

Definition at line 274 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_ServerType = nsnull [static, protected, inherited]

Definition at line 231 of file nsMsgFolderDataSource.h.

Definition at line 230 of file nsMsgFolderDataSource.h.

Definition at line 251 of file nsMsgFolderDataSource.h.

Definition at line 239 of file nsMsgFolderDataSource.h.

Definition at line 255 of file nsMsgFolderDataSource.h.

nsIRDFResource * nsMsgFolderDataSource::kNC_Synchronize = nsnull [static, protected, inherited]

Definition at line 254 of file nsMsgFolderDataSource.h.

Definition at line 244 of file nsMsgFolderDataSource.h.

Definition at line 245 of file nsMsgFolderDataSource.h.

Definition at line 259 of file nsMsgFolderDataSource.h.

Definition at line 257 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kNewMessagesAtom = nsnull [static, protected, inherited]

Definition at line 286 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kOpenAtom = nsnull [static, protected, inherited]

Definition at line 289 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kSynchronizeAtom = nsnull [static, protected, inherited]

Definition at line 288 of file nsMsgFolderDataSource.h.

nsIAtom * nsMsgFolderDataSource::kTotalMessagesAtom = nsnull [static, protected, inherited]

Definition at line 282 of file nsMsgFolderDataSource.h.

Definition at line 283 of file nsMsgFolderDataSource.h.

Definition at line 278 of file nsMsgFolderDataSource.h.

Definition at line 335 of file nsMsgFolderDataSource.h.

Definition at line 333 of file nsMsgFolderDataSource.h.

Definition at line 334 of file nsMsgFolderDataSource.h.

Definition at line 88 of file nsMsgRDFDataSource.h.

PRBool nsMsgRDFDataSource::mInitialized [protected, inherited]

Definition at line 89 of file nsMsgRDFDataSource.h.

Definition at line 86 of file nsMsgRDFDataSource.h.

Definition at line 57 of file nsIFolderListener.idl.

Definition at line 81 of file nsIFolderListener.idl.

Definition at line 53 of file nsIFolderListener.idl.

Definition at line 75 of file nsIFolderListener.idl.

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.


Event Documentation

Definition at line 90 of file nsIFolderListener.idl.

Definition at line 87 of file nsIFolderListener.idl.


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