mailnews/import/outlook/src/MapiMimeTypes.h
author Mark Banner <standard8@mozilla.com>
Mon, 28 Apr 2014 20:30:10 +0100
changeset 19701 ebcaac24ae6e0ba51d0e5da49bf823ca0b3822f1
parent 13324 3f9b812e72471c2172bfde0ebbeeb210bf5f1a95
child 34316 9d2f71d5e74d14a10a5432b7a17fe6949964ca90
permissions -rw-r--r--
Added tag BETA_BASE_20140428 for changeset ffacfc0539ea a=betamerge DONTBUILD CLOSED TREE

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 http://mozilla.org/MPL/2.0/. */

#ifndef MapiMimeTypes_h___
#define MapiMimeTypes_h___

#include <windows.h>

#define kMaxMimeTypeSize  256

class CMimeTypes {
public:

static uint8_t *  GetMimeType(const nsCString& theExt);
static uint8_t *  GetMimeType(const nsString& theExt);

protected:
  // Registry stuff
static BOOL  GetKey(HKEY root, LPCTSTR pName, PHKEY pKey);
static BOOL  GetValueBytes(HKEY rootKey, LPCTSTR pValName, LPBYTE *ppBytes);
static void  ReleaseValueBytes(LPBYTE pBytes);
static BOOL  GetMimeTypeFromReg(const nsCString& ext, LPBYTE *ppBytes);


static uint8_t          m_mimeBuffer[kMaxMimeTypeSize];
};

#endif /* MapiMimeTypes_h__ */