Changed EphyHistoryWindow to use the new backend, some things still remain (selected_...
[ephy-soc.git] / embed / mozilla / EphyUtils.h
blobb922a44663a54b4ed949c5cfcd324811fbf56dbf
1 /*
2 * Copyright © 2004 Marco Pesenti Gritti
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1, or (at your option)
7 * any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * $Id: EphyUtils.h 6952 2007-03-11 19:42:02Z chpe $
21 #ifndef EPHY_UTILS_H
22 #define EPHY_UTILS_H
24 // cannot include EphyUtils with internal strings!
25 #ifdef MOZILLA_INTERNAL_API
26 #error Cannot use EphyUtils with MOZILLA_INTERNAL_API
27 #endif
29 #include <nscore.h>
31 #include <gtk/gtkwidget.h>
33 class nsACString;
34 class nsAString;
35 class nsIDOMWindow;
36 class nsIFile;
37 class nsIIOService;
38 class nsIURI;
40 namespace EphyUtils
42 nsresult GetIOService (nsIIOService **ioService);
44 nsresult NewURI (nsIURI **result,
45 const nsAString &spec,
46 const char *charset = nsnull,
47 nsIURI *baseURI = nsnull);
49 nsresult NewURI (nsIURI **result,
50 const nsACString &spec,
51 const char *charset = nsnull,
52 nsIURI *baseURI = nsnull);
54 nsresult NewFileURI (nsIURI **result,
55 nsIFile *spec);
57 GtkWidget *FindEmbed (nsIDOMWindow *aDOMWindow);
59 GtkWidget *FindGtkParent (nsIDOMWindow *aDOMWindow);
61 char * ConvertUTF16toUTF8 (const PRUnichar*, PRInt32);
64 namespace EphyJSUtils
66 PRBool IsCalledFromScript ();
68 /* not addref'd! */ nsIDOMWindow* GetDOMWindowFromCallContext ();
71 #endif