michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // make sure to include all the required file headers michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIObserver; michael@0: michael@0: /** michael@0: * nsIKeygenThread michael@0: * This is used to communicate with the thread generating a key pair, michael@0: * to be used by the dialog displaying status information. michael@0: */ michael@0: [scriptable, uuid(8712a243-5539-447c-9f47-8653f40c3a09)] michael@0: interface nsIKeygenThread : nsISupports michael@0: { michael@0: /** michael@0: * startKeyGeneration - run the thread michael@0: * A user interface using this interface needs to michael@0: * call this method as soon as the status information michael@0: * is displaying. This will trigger key generation. michael@0: * To allow the closure of the status information, michael@0: * the thread needs a handle to an observer. michael@0: * michael@0: * observer will be called on the UI thread. michael@0: * When the key generation is done, the observe method will michael@0: * be called with a topic of "keygen-finished" and null data michael@0: * and subject. michael@0: */ michael@0: void startKeyGeneration(in nsIObserver observer); michael@0: michael@0: /** michael@0: * userCanceled - notify the thread michael@0: * If the user canceled, the thread is no longer allowed to michael@0: * close the dialog. However, if the thread already closed michael@0: * it, we are not allowed to close it. michael@0: */ michael@0: void userCanceled(out boolean threadAlreadyClosedDialog); michael@0: }; michael@0: michael@0: %{ C++ michael@0: // {195763b8-1dd2-11b2-a843-eb44e44aaa37} michael@0: #define NS_KEYGENTHREAD_CID \ michael@0: { 0x195763b8, 0x1dd2, 0x11b2, { 0xa8, 0x43, 0xeb, 0x44, 0xe4, 0x4a, 0xaa, 0x37 } } michael@0: #define NS_KEYGENTHREAD_CONTRACTID "@mozilla.org/security/keygenthread;1" michael@0: %}