nsIPrintSettingsWin.idl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  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. #include "nsISupports.idl"
  6. %{ C++
  7. #include "windows.h"
  8. %}
  9. /**
  10. * Native types
  11. */
  12. [ptr] native nsDevMode(DEVMODEW);
  13. native nsHdc(HDC);
  14. /**
  15. * Simplified PrintSettings for Windows interface
  16. */
  17. [scriptable, uuid(c63eed41-6ac5-459e-8a64-033eb9ad770a)]
  18. interface nsIPrintSettingsWin : nsISupports
  19. {
  20. /**
  21. * Data Members
  22. *
  23. * Each of these data members make a copy
  24. * of the contents. If you get the value,
  25. * you own the memory.
  26. *
  27. * The following three pieces of data are needed
  28. * to create a DC for printing. These are typcially
  29. * gotten via the PrintDLG call ro can be obtained
  30. * via the "m_pd" data member of the CPrintDialog
  31. * in MFC.
  32. */
  33. [noscript] attribute wstring deviceName;
  34. [noscript] attribute wstring driverName;
  35. [noscript] attribute nsDevMode devMode;
  36. /**
  37. * On Windows we use the printable width and height for the printing surface.
  38. * We don't want to have to create native print device contexts in the content
  39. * process, so we need to store these in the settings.
  40. * Storing in Inches is most convenient as they are retrieved from the device
  41. * using fields which are in pixels and pixels per inch.
  42. * Note these are stored in portrait format to ensure that we can take account
  43. * of our own changes to the orientation print setting.
  44. */
  45. [noscript] attribute double printableWidthInInches;
  46. [noscript] attribute double printableHeightInInches;
  47. /**
  48. * Copy relevant print settings from native Windows device.
  49. *
  50. * @param hdc HDC to copy from
  51. * @param devMode DEVMODE to copy from
  52. */
  53. [notxpcom] void copyFromNative(in nsHdc hdc, in nsDevMode devMode);
  54. /**
  55. * Copy relevant print settings to native windows structures.
  56. *
  57. * @param devMode DEVMODE to be populated.
  58. */
  59. [notxpcom] void copyToNative(in nsDevMode devMode);
  60. };