aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/GtkNSSKeyPairDialogs.cpp
blob: ed987b105d0f68946c6f828cf6ad87acfbc69725 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
/*
 *  GtkNSSKeyPairDialogs.cpp
 *
 *  Copyright (C) 2003 Crispin Flowerday <gnome@flowerday.cx>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  $Id$
 */

/*
 * This file provides Gtk implementations of the mozilla Generating Key Pair
 * dialogs.
 *
 * This implementation takes some liberties with the mozilla API. Although the
 * API requires a nsIDomWindowInternal, it only actually calls the Close()
 * function on that class. Therefore we provide a dummy class that only 
 * implements that function (it just sets a flag). 
 *
 * Periodically we check to see whether the dialog should have been closed. If
 * it should be closed, then the key generation has finished, so close the dialog
 * (using gtk_dialog_response), and return.
 *
 */

#include "mozilla-config.h"

#include "config.h"

#include "EphyUtils.h"

#include <nsIServiceManager.h>
#include <nsIInterfaceRequestor.h>
#include <nsIInterfaceRequestorUtils.h>
#include <nsIKeygenThread.h>

#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
#include <nsIObserver.h>
#else /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
#include <nsIDOMWindow.h>
#ifdef ALLOW_PRIVATE_API
#include "nsIDOMWindowInternal.h"
#endif /* ALLOW_PRIVATE_API */
#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */

#include <gtk/gtkdialog.h>
#include <gtk/gtkprogressbar.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkstock.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkmain.h>
#include <glib/gi18n.h>

#include "GtkNSSKeyPairDialogs.h"
#include "ephy-gui.h"
#include "ephy-debug.h"

GtkNSSKeyPairDialogs::GtkNSSKeyPairDialogs ()
{
    LOG ("GtkNSSKeyPairDialogs ctor (%p)", this)
}

GtkNSSKeyPairDialogs::~GtkNSSKeyPairDialogs ()
{
    LOG ("GtkNSSKeyPairDialogs dtor (%p)", this)
}

NS_IMPL_ISUPPORTS1 (GtkNSSKeyPairDialogs, 
            nsIGeneratingKeypairInfoDialogs)

#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER

class KeyPairObserver : public nsIObserver
{
public:
       NS_DECL_NSIOBSERVER
       NS_DECL_ISUPPORTS

       KeyPairObserver() : close_called (FALSE) {};
       virtual ~KeyPairObserver() {};

       gboolean close_called;
};

NS_IMPL_ISUPPORTS1 (KeyPairObserver, nsIObserver);

NS_IMETHODIMP KeyPairObserver::Observe (nsISupports *aSubject, const char *aTopic,
                                       const PRUnichar *aData)
{
       close_called = TRUE;
       return NS_OK;
}

#else /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */

/* ------------------------------------------------------------
 * A dummy implementation of nsIDomWindowInternal so that
 * we can use the correctly get callbacks from the
 * nsIKeygenThread */
class KeyPairHelperWindow : public nsIDOMWindowInternal
{
public:
    NS_DECL_ISUPPORTS
    NS_DECL_NSIDOMWINDOWINTERNAL
    NS_DECL_NSIDOMWINDOW
    NS_DECL_NSIDOMWINDOW2

    KeyPairHelperWindow();
    virtual ~KeyPairHelperWindow();

    gboolean close_called;
};

NS_IMPL_ISUPPORTS3(KeyPairHelperWindow, nsIDOMWindowInternal, nsIDOMWindow, nsIDOMWindow2)

KeyPairHelperWindow::KeyPairHelperWindow()
{
    close_called = FALSE;
}

NS_IMETHODIMP KeyPairHelperWindow::Close()
{
    /* This is called in a different thread, so just set a flag, dont
     * call the dialog_response directly */
    close_called = TRUE;
    return NS_OK;
}

#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */

/* ------------------------------------------------------------ */
static void
begin_busy (GtkWidget *widget)
{
    static GdkCursor *cursor = NULL;

    if (cursor == NULL) cursor = gdk_cursor_new (GDK_WATCH);

    if (!GTK_WIDGET_REALIZED (widget)) gtk_widget_realize (GTK_WIDGET(widget));

    gdk_window_set_cursor (GTK_WIDGET (widget)->window, cursor);
    while (gtk_events_pending ()) gtk_main_iteration ();
}

static void
end_busy (GtkWidget *widget)
{
    gdk_window_set_cursor (GTK_WIDGET(widget)->window, NULL);
}


struct KeyPairInfo
{
    GtkWidget *progress;
    GtkWidget *dialog;
#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
    KeyPairObserver *helper;
#else
    KeyPairHelperWindow *helper;
#endif /* HAVE_NSIKEYGENTHREAD_NSIOBSERVER */
};


static gboolean
generating_timeout_cb (KeyPairInfo *info)
{
    gtk_progress_bar_pulse (GTK_PROGRESS_BAR (info->progress));

    if (info->helper->close_called)
    {
        gtk_dialog_response (GTK_DIALOG (info->dialog), GTK_RESPONSE_OK);
    }
    return TRUE;
}


/* void displayGeneratingKeypairInfo (in nsIInterfaceRequestor ctx, in nsIKeygenTh
read runnable); */
NS_IMETHODIMP
GtkNSSKeyPairDialogs::DisplayGeneratingKeypairInfo (nsIInterfaceRequestor *ctx,
                            nsIKeygenThread *runnable)
{
    GtkWidget *dialog, *progress, *label, *vbox;
    gint timeout_id;


    nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
    GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));

    dialog = gtk_dialog_new_with_buttons ("", gparent,
                          GTK_DIALOG_DESTROY_WITH_PARENT, NULL);

    if (gparent)
    {
        gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
                         GTK_WINDOW (dialog));
    }

    gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");

    gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
    gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
    gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);

    vbox = gtk_vbox_new (FALSE, 12);
    gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
    gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, TRUE, TRUE, 0);

    label = gtk_label_new (NULL);
    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
    gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
    
    char *msg = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
                     _("Generating Private Key."),
                     _("Please wait while a new private key is "
                       "generated. This process could take a few minutes." ));
    gtk_label_set_markup (GTK_LABEL(label), msg);
    g_free (msg);

    progress = gtk_progress_bar_new ();
    gtk_box_pack_start (GTK_BOX (vbox), progress, TRUE, TRUE, 0);

    /* Create a helper class that just waits for close events
     * from the other thread */
#ifdef HAVE_NSIKEYGENTHREAD_NSIOBSERVER
       nsCOMPtr<KeyPairObserver> helper = new KeyPairObserver;
#else
    nsCOMPtr<KeyPairHelperWindow> helper = new KeyPairHelperWindow;
#endif

    KeyPairInfo callback_data = { progress, dialog, helper };
    timeout_id = g_timeout_add (100, (GSourceFunc)generating_timeout_cb, &callback_data);

    gtk_widget_show_all (dialog);
    gtk_widget_hide (GTK_DIALOG (dialog)->action_area);

    begin_busy (dialog);
    runnable->StartKeyGeneration (helper);
    int res = gtk_dialog_run (GTK_DIALOG (dialog));
    if (res != GTK_RESPONSE_OK && helper->close_called == FALSE)
    {
        /* Ignore the already_closed flag, our nsIDOMWindowInterna::Close
         * function just sets a flag, it doesn't close the window, so we
         * dont have a race condition */
        PRBool already_closed = FALSE;
        runnable->UserCanceled (&already_closed);
    }

    g_source_remove (timeout_id);
    end_busy (dialog);
    gtk_widget_destroy (dialog);
    return NS_OK;
}

#ifndef HAVE_NSIKEYGENTHREAD_NSIOBSERVER

/*************************************************************
 * Misc functions for the nsIDomWindowInternal implementation
 * that arn't needed for our purposes
 *************************************************************/

#define MOZ_NOT_IMPLEMENTED { g_warning ("not implemented: %s", G_STRLOC); \
                              return NS_ERROR_NOT_IMPLEMENTED; }

KeyPairHelperWindow::~KeyPairHelperWindow()
{
}

/* readonly attribute nsIDOMWindowInternal window; */
NS_IMETHODIMP KeyPairHelperWindow::GetWindow(nsIDOMWindowInternal * *aWindow)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMWindowInternal self; */
NS_IMETHODIMP KeyPairHelperWindow::GetSelf(nsIDOMWindowInternal * *aSelf)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMNavigator navigator; */
NS_IMETHODIMP KeyPairHelperWindow::GetNavigator(nsIDOMNavigator * *aNavigator)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMScreen screen; */
NS_IMETHODIMP KeyPairHelperWindow::GetScreen(nsIDOMScreen * *aScreen)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMHistory history; */
NS_IMETHODIMP KeyPairHelperWindow::GetHistory(nsIDOMHistory * *aHistory)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMWindow content; */
NS_IMETHODIMP KeyPairHelperWindow::GetContent(nsIDOMWindow * *aContent)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] readonly attribute nsIPrompt prompter; */
NS_IMETHODIMP KeyPairHelperWindow::GetPrompter(nsIPrompt * *aPrompter)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp menubar; */
NS_IMETHODIMP KeyPairHelperWindow::GetMenubar(nsIDOMBarProp * *aMenubar)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp toolbar; */
NS_IMETHODIMP KeyPairHelperWindow::GetToolbar(nsIDOMBarProp * *aToolbar)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp locationbar; */
NS_IMETHODIMP KeyPairHelperWindow::GetLocationbar(nsIDOMBarProp * *aLocationbar)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp personalbar; */
NS_IMETHODIMP KeyPairHelperWindow::GetPersonalbar(nsIDOMBarProp * *aPersonalbar)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp statusbar; */
NS_IMETHODIMP KeyPairHelperWindow::GetStatusbar(nsIDOMBarProp * *aStatusbar)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp directories; */
NS_IMETHODIMP KeyPairHelperWindow::GetDirectories(nsIDOMBarProp * *aDirectories)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute boolean closed; */
NS_IMETHODIMP KeyPairHelperWindow::GetClosed(PRBool *aClosed)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMCrypto crypto; */
NS_IMETHODIMP KeyPairHelperWindow::GetCrypto(nsIDOMCrypto * *aCrypto)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMPkcs11 pkcs11; */
NS_IMETHODIMP KeyPairHelperWindow::GetPkcs11(nsIDOMPkcs11 * *aPkcs11)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIControllers controllers; */
NS_IMETHODIMP KeyPairHelperWindow::GetControllers(nsIControllers * *aControllers)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute nsIDOMWindowInternal opener; */
NS_IMETHODIMP KeyPairHelperWindow::GetOpener(nsIDOMWindowInternal * *aOpener)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetOpener(nsIDOMWindowInternal * aOpener)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute DOMString status; */
NS_IMETHODIMP KeyPairHelperWindow::GetStatus(nsAString & aStatus)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetStatus(const nsAString & aStatus)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute DOMString defaultStatus; */
NS_IMETHODIMP KeyPairHelperWindow::GetDefaultStatus(nsAString & aDefaultStatus)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetDefaultStatus(const nsAString & aDefaultStatus)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMLocation location; */
NS_IMETHODIMP KeyPairHelperWindow::GetLocation(nsIDOMLocation * *aLocation)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long innerWidth; */
NS_IMETHODIMP KeyPairHelperWindow::GetInnerWidth(PRInt32 *aInnerWidth)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetInnerWidth(PRInt32 aInnerWidth)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long innerHeight; */
NS_IMETHODIMP KeyPairHelperWindow::GetInnerHeight(PRInt32 *aInnerHeight)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetInnerHeight(PRInt32 aInnerHeight)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long outerWidth; */
NS_IMETHODIMP KeyPairHelperWindow::GetOuterWidth(PRInt32 *aOuterWidth)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetOuterWidth(PRInt32 aOuterWidth)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long outerHeight; */
NS_IMETHODIMP KeyPairHelperWindow::GetOuterHeight(PRInt32 *aOuterHeight)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetOuterHeight(PRInt32 aOuterHeight)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long screenX; */
NS_IMETHODIMP KeyPairHelperWindow::GetScreenX(PRInt32 *aScreenX)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetScreenX(PRInt32 aScreenX)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute long screenY; */
NS_IMETHODIMP KeyPairHelperWindow::GetScreenY(PRInt32 *aScreenY)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetScreenY(PRInt32 aScreenY)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long pageXOffset; */
NS_IMETHODIMP KeyPairHelperWindow::GetPageXOffset(PRInt32 *aPageXOffset)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long pageYOffset; */
NS_IMETHODIMP KeyPairHelperWindow::GetPageYOffset(PRInt32 *aPageYOffset)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long scrollMaxX; */
NS_IMETHODIMP KeyPairHelperWindow::GetScrollMaxX(PRInt32 *aScrollMaxX)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long scrollMaxY; */
NS_IMETHODIMP KeyPairHelperWindow::GetScrollMaxY(PRInt32 *aScrollMaxY)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute unsigned long length; */
NS_IMETHODIMP KeyPairHelperWindow::GetLength(PRUint32 *aLength)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute boolean fullScreen; */
NS_IMETHODIMP KeyPairHelperWindow::GetFullScreen(PRBool *aFullScreen)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetFullScreen(PRBool aFullScreen)
{
    MOZ_NOT_IMPLEMENTED
}

/* void alert (in DOMString text); */
NS_IMETHODIMP KeyPairHelperWindow::Alert(const nsAString & text)
{
    MOZ_NOT_IMPLEMENTED
}

/* boolean confirm (in DOMString text); */
NS_IMETHODIMP KeyPairHelperWindow::Confirm(const nsAString & text, PRBool *_retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* DOMString prompt (in DOMString aMessage, in DOMString aInitial, in DOMString aTitle, in unsigned long aSavePassword); */
NS_IMETHODIMP KeyPairHelperWindow::Prompt(const nsAString & aMessage, const nsAString & aInitial, const nsAString & aTitle, PRUint32 aSavePassword, nsAString & _retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* void focus (); */
NS_IMETHODIMP KeyPairHelperWindow::Focus()
{
    MOZ_NOT_IMPLEMENTED
}

/* void blur (); */
NS_IMETHODIMP KeyPairHelperWindow::Blur()
{
    MOZ_NOT_IMPLEMENTED
}

/* void back (); */
NS_IMETHODIMP KeyPairHelperWindow::Back()
{
    MOZ_NOT_IMPLEMENTED
}

/* void forward (); */
NS_IMETHODIMP KeyPairHelperWindow::Forward()
{
    MOZ_NOT_IMPLEMENTED
}

/* void home (); */
NS_IMETHODIMP KeyPairHelperWindow::Home()
{
    MOZ_NOT_IMPLEMENTED
}

/* void stop (); */
NS_IMETHODIMP KeyPairHelperWindow::Stop()
{
    MOZ_NOT_IMPLEMENTED
}

/* void print (); */
NS_IMETHODIMP KeyPairHelperWindow::Print()
{
    MOZ_NOT_IMPLEMENTED
}

/* void moveTo (in long xPos, in long yPos); */
NS_IMETHODIMP KeyPairHelperWindow::MoveTo(PRInt32 xPos, PRInt32 yPos)
{
    MOZ_NOT_IMPLEMENTED
}

/* void moveBy (in long xDif, in long yDif); */
NS_IMETHODIMP KeyPairHelperWindow::MoveBy(PRInt32 xDif, PRInt32 yDif)
{
    MOZ_NOT_IMPLEMENTED
}

/* void resizeTo (in long width, in long height); */
NS_IMETHODIMP KeyPairHelperWindow::ResizeTo(PRInt32 width, PRInt32 height)
{
    MOZ_NOT_IMPLEMENTED
}

/* void resizeBy (in long widthDif, in long heightDif); */
NS_IMETHODIMP KeyPairHelperWindow::ResizeBy(PRInt32 widthDif, PRInt32 heightDif)
{
    MOZ_NOT_IMPLEMENTED
}

/* void scroll (in long xScroll, in long yScroll); */
NS_IMETHODIMP KeyPairHelperWindow::Scroll(PRInt32 xScroll, PRInt32 yScroll)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] nsIDOMWindow open (in DOMString url, in DOMString name, in DOMString options); */
NS_IMETHODIMP KeyPairHelperWindow::Open(const nsAString & url, const nsAString & name, const nsAString & options, nsIDOMWindow **_retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] nsIDOMWindow openDialog (in DOMString url, in DOMString name, in DOMString options, in nsISupports aExtraArgument); */
NS_IMETHODIMP KeyPairHelperWindow::OpenDialog(const nsAString & url, const nsAString & name, const nsAString & options, nsISupports *aExtraArgument, nsIDOMWindow **_retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* void updateCommands (in DOMString action); */
NS_IMETHODIMP KeyPairHelperWindow::UpdateCommands(const nsAString & action)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] boolean find (in DOMString str, in boolean caseSensitive, in boolean backwards, in boolean wrapAround, in boolean wholeWord, in boolean searchInFrames, in boolean showDialog); */
NS_IMETHODIMP KeyPairHelperWindow::Find(const nsAString & str, PRBool caseSensitive, PRBool backwards, PRBool wrapAround, PRBool wholeWord, PRBool searchInFrames, PRBool showDialog, PRBool *_retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* DOMString atob (in DOMString aAsciiString); */
NS_IMETHODIMP KeyPairHelperWindow::Atob(const nsAString & aAsciiString, nsAString & _retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* DOMString btoa (in DOMString aBase64Data); */
NS_IMETHODIMP KeyPairHelperWindow::Btoa(const nsAString & aBase64Data, nsAString & _retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMElement frameElement; */
NS_IMETHODIMP KeyPairHelperWindow::GetFrameElement(nsIDOMElement * *aFrameElement)
{
    MOZ_NOT_IMPLEMENTED
}


/* readonly attribute nsIDOMDocument document; */
NS_IMETHODIMP KeyPairHelperWindow::GetDocument(nsIDOMDocument * *aDocument)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMWindow parent; */
NS_IMETHODIMP KeyPairHelperWindow::GetParent(nsIDOMWindow * *aParent)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMWindow top; */
NS_IMETHODIMP KeyPairHelperWindow::GetTop(nsIDOMWindow * *aTop)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute nsIDOMBarProp scrollbars; */
NS_IMETHODIMP KeyPairHelperWindow::GetScrollbars(nsIDOMBarProp * *aScrollbars)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] readonly attribute nsIDOMWindowCollection frames; */
NS_IMETHODIMP KeyPairHelperWindow::GetFrames(nsIDOMWindowCollection * *aFrames)
{
    MOZ_NOT_IMPLEMENTED
}

/* attribute DOMString name; */
NS_IMETHODIMP KeyPairHelperWindow::GetName(nsAString & aName)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetName(const nsAString & aName)
{
    MOZ_NOT_IMPLEMENTED
}

/* [noscript] attribute float textZoom; */
NS_IMETHODIMP KeyPairHelperWindow::GetTextZoom(float *aTextZoom)
{
    MOZ_NOT_IMPLEMENTED
}
NS_IMETHODIMP KeyPairHelperWindow::SetTextZoom(float aTextZoom)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long scrollX; */
NS_IMETHODIMP KeyPairHelperWindow::GetScrollX(PRInt32 *aScrollX)
{
    MOZ_NOT_IMPLEMENTED
}

/* readonly attribute long scrollY; */
NS_IMETHODIMP KeyPairHelperWindow::GetScrollY(PRInt32 *aScrollY)
{
    MOZ_NOT_IMPLEMENTED
}

/* void scrollTo (in long xScroll, in long yScroll); */
NS_IMETHODIMP KeyPairHelperWindow::ScrollTo(PRInt32 xScroll, PRInt32 yScroll)
{
    MOZ_NOT_IMPLEMENTED
}

/* void scrollBy (in long xScrollDif, in long yScrollDif); */
NS_IMETHODIMP KeyPairHelperWindow::ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif)
{
    MOZ_NOT_IMPLEMENTED
}

/* nsISelection getSelection (); */
NS_IMETHODIMP KeyPairHelperWindow::GetSelection(nsISelection **_retval)
{
    MOZ_NOT_IMPLEMENTED
}

/* void scrollByLines (in long numLines); */
NS_IMETHODIMP KeyPairHelperWindow::ScrollByLines(PRInt32 numLines)
{
    MOZ_NOT_IMPLEMENTED
}

/* void scrollByPages (in long numPages); */
NS_IMETHODIMP KeyPairHelperWindow::ScrollByPages(PRInt32 numPages)
{
    MOZ_NOT_IMPLEMENTED
}

/* void sizeToContent (); */
NS_IMETHODIMP KeyPairHelperWindow::SizeToContent()
{
    MOZ_NOT_IMPLEMENTED
}

NS_IMETHODIMP KeyPairHelperWindow::GetWindowRoot(nsIDOMEventTarget * *aWindowRoot)
{
    MOZ_NOT_IMPLEMENTED
}

#endif /* !HAVE_NSIKEYGENTHREAD_NSIOBSERVER */