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 
6 #ifndef nsApplicationChooser_h__
7 #define nsApplicationChooser_h__
8 
9 #include <gtk/gtk.h>
10 #include "nsCOMPtr.h"
11 #include "nsIApplicationChooser.h"
12 #include "nsString.h"
13 
14 class nsIWidget;
15 
16 class nsApplicationChooser final : public nsIApplicationChooser {
17  public:
18   nsApplicationChooser();
19   NS_DECL_ISUPPORTS
20   NS_DECL_NSIAPPLICATIONCHOOSER
21   void Done(GtkWidget* chooser, gint response);
22 
23  private:
24   ~nsApplicationChooser();
25   nsCOMPtr<nsIWidget> mParentWidget;
26   nsCString mWindowTitle;
27   nsCOMPtr<nsIApplicationChooserFinishedCallback> mCallback;
28   static void OnResponse(GtkWidget* chooser, gint response_id,
29                          gpointer user_data);
30   static void OnDestroy(GtkWidget* chooser, gpointer user_data);
31 };
32 #endif
33