Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsMsgOfflineImapOperation Class Reference

#include <nsMsgOfflineImapOperation.h>

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

List of all members.

Public Member Functions

 nsMsgOfflineImapOperation (nsMsgDatabase *db, nsIMdbRow *row)
 Instance Methods.
virtual ~nsMsgOfflineImapOperation ()
NS_DECL_ISUPPORTS
NS_DECL_NSIMSGOFFLINEIMAPOPERATION
nsIMdbRow
GetMDBRow ()
nsresult GetCopiesFromDB ()
nsresult SetCopiesToDB ()
void Log (PRLogModuleInfo *logFile)
void clearOperation (in nsOfflineImapOperationType operation)
void addKeywordToAdd (in string aKeyword)
void addKeywordToRemove (in string aKeyword)
void addMessageCopyOperation (in string destinationBox)
string getCopyDestination (in long copyIndex)

Public Attributes

const long kFlagsChanged = 0x1
const long kMsgMoved = 0x2
const long kMsgCopy = 0x4
const long kMoveResult = 0x8
const long kAppendDraft = 0x10
const long kAddedHeader = 0x20
const long kDeletedMsg = 0x40
const long kMsgMarkedDeleted = 0x80
const long kAppendTemplate = 0x100
const long kDeleteAllMsgs = 0x200
const long kAddKeywords = 0x400
const long kRemoveKeywords = 0x800
attribute
nsOfflineImapOperationType 
operation
attribute nsMsgKey messageKey
attribute imapMessageFlagsType flagOperation
attribute imapMessageFlagsType newFlags
attribute string destinationFolderURI
attribute string sourceFolderURI
readonly attribute string keywordsToAdd
readonly attribute string keywordsToRemove
readonly attribute long numberOfCopies
attribute unsigned long msgSize

Protected Member Functions

nsresult AddKeyword (const char *aKeyword, nsCString &addList, const char *addProp, nsCString &removeList, const char *removeProp)

Protected Attributes

nsOfflineImapOperationType m_operation
nsMsgKey m_messageKey
nsMsgKey m_sourceMessageKey
PRUint32 m_operationFlags
imapMessageFlagsType m_newFlags
nsXPIDLCString m_sourceFolder
nsXPIDLCString m_moveDestination
nsCStringArray m_copyDestinations
nsXPIDLCString m_keywordsToAdd
nsXPIDLCString m_keywordsToRemove
nsMsgDatabasem_mdb
nsCOMPtr< nsIMdbRowm_mdbRow

Detailed Description

Definition at line 45 of file nsMsgOfflineImapOperation.h.


Constructor & Destructor Documentation

Definition at line 86 of file nsMsgOfflineImapOperation.cpp.


Member Function Documentation

nsresult nsMsgOfflineImapOperation::AddKeyword ( const char *  aKeyword,
nsCString addList,
const char *  addProp,
nsCString removeList,
const char *  removeProp 
) [protected]

Definition at line 256 of file nsMsgOfflineImapOperation.cpp.

{
  nsACString::const_iterator start, end;
  if (!MsgFindKeyword(nsDependentCString(aKeyword), addList, start, end))
  {
    if (!addList.IsEmpty())
      addList.Append(' ');
    addList.Append(aKeyword);
  }
  // if the keyword we're removing was in the list of keywords to add,
  // cut it from that list.
  nsACString::const_iterator addStart, addEnd;
  if (MsgFindKeyword(nsDependentCString(aKeyword), removeList, addStart, addEnd))
  {
    nsACString::const_iterator saveStart;
    removeList.BeginReading(saveStart);
    removeList.Cut(Distance(saveStart, addStart), Distance(addStart, addEnd));
    m_mdb->SetProperty(m_mdbRow, removeProp, removeList.get());
  }
  SetOperation(kRemoveKeywords);
  return m_mdb->SetProperty(m_mdbRow, addProp, addList.get());
}

Here is the call graph for this function:

Definition at line 299 of file nsMsgOfflineImapOperation.cpp.

{
  nsXPIDLCString copyDests;
  m_copyDestinations.Clear();
  nsresult rv = m_mdb->GetProperty(m_mdbRow, PROP_COPY_DESTS, getter_Copies(copyDests));
  nsCAutoString copyDestsCString((const char *) copyDests);
  // use 0x1 as the delimiter between folder names since it's not a legal character
  if (NS_SUCCEEDED(rv) && !copyDestsCString.IsEmpty())
  {
    PRInt32 curCopyDestStart = 0;
    PRInt32 nextCopyDestPos = 0;

    while (nextCopyDestPos != -1)
    {
      nsCString curDest;
      nextCopyDestPos = copyDestsCString.FindChar(FOLDER_SEP_CHAR, curCopyDestStart);
      if (nextCopyDestPos > 0)
        copyDestsCString.Mid(curDest, curCopyDestStart, nextCopyDestPos - curCopyDestStart);
      else
        copyDestsCString.Mid(curDest, curCopyDestStart, copyDestsCString.Length() - curCopyDestStart);
      curCopyDestStart = nextCopyDestPos + 1;
      m_copyDestinations.AppendCString(curDest);
    }
  }
  return rv;
}

Here is the call graph for this function:

NS_DECL_ISUPPORTS NS_DECL_NSIMSGOFFLINEIMAPOPERATION nsIMdbRow* nsMsgOfflineImapOperation::GetMDBRow ( ) [inline]

Definition at line 55 of file nsMsgOfflineImapOperation.h.

{return m_mdbRow;}

Here is the caller graph for this function:

Definition at line 379 of file nsMsgOfflineImapOperation.cpp.

{
  if (!IMAPOffline)
    IMAPOffline = PR_NewLogModule("IMAPOFFLINE");
  if (!PR_LOG_TEST(IMAPOffline, PR_LOG_ALWAYS))
    return;
//  const long kMoveResult                = 0x8;
//  const long kAppendDraft        = 0x10;
//  const long kAddedHeader        = 0x20;
//  const long kDeletedMsg                = 0x40;
//  const long kMsgMarkedDeleted   = 0x80;
//  const long kAppendTemplate     = 0x100;
//  const long kDeleteAllMsgs             = 0x200;
  if (m_operation & nsIMsgOfflineImapOperation::kFlagsChanged)
  {
      PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x changeFlag:%x", m_messageKey, m_newFlags));
  }
  if (m_operation & nsIMsgOfflineImapOperation::kMsgMoved)
  {
    nsXPIDLCString moveDestFolder;
    GetDestinationFolderURI(getter_Copies(moveDestFolder));

    PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x moveTo:%s", m_messageKey, moveDestFolder.get()));
  }
  if (m_operation & nsIMsgOfflineImapOperation::kMsgCopy)
  {
    nsXPIDLCString copyDests;
    m_mdb->GetProperty(m_mdbRow, PROP_COPY_DESTS, getter_Copies(copyDests));

    PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x moveTo:%s", m_messageKey, copyDests.get()));
  }
  if (m_operation & nsIMsgOfflineImapOperation::kAppendDraft)
  {
    PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x append draft", m_messageKey));
  }
  if (m_operation & nsIMsgOfflineImapOperation::kAddKeywords)
  {
    PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x add keyword:%s", m_messageKey, m_keywordsToAdd.get()));
  }
  if (m_operation & nsIMsgOfflineImapOperation::kRemoveKeywords)
  {
    PR_LOG(IMAPOffline, PR_LOG_ALWAYS, ("msg id %x remove keyword:%s", m_messageKey, m_keywordsToRemove.get()));
  }

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 326 of file nsMsgOfflineImapOperation.cpp.

{
  nsCAutoString copyDests;

  // use 0x1 as the delimiter between folders
  for (PRInt32 i = 0; i < m_copyDestinations.Count(); i++)
  {
    if (i > 0)
      copyDests.Append(FOLDER_SEP_CHAR);
    nsCString *curDest = m_copyDestinations.CStringAt(i);
    copyDests.Append(curDest->get());
  }
  return m_mdb->SetProperty(m_mdbRow, PROP_COPY_DESTS, copyDests.get());
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 69 of file nsIMsgOfflineImapOperation.idl.

Definition at line 67 of file nsIMsgOfflineImapOperation.idl.

Definition at line 56 of file nsIMsgOfflineImapOperation.idl.

Definition at line 61 of file nsIMsgOfflineImapOperation.idl.

Definition at line 55 of file nsIMsgOfflineImapOperation.idl.

Definition at line 59 of file nsIMsgOfflineImapOperation.idl.

Definition at line 60 of file nsIMsgOfflineImapOperation.idl.

Definition at line 57 of file nsIMsgOfflineImapOperation.idl.

Definition at line 73 of file nsIMsgOfflineImapOperation.idl.

Definition at line 74 of file nsIMsgOfflineImapOperation.idl.

Definition at line 51 of file nsIMsgOfflineImapOperation.idl.

Definition at line 54 of file nsIMsgOfflineImapOperation.idl.

Definition at line 53 of file nsIMsgOfflineImapOperation.idl.

Definition at line 58 of file nsIMsgOfflineImapOperation.idl.

Definition at line 52 of file nsIMsgOfflineImapOperation.idl.

Definition at line 62 of file nsIMsgOfflineImapOperation.idl.

Definition at line 73 of file nsMsgOfflineImapOperation.h.

Definition at line 75 of file nsMsgOfflineImapOperation.h.

Definition at line 76 of file nsMsgOfflineImapOperation.h.

Definition at line 81 of file nsMsgOfflineImapOperation.h.

Definition at line 82 of file nsMsgOfflineImapOperation.h.

Definition at line 64 of file nsMsgOfflineImapOperation.h.

Definition at line 72 of file nsMsgOfflineImapOperation.h.

Definition at line 67 of file nsMsgOfflineImapOperation.h.

Definition at line 63 of file nsMsgOfflineImapOperation.h.

Definition at line 66 of file nsMsgOfflineImapOperation.h.

Definition at line 71 of file nsMsgOfflineImapOperation.h.

Definition at line 65 of file nsMsgOfflineImapOperation.h.

Definition at line 66 of file nsIMsgOfflineImapOperation.idl.

Definition at line 78 of file nsIMsgOfflineImapOperation.idl.

Definition at line 68 of file nsIMsgOfflineImapOperation.idl.

Definition at line 75 of file nsIMsgOfflineImapOperation.idl.

Definition at line 64 of file nsIMsgOfflineImapOperation.idl.

Definition at line 70 of file nsIMsgOfflineImapOperation.idl.


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