nsIKeygenThread.idl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. // make sure to include all the required file headers
  5. #include "nsISupports.idl"
  6. interface nsIObserver;
  7. /**
  8. * nsIKeygenThread
  9. * This is used to communicate with the thread generating a key pair,
  10. * to be used by the dialog displaying status information.
  11. */
  12. [scriptable, uuid(8712a243-5539-447c-9f47-8653f40c3a09)]
  13. interface nsIKeygenThread : nsISupports
  14. {
  15. /**
  16. * startKeyGeneration - run the thread
  17. * A user interface using this interface needs to
  18. * call this method as soon as the status information
  19. * is displaying. This will trigger key generation.
  20. * To allow the closure of the status information,
  21. * the thread needs a handle to an observer.
  22. *
  23. * observer will be called on the UI thread.
  24. * When the key generation is done, the observe method will
  25. * be called with a topic of "keygen-finished" and null data
  26. * and subject.
  27. */
  28. void startKeyGeneration(in nsIObserver observer);
  29. /**
  30. * userCanceled - notify the thread
  31. * If the user canceled, the thread is no longer allowed to
  32. * close the dialog. However, if the thread already closed
  33. * it, we are not allowed to close it.
  34. */
  35. void userCanceled(out boolean threadAlreadyClosedDialog);
  36. };
  37. %{ C++
  38. // {195763b8-1dd2-11b2-a843-eb44e44aaa37}
  39. #define NS_KEYGENTHREAD_CID \
  40. { 0x195763b8, 0x1dd2, 0x11b2, { 0xa8, 0x43, 0xeb, 0x44, 0xe4, 0x4a, 0xaa, 0x37 } }
  41. #define NS_KEYGENTHREAD_CONTRACTID "@mozilla.org/security/keygenthread;1"
  42. %}