Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
VirtualFolderChangeListener Class Reference
Inheritance diagram for VirtualFolderChangeListener:
Inheritance graph
[legend]
Collaboration diagram for VirtualFolderChangeListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VirtualFolderChangeListener ()
 ~VirtualFolderChangeListener ()
NS_DECL_ISUPPORTS
NS_DECL_NSIDBCHANGELISTENER
nsresult 
Init ()
void onHdrChange (in nsIMsgDBHdr aHdrChanged, in unsigned long aOldFlags, in unsigned long aNewFlags, in nsIDBChangeListener aInstigator)
void onHdrDeleted (in nsIMsgDBHdr aHdrChanged, in nsMsgKey aParentKey, in long aFlags, in nsIDBChangeListener aInstigator)
void onHdrAdded (in nsIMsgDBHdr aHdrChanged, in nsMsgKey aParentKey, in long aFlags, in nsIDBChangeListener aInstigator)
void onParentChanged (in nsMsgKey aKeyChanged, in nsMsgKey oldParent, in nsMsgKey newParent, in nsIDBChangeListener aInstigator)
void onAnnouncerGoingAway (in nsIDBChangeAnnouncer instigator)
void onReadChanged (in nsIDBChangeListener aInstigator)
void onJunkScoreChanged (in nsIDBChangeListener aInstigator)

Public Attributes

nsCOMPtr< nsIMsgFolderm_virtualFolder
nsCOMPtr< nsIMsgFolderm_folderWatching
nsCOMPtr< nsISupportsArraym_searchTerms
nsCOMPtr< nsIMsgSearchSessionm_searchSession
PRBool m_searchOnMsgStatus

Detailed Description

Definition at line 2614 of file nsMsgAccountManager.cpp.


Constructor & Destructor Documentation

Definition at line 2634 of file nsMsgAccountManager.cpp.

Definition at line 2618 of file nsMsgAccountManager.cpp.

{};

Member Function Documentation

Definition at line 2638 of file nsMsgAccountManager.cpp.

{
  nsCOMPtr <nsIMsgDatabase> msgDB;
  nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;

  nsresult rv = m_virtualFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(msgDB));
  if (NS_SUCCEEDED(rv) && msgDB)
  {
    nsXPIDLCString searchTermString;
    dbFolderInfo->GetCharPtrProperty("searchStr", getter_Copies(searchTermString));
    nsCOMPtr<nsIMsgFilterService> filterService = do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv);
    nsCOMPtr<nsIMsgFilterList> filterList;
    rv = filterService->GetTempFilterList(m_virtualFolder, getter_AddRefs(filterList));
    NS_ENSURE_SUCCESS(rv, rv);
    nsCOMPtr <nsIMsgFilter> tempFilter;
    filterList->CreateFilter(NS_LITERAL_STRING("temp").get(), getter_AddRefs(tempFilter));
    NS_ENSURE_SUCCESS(rv, rv);
    filterList->ParseCondition(tempFilter, searchTermString);
    NS_ENSURE_SUCCESS(rv, rv);
    m_searchSession = do_CreateInstance(NS_MSGSEARCHSESSION_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsISupportsArray> searchTerms;
    rv = tempFilter->GetSearchTerms(getter_AddRefs(searchTerms));
    NS_ENSURE_SUCCESS(rv, rv);

    // we add the search scope right before we match the header,
    // because we don't want the search scope caching the body input
    // stream, because that holds onto the mailbox file, breaking
    // compaction.

    // add each item in termsArray to the search session
    PRUint32 numTerms;
    searchTerms->Count(&numTerms);
    for (PRUint32 i = 0; i < numTerms; i++)
    {
      nsCOMPtr <nsIMsgSearchTerm> searchTerm (do_QueryElementAt(searchTerms, i));
      nsMsgSearchAttribValue attrib;
      searchTerm->GetAttrib(&attrib);
      if (attrib == nsMsgSearchAttrib::MsgStatus)
        m_searchOnMsgStatus = true;
      m_searchSession->AppendTerm(searchTerm);
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDBChangeListener::onHdrAdded ( in nsIMsgDBHdr  aHdrChanged,
in nsMsgKey  aParentKey,
in long  aFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onHdrChange ( in nsIMsgDBHdr  aHdrChanged,
in unsigned long  aOldFlags,
in unsigned long  aNewFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onHdrDeleted ( in nsIMsgDBHdr  aHdrChanged,
in nsMsgKey  aParentKey,
in long  aFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onParentChanged ( in nsMsgKey  aKeyChanged,
in nsMsgKey  oldParent,
in nsMsgKey  newParent,
in nsIDBChangeListener  aInstigator 
) [inherited]

Member Data Documentation

Definition at line 2626 of file nsMsgAccountManager.cpp.

Definition at line 2629 of file nsMsgAccountManager.cpp.

Definition at line 2628 of file nsMsgAccountManager.cpp.

Definition at line 2627 of file nsMsgAccountManager.cpp.

Definition at line 2625 of file nsMsgAccountManager.cpp.


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