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
nsMsgFolderDataSource Class Reference

The mail data source. More...

#include <nsMsgFolderDataSource.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIFOLDERLISTENER 
nsMsgFolderDataSource (void)
virtual ~nsMsgFolderDataSource (void)
virtual nsresult Init ()
virtual void Cleanup ()
NS_IMETHOD GetURI (char **uri)
NS_IMETHOD GetSource (nsIRDFResource *property, nsIRDFNode *target, PRBool tv, nsIRDFResource **source)
NS_IMETHOD GetTarget (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsIRDFNode **target)
NS_IMETHOD GetSources (nsIRDFResource *property, nsIRDFNode *target, PRBool tv, nsISimpleEnumerator **sources)
NS_IMETHOD GetTargets (nsIRDFResource *source, nsIRDFResource *property, PRBool tv, nsISimpleEnumerator **targets)
NS_IMETHOD Assert (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv)
NS_IMETHOD Unassert (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target)
NS_IMETHOD HasAssertion (nsIRDFResource *source, nsIRDFResource *property, nsIRDFNode *target, PRBool tv, PRBool *hasAssertion)
NS_IMETHOD HasArcOut (nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *result)
NS_IMETHOD ArcLabelsIn (nsIRDFNode *node, nsISimpleEnumerator **labels)
NS_IMETHOD ArcLabelsOut (nsIRDFResource *source, nsISimpleEnumerator **labels)
NS_IMETHOD GetAllResources (nsISimpleEnumerator **aResult)
NS_IMETHOD GetAllCmds (nsIRDFResource *source, nsISimpleEnumerator **commands)
NS_IMETHOD IsCommandEnabled (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, PRBool *aResult)
NS_IMETHOD DoCommand (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
nsIRDFResource GetSource (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find an RDF resource that points to a given node over the specified arc & truth value.
nsISimpleEnumerator GetSources (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find all RDF resources that point to a given node over the specified arc & truth value.
nsIRDFNode GetTarget (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find a child of that is related to the source by the given arc arc and truth value.
nsISimpleEnumerator GetTargets (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find all children of that are related to the source by the given arc arc and truth value.
void Assert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Add an assertion to the graph.
void Unassert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 Remove an assertion from the graph.
void Change (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aOldTarget, in nsIRDFNode aNewTarget)
 Change an assertion from.
void Move (in nsIRDFResource aOldSource, in nsIRDFResource aNewSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 'Move' an assertion from
boolean HasAssertion (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Query whether an assertion exists in this graph.
void AddObserver (in nsIRDFObserver aObserver)
 Add an observer to this data source.
void RemoveObserver (in nsIRDFObserver aObserver)
 Remove an observer from this data source.
nsISimpleEnumerator ArcLabelsIn (in nsIRDFNode aNode)
 Get a cursor to iterate over all the arcs that point into a node.
nsISimpleEnumerator ArcLabelsOut (in nsIRDFResource aSource)
 Get a cursor to iterate over all the arcs that originate in a resource.
nsISimpleEnumerator GetAllResources ()
 Retrieve all of the resources that the data source currently refers to.
boolean IsCommandEnabled (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Returns whether a given command is enabled for a set of sources.
void DoCommand (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Perform the specified command on set of sources.
nsISimpleEnumerator GetAllCmds (in nsIRDFResource aSource)
 Returns the set of all commands defined for a given source.
boolean hasArcIn (in nsIRDFNode aNode, in nsIRDFResource aArc)
 Returns true if the specified node is pointed to by the specified arc.
boolean hasArcOut (in nsIRDFResource aSource, in nsIRDFResource aArc)
 Returns true if the specified node has the specified outward arc.
void beginUpdateBatch ()
 Notify observers that the datasource is about to send several notifications at once.
void endUpdateBatch ()
 Notify observers that the datasource has completed issuing a notification group.
void 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

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 ()
virtual nsresult OnItemAddedOrRemoved (nsIRDFResource *parentItem, nsISupports *item, PRBool added)
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)
virtual nsresult GetFolderDisplayName (nsIMsgFolder *folder, PRUnichar **folderName)
nsIRDFServicegetRDFService ()
nsresult NotifyObservers (nsIRDFResource *subject, nsIRDFResource *property, nsIRDFNode *newObject, nsIRDFNode *oldObject, PRBool assert, PRBool change)
virtual nsresult NotifyPropertyChanged (nsIRDFResource *resource, nsIRDFResource *propertyResource, nsIRDFNode *newNode, nsIRDFNode *oldNode=nsnull)
nsresult GetTransactionManager (nsISupportsArray *sources, nsITransactionManager **aTransactionManager)

Static Protected Member Functions

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

Protected Attributes

nsCOMPtr< 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

The mail data source.

Definition at line 49 of file nsMsgFolderDataSource.h.


Constructor & Destructor Documentation

Definition at line 154 of file nsMsgFolderDataSource.cpp.

{
  // one-time initialization here
  nsIRDFService* rdf = getRDFService();
  
  if (gFolderResourceRefCnt++ == 0) {
    nsresult res = NS_OK;
    nsCOMPtr<nsIStringBundle> sMessengerStringBundle;

    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CHILD),   &kNC_Child);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_FOLDER),  &kNC_Folder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_NAME),    &kNC_Name);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_OPEN),    &kNC_Open);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_FOLDERTREENAME),    &kNC_FolderTreeName);
    rdf->GetResource(NS_LITERAL_CSTRING("mailnewsunreadfolders:/"),    &kNC_UnreadFolders);
    rdf->GetResource(NS_LITERAL_CSTRING("mailnewsfavefolders:/"),    &kNC_FavoriteFolders);
    rdf->GetResource(NS_LITERAL_CSTRING("mailnewsrecentfolders:/"),    &kNC_RecentFolders);

    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_FOLDERTREESIMPLENAME),    &kNC_FolderTreeSimpleName);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_NAME_SORT),    &kNC_NameSort);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_FOLDERTREENAME_SORT),    &kNC_FolderTreeNameSort);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SPECIALFOLDER), &kNC_SpecialFolder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SERVERTYPE), &kNC_ServerType);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISDEFERRED),&kNC_IsDeferred);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_REDIRECTORTYPE), &kNC_RedirectorType);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANCREATEFOLDERSONSERVER), &kNC_CanCreateFoldersOnServer);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANFILEMESSAGESONSERVER), &kNC_CanFileMessagesOnServer);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISSERVER), &kNC_IsServer);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_ISSECURE), &kNC_IsSecure);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANSUBSCRIBE), &kNC_CanSubscribe);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SUPPORTSOFFLINE), &kNC_SupportsOffline);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANFILEMESSAGES), &kNC_CanFileMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANCREATESUBFOLDERS), &kNC_CanCreateSubfolders);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANRENAME), &kNC_CanRename);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANCOMPACT), &kNC_CanCompact);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_TOTALMESSAGES), &kNC_TotalMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_TOTALUNREADMESSAGES), &kNC_TotalUnreadMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_FOLDERSIZE), &kNC_FolderSize);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CHARSET), &kNC_Charset);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_BIFFSTATE), &kNC_BiffState);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_HASUNREADMESSAGES), &kNC_HasUnreadMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_NEWMESSAGES), &kNC_NewMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SUBFOLDERSHAVEUNREADMESSAGES), &kNC_SubfoldersHaveUnreadMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_NOSELECT), &kNC_NoSelect);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_VIRTUALFOLDER), &kNC_VirtualFolder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_INVFEDITSEARCHSCOPE), &kNC_InVFEditSearchScope);    
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_IMAPSHARED), &kNC_ImapShared);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SYNCHRONIZE), &kNC_Synchronize);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_SYNCDISABLED), &kNC_SyncDisabled);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_CANSEARCHMESSAGES), &kNC_CanSearchMessages);
    
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DELETE), &kNC_Delete);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_REALLY_DELETE), &kNC_ReallyDelete);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_NEWFOLDER), &kNC_NewFolder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_GETNEWMESSAGES), &kNC_GetNewMessages);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COPY), &kNC_Copy);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MOVE), &kNC_Move);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COPYFOLDER), &kNC_CopyFolder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MOVEFOLDER), &kNC_MoveFolder);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MARKALLMESSAGESREAD),
                             &kNC_MarkAllMessagesRead);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COMPACT), &kNC_Compact);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COMPACTALL), &kNC_CompactAll);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_RENAME), &kNC_Rename);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_EMPTYTRASH), &kNC_EmptyTrash);
    rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_DOWNLOADFLAGGED), &kNC_DownloadFlagged);

    kTotalMessagesAtom           = NS_NewAtom("TotalMessages");
    kTotalUnreadMessagesAtom     = NS_NewAtom("TotalUnreadMessages");
    kFolderSizeAtom              = NS_NewAtom("FolderSize");
    kBiffStateAtom               = NS_NewAtom("BiffState");
    kNewMessagesAtom             = NS_NewAtom("NewMessages");
    kNameAtom                    = NS_NewAtom("Name");
    kSynchronizeAtom             = NS_NewAtom("Synchronize");
    kOpenAtom                    = NS_NewAtom("open");
    kIsDeferredAtom              = NS_NewAtom("isDeferred");
    kCanFileMessagesAtom         = NS_NewAtom("canFileMessages");
    kInVFEditSearchScopeAtom     = NS_NewAtom("inVFEditSearchScope");

    nsCOMPtr<nsIStringBundleService> sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &res);

    if (NS_SUCCEEDED(res) && sBundleService) 
      res = sBundleService->CreateBundle(MESSENGER_STRING_URL, getter_AddRefs(sMessengerStringBundle));

    if (NS_SUCCEEDED(res) && sMessengerStringBundle)
    {
      if (!NS_SUCCEEDED(sMessengerStringBundle->GetStringFromName(NS_LITERAL_STRING("kiloByteAbbreviation").get(), &kKiloByteString)))
        kKiloByteString = ToNewUnicode(NS_LITERAL_STRING("kiloByteAbbreviation"));

      if (!NS_SUCCEEDED(sMessengerStringBundle->GetStringFromName(NS_LITERAL_STRING("megaByteAbbreviation").get(), &kMegaByteString)))
        kMegaByteString = ToNewUnicode(NS_LITERAL_STRING("megaByteAbbreviation"));
    }
  }
  
  CreateLiterals(rdf);
  CreateArcsOutEnumerator();
}

Here is the call graph for this function:

Definition at line 252 of file nsMsgFolderDataSource.cpp.

{
  if (--gFolderResourceRefCnt == 0)
  {
    nsrefcnt refcnt;
    NS_RELEASE2(kNC_Child, refcnt);
    NS_RELEASE2(kNC_Folder, refcnt);
    NS_RELEASE2(kNC_Name, refcnt);
    NS_RELEASE2(kNC_Open, refcnt);
    NS_RELEASE2(kNC_FolderTreeName, refcnt);
    NS_RELEASE2(kNC_FolderTreeSimpleName, refcnt);
    NS_RELEASE2(kNC_NameSort, refcnt);
    NS_RELEASE2(kNC_FolderTreeNameSort, refcnt);
    NS_RELEASE2(kNC_SpecialFolder, refcnt);
    NS_RELEASE2(kNC_ServerType, refcnt);
    NS_RELEASE2(kNC_IsDeferred, refcnt);
    NS_RELEASE2(kNC_RedirectorType, refcnt);
    NS_RELEASE2(kNC_CanCreateFoldersOnServer, refcnt);
    NS_RELEASE2(kNC_CanFileMessagesOnServer, refcnt);
    NS_RELEASE2(kNC_IsServer, refcnt);
    NS_RELEASE2(kNC_IsSecure, refcnt);
    NS_RELEASE2(kNC_CanSubscribe, refcnt);
    NS_RELEASE2(kNC_SupportsOffline, refcnt);
    NS_RELEASE2(kNC_CanFileMessages, refcnt);
    NS_RELEASE2(kNC_CanCreateSubfolders, refcnt);
    NS_RELEASE2(kNC_CanRename, refcnt);
    NS_RELEASE2(kNC_CanCompact, refcnt);
    NS_RELEASE2(kNC_TotalMessages, refcnt);
    NS_RELEASE2(kNC_TotalUnreadMessages, refcnt);
    NS_RELEASE2(kNC_FolderSize, refcnt);
    NS_RELEASE2(kNC_Charset, refcnt);
    NS_RELEASE2(kNC_BiffState, refcnt);
    NS_RELEASE2(kNC_HasUnreadMessages, refcnt);
    NS_RELEASE2(kNC_NewMessages, refcnt);
    NS_RELEASE2(kNC_SubfoldersHaveUnreadMessages, refcnt);
    NS_RELEASE2(kNC_NoSelect, refcnt);
    NS_RELEASE2(kNC_VirtualFolder, refcnt);
    NS_RELEASE2(kNC_InVFEditSearchScope, refcnt);
    NS_RELEASE2(kNC_ImapShared, refcnt);
    NS_RELEASE2(kNC_Synchronize, refcnt);
    NS_RELEASE2(kNC_SyncDisabled, refcnt);
    NS_RELEASE2(kNC_CanSearchMessages, refcnt);
    
    NS_RELEASE2(kNC_Delete, refcnt);
    NS_RELEASE2(kNC_ReallyDelete, refcnt);
    NS_RELEASE2(kNC_NewFolder, refcnt);
    NS_RELEASE2(kNC_GetNewMessages, refcnt);
    NS_RELEASE2(kNC_Copy, refcnt);
    NS_RELEASE2(kNC_Move, refcnt);
    NS_RELEASE2(kNC_CopyFolder, refcnt);
    NS_RELEASE2(kNC_MoveFolder, refcnt);
    NS_RELEASE2(kNC_MarkAllMessagesRead, refcnt);
    NS_RELEASE2(kNC_Compact, refcnt);
    NS_RELEASE2(kNC_CompactAll, refcnt);
    NS_RELEASE2(kNC_Rename, refcnt);
    NS_RELEASE2(kNC_EmptyTrash, refcnt);
    NS_RELEASE2(kNC_DownloadFlagged, refcnt);
    NS_RELEASE2(kNC_UnreadFolders, refcnt);
    NS_RELEASE2(kNC_FavoriteFolders, refcnt);
    NS_RELEASE2(kNC_RecentFolders, refcnt);

    NS_RELEASE(kTotalMessagesAtom);
    NS_RELEASE(kTotalUnreadMessagesAtom);
    NS_RELEASE(kFolderSizeAtom);
    NS_RELEASE(kBiffStateAtom);
    NS_RELEASE(kNewMessagesAtom);
    NS_RELEASE(kNameAtom);
    NS_RELEASE(kSynchronizeAtom);
    NS_RELEASE(kOpenAtom);
    NS_RELEASE(kIsDeferredAtom);
    NS_RELEASE(kCanFileMessagesAtom);
    NS_RELEASE(kInVFEditSearchScopeAtom);

    nsMemory::Free(kKiloByteString);
    nsMemory::Free(kMegaByteString);
  }
}

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:

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:

Reimplemented from nsMsgRDFDataSource.

Reimplemented in nsMsgRecentFoldersDataSource, and nsMsgFlatFolderDataSource.

Definition at line 362 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
  if (!m_shuttingDown)
  {
    nsCOMPtr<nsIMsgMailSession> mailSession =
      do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
    
    if(NS_SUCCEEDED(rv))
      mailSession->RemoveFolderListener(this);
  }
  
  nsMsgRDFDataSource::Cleanup();
}

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:

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:

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:

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]

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:

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:

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:

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:

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:

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:

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:

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:

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]

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]

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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]

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:

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:

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:

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:

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]

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:

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:

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]

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]

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]

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]

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]

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]

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]

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]

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 nsMsgFolderDataSource::GetFolderDisplayName ( nsIMsgFolder folder,
PRUnichar **  folderName 
) [protected, virtual]

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 1136 of file nsMsgFolderDataSource.cpp.

{
  return folder->GetAbbreviatedName(folderName);
}

Here is the caller graph for this function:

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

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]

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]
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:

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:

Definition at line 461 of file nsMsgFolderDataSource.cpp.

{
  return NS_RDF_NO_VALUE;
}

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 425 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;

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

  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source));
  if (folder) 
  {
    rv = createFolderNode(folder, property, target);
#if 0
    nsXPIDLCString srcval;
    nsXPIDLCString propval;
    nsXPIDLCString targetval;
    source->GetValue(getter_Copies(srcval));
    property->GetValue(getter_Copies(propval));
    //    (*target)->GetValue(getter_Copies(targetval));

    printf("nsMsgFolderDataSource::GetTarget(%s, %s, %s, (%s))\n",
           (const char*)srcval,
           (const char*)propval, tv ? "TRUE" : "FALSE",
           (const char*)"");
#endif
    
  }
  else
    return NS_RDF_NO_VALUE;
  return rv;
}

Here is the call graph for this function:

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

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

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

Here is the caller graph for this function:

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 469 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv = NS_RDF_NO_VALUE;
  if(!targets)
    return NS_ERROR_NULL_POINTER;
  
#if 0
  nsXPIDLCString srcval;
  nsXPIDLCString propval;
  nsXPIDLCString targetval;
  source->GetValue(getter_Copies(srcval));
  property->GetValue(getter_Copies(propval));
  //    (*target)->GetValue(getter_Copies(targetval));
  
  printf("nsMsgFolderDataSource::GetTargets(%s, %s, %s, (%s))\n",
    (const char*)srcval,
    (const char*)propval, tv ? "TRUE" : "FALSE",
    (const char*)"");
#endif
  *targets = nsnull;
  
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  if (NS_SUCCEEDED(rv))
  {
    if ((kNC_Child == property))
    {
      nsCOMPtr<nsIEnumerator> subFolders;
      rv = folder->GetSubFolders(getter_AddRefs(subFolders));
      if(NS_SUCCEEDED(rv))
      {
        nsAdapterEnumerator* cursor =
          new nsAdapterEnumerator(subFolders);
        if (cursor == nsnull)
          return NS_ERROR_OUT_OF_MEMORY;
        NS_ADDREF(cursor);
        *targets = cursor;
        rv = NS_OK;
      }
    }
    else if ((kNC_Name == property) ||
      (kNC_Open == property) ||
      (kNC_FolderTreeName == property) ||
      (kNC_FolderTreeSimpleName == property) ||
      (kNC_SpecialFolder == 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_ServerType == property) ||
      (kNC_IsDeferred == property) ||
      (kNC_RedirectorType == property) ||
      (kNC_CanCreateFoldersOnServer == property) ||
      (kNC_CanFileMessagesOnServer == property) ||
      (kNC_NoSelect == property) ||
      (kNC_VirtualFolder == property) ||
      (kNC_InVFEditSearchScope == property) ||
      (kNC_ImapShared == property) ||
      (kNC_Synchronize == property) ||
      (kNC_SyncDisabled == property) ||
      (kNC_CanSearchMessages == property))
    {
      nsSingletonEnumerator* cursor =
        new nsSingletonEnumerator(property);
      if (cursor == nsnull)
        return NS_ERROR_OUT_OF_MEMORY;
      NS_ADDREF(cursor);
      *targets = cursor;
      rv = NS_OK;
    }
  }
  if(!*targets)
  {
    //create empty cursor
    rv = NS_NewEmptyEnumerator(targets);
  }
  
  return rv;
}

Here is the call graph for this function:

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

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

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

Here is the caller graph for this function:

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

Definition at line 439 of file nsMsgRDFDataSource.cpp.

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

Here is the call graph for this function:

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 408 of file nsMsgFolderDataSource.cpp.

{
  if ((*uri = nsCRT::strdup("rdf:mailnewsfolders")) == nsnull)
    return NS_ERROR_OUT_OF_MEMORY;
  else
    return NS_OK;
}
boolean nsIRDFDataSource::hasArcIn ( in nsIRDFNode  aNode,
in nsIRDFResource  aArc 
) [inherited]

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

Equivalent to enumerating ArcLabelsIn and comparing for the specified arc.

Definition at line 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.

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

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 579 of file nsMsgFolderDataSource.cpp.

{
  nsresult rv;
#if 0
  nsXPIDLCString sourceval;
  nsXPIDLCString propval;
  nsXPIDLCString targetval;
  source->GetValue(getter_Copies(sourceval));
  property->GetValue(getter_Copies(propval));
  /*  target->GetValue(getter_Copies(targetval)); */
  printf("HasAssertion(%s, %s, ??...)\n", (const char*)sourceval, (const char*)propval);
#endif
  
  nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
  if(NS_SUCCEEDED(rv))
    return DoFolderHasAssertion(folder, property, target, tv, hasAssertion);
  else
    *hasAssertion = PR_FALSE;
  return NS_OK;
}

Here is the call graph for this function:

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

Query whether an assertion exists in this graph.

Here is the caller graph for this function:

Definition at line 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]

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]

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]

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:

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 nsMsgRDFDataSource::NotifyPropertyChanged ( nsIRDFResource resource,
nsIRDFResource propertyResource,
nsIRDFNode newNode,
nsIRDFNode oldNode = nsnull 
) [protected, virtual, inherited]

Reimplemented in nsMsgRecentFoldersDataSource, and nsMsgUnreadFoldersDataSource.

Definition at line 367 of file nsMsgRDFDataSource.cpp.

{

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

}

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

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

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

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
nsresult nsMsgFolderDataSource::OnFolderSizePropertyChanged ( nsIRDFResource folderResource,
PRInt32  oldValue,
PRInt32  newValue 
) [protected]

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 nsMsgFolderDataSource::OnItemAddedOrRemoved ( nsIRDFResource parentItem,
nsISupports *  item,
PRBool  added 
) [protected, virtual]

Reimplemented in nsMsgFlatFolderDataSource.

Definition at line 917 of file nsMsgFolderDataSource.cpp.

{
  nsCOMPtr<nsIRDFNode> itemNode(do_QueryInterface(item));
  if (itemNode)
  {
    NotifyObservers(parentItem, kNC_Child, itemNode, nsnull, added, PR_FALSE);
  }
  return NS_OK;
}

Here is the call graph for this function:

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]

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]

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:

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:


Member Data Documentation

Definition at line 49 of file nsIFolderListener.idl.

Definition at line 69 of file nsIFolderListener.idl.

Definition at line 291 of file nsMsgFolderDataSource.h.

Definition at line 63 of file nsIFolderListener.idl.

Definition at line 285 of file nsMsgFolderDataSource.h.

Definition at line 292 of file nsMsgFolderDataSource.h.

Definition at line 279 of file nsMsgFolderDataSource.h.

Definition at line 295 of file nsMsgFolderDataSource.h.

Definition at line 284 of file nsMsgFolderDataSource.h.

Definition at line 293 of file nsMsgFolderDataSource.h.

Definition at line 290 of file nsMsgFolderDataSource.h.

Definition at line 297 of file nsMsgFolderDataSource.h.

Definition at line 298 of file nsMsgFolderDataSource.h.

Definition at line 287 of file nsMsgFolderDataSource.h.

Definition at line 248 of file nsMsgFolderDataSource.h.

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.

Definition at line 242 of file nsMsgFolderDataSource.h.

Definition at line 256 of file nsMsgFolderDataSource.h.

Definition at line 238 of file nsMsgFolderDataSource.h.

Definition at line 247 of file nsMsgFolderDataSource.h.

Definition at line 220 of file nsMsgFolderDataSource.h.

Definition at line 228 of file nsMsgFolderDataSource.h.

Definition at line 272 of file nsMsgFolderDataSource.h.

Definition at line 273 of file nsMsgFolderDataSource.h.

Definition at line 267 of file nsMsgFolderDataSource.h.

Definition at line 269 of file nsMsgFolderDataSource.h.

Definition at line 263 of file nsMsgFolderDataSource.h.

Definition at line 276 of file nsMsgFolderDataSource.h.

Definition at line 275 of file nsMsgFolderDataSource.h.

Definition at line 260 of file nsMsgFolderDataSource.h.

Definition at line 221 of file nsMsgFolderDataSource.h.

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.

Definition at line 253 of file nsMsgFolderDataSource.h.

Definition at line 258 of file nsMsgFolderDataSource.h.

Definition at line 232 of file nsMsgFolderDataSource.h.

Definition at line 237 of file nsMsgFolderDataSource.h.

Definition at line 236 of file nsMsgFolderDataSource.h.

Definition at line 271 of file nsMsgFolderDataSource.h.

Definition at line 268 of file nsMsgFolderDataSource.h.

Definition at line 270 of file nsMsgFolderDataSource.h.

Definition at line 229 of file nsMsgFolderDataSource.h.

Definition at line 222 of file nsMsgFolderDataSource.h.

Definition at line 226 of file nsMsgFolderDataSource.h.

Definition at line 265 of file nsMsgFolderDataSource.h.

Definition at line 250 of file nsMsgFolderDataSource.h.

Definition at line 252 of file nsMsgFolderDataSource.h.

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.

Definition at line 274 of file nsMsgFolderDataSource.h.

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.

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.

Definition at line 286 of file nsMsgFolderDataSource.h.

Definition at line 289 of file nsMsgFolderDataSource.h.

Definition at line 288 of file nsMsgFolderDataSource.h.

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 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: