Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / modules / plugin / base / src / nsPluginsDir.h
blob1887f271147bc514e01452ad6c47379f7609b43d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsPluginsDir_h___
39 #define nsPluginsDir_h___
41 #include "nsError.h"
42 #include "nsIFile.h"
44 /**
45 * nsPluginsDir is nearly obsolete. Directory Service should be used instead.
46 * It exists for the sake of one static function.
49 class nsPluginsDir {
50 public:
51 /**
52 * Determines whether or not the given file is actually a plugin file.
54 static PRBool IsPluginFile(nsIFile* file);
57 struct PRLibrary;
59 struct nsPluginInfo {
60 char* fName; // name of the plugin
61 char* fDescription; // etc.
62 PRUint32 fVariantCount;
63 char** fMimeTypeArray;
64 char** fMimeDescriptionArray;
65 char** fExtensionArray;
66 char* fFileName;
67 char* fFullPath;
68 char* fVersion;
69 #ifdef XP_MACOSX
70 PRBool fBundle;
71 #endif
74 /**
75 * Provides cross-platform access to a plugin file. Deals with reading
76 * properties from the plugin file, and loading the plugin's shared
77 * library. Insulates core nsIPluginHost implementations from these
78 * details.
80 class nsPluginFile {
81 PRLibrary* pLibrary;
82 nsCOMPtr<nsIFile> mPlugin;
83 public:
84 /**
85 * If spec corresponds to a valid plugin file, constructs a reference
86 * to a plugin file on disk. Plugins are typically located using the
87 * nsPluginsDir class.
89 nsPluginFile(nsIFile* spec);
90 virtual ~nsPluginFile();
92 /**
93 * Loads the plugin into memory using NSPR's shared-library loading
94 * mechanism. Handles platform differences in loading shared libraries.
96 nsresult LoadPlugin(PRLibrary* &outLibrary);
98 /**
99 * Obtains all of the information currently available for this plugin.
101 nsresult GetPluginInfo(nsPluginInfo &outPluginInfo);
104 * Should be called after GetPluginInfo to free all allocated stuff
106 nsresult FreePluginInfo(nsPluginInfo &PluginInfo);
108 // Open the resource fork for the plugin
109 short OpenPluginResource(void);
112 #endif /* nsPluginsDir_h___ */