author Mike Kaganski <>
Thu, 17 Jan 2019 21:31:00 +0100
changeset 34238 41d0ee56c665c79059bbf337174babbd4d0ae3d1
parent 34237 aaf39a9bd368a7fec19e61ccfadb5179d7fb90e8
child 33952 18b2c9cbcf7c3adc5c1e2c89e401363987c92174
permissions -rw-r--r--
Bug 1521007 - Support UTF-8 encoded MAPI data to avoid broken document names when sending documents from MS Word. r=jorgk

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

#ifndef MSG_MAPI_HOOK_H_
#define MSG_MAPI_HOOK_H_

#include "prtypes.h"

class nsMapiHook
    public :

        static bool DisplayLoginDialog(bool aLogin, char16_t **aUsername,
                        char16_t **aPassword);
        static bool VerifyUserName(const nsString& aUsername, nsCString& aIdKey);

        static bool IsBlindSendAllowed () ;
        static nsresult BlindSendMail (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
        static nsresult ShowComposerWindow (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
        static nsresult PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
                                        nsIMsgCompFields * aCompFields) ;
        static nsresult PopulateCompFieldsW(lpnsMapiMessageW aMessage, nsIMsgCompFields *aCompFields);
        static nsresult PopulateCompFieldsForSendDocs(nsIMsgCompFields * aCompFields,
                                        ULONG aFlags, LPTSTR aDelimChar, LPTSTR aFilePaths) ;
        static nsresult HandleAttachments(nsIMsgCompFields *aCompFields, int32_t aFileCount,
                                          lpnsMapiFileDesc aFiles, bool bUTF8);
        static nsresult HandleAttachmentsW(nsIMsgCompFields *aCompFields, int32_t aFileCount,
                                           lpnsMapiFileDescW aFiles);
        static void CleanUp();

        static bool isMapiService;

#endif  // MSG_MAPI_HOOK_H_