nsIPlatformCharset.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsIPlatformCharset_h__
  6. #define nsIPlatformCharset_h__
  7. #include "nsStringGlue.h"
  8. #include "nsISupports.h"
  9. // Interface ID for our nsIPlatformCharset interface
  10. /* 778859d5-fc01-4f4b-bfaa-3c0d1b6c81d6 */
  11. #define NS_IPLATFORMCHARSET_IID \
  12. { 0x778859d5, \
  13. 0xfc01, \
  14. 0x4f4b, \
  15. {0xbf, 0xaa, 0x3c, 0x0d, 0x1b, 0x6c, 0x81, 0xd6} }
  16. #define NS_PLATFORMCHARSET_CID \
  17. { 0x84b0f182, 0xc6c7, 0x11d2, {0xb3, 0xb0, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }}
  18. #define NS_PLATFORMCHARSET_CONTRACTID "@mozilla.org/intl/platformcharset;1"
  19. typedef enum {
  20. kPlatformCharsetSel_PlainTextInClipboard = 0,
  21. kPlatformCharsetSel_FileName = 1,
  22. kPlatformCharsetSel_Menu = 2,
  23. kPlatformCharsetSel_4xBookmarkFile = 3,
  24. kPlatformCharsetSel_KeyboardInput = 4,
  25. kPlatformCharsetSel_WindowManager = 5,
  26. kPlatformCharsetSel_4xPrefsJS = 6,
  27. kPlatformCharsetSel_PlainTextInFile = 7
  28. } nsPlatformCharsetSel;
  29. /**
  30. * DO NOT ADD NEW USES OF THIS INTERFACE!
  31. * Removal is https://bugzilla.mozilla.org/show_bug.cgi?id=943272
  32. *
  33. * Instead, use UTF-16 APIs on Windows and UTF-8 APIs everywhere else.
  34. * Assume plain text files are UTF-8.
  35. */
  36. class nsIPlatformCharset : public nsISupports
  37. {
  38. public:
  39. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLATFORMCHARSET_IID)
  40. NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult) = 0;
  41. NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult) = 0;
  42. };
  43. NS_DEFINE_STATIC_IID_ACCESSOR(nsIPlatformCharset, NS_IPLATFORMCHARSET_IID)
  44. #endif /* nsIPlatformCharset_h__ */