You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIProfile


This interface manipulates user profiles, including methods for loading them, unloading them, and creating them. It is scriptable.

Methods
getProfileList

Obtains an array of existing profile names.

Syntax:

void nsIProfile::getProfileList(out unsigned long length, 
	[retval, array, 
	size_is(length)] out wstring profileNames) 

Parameters:

length: [out] The length of the array.
profileNames: [out] The list of names.

nsresult:

NS_OK if successful.
profileExists

Indicates if a particular profile exists.

Syntax:

boolean nsIProfile::profileExists(in wstring profileName) 

Parameters:

profileName: The requested profile.

Returns:

True if the profile exists.
shutDownCurrentProfile

Performs a "logout" by shutting down the current profile.

Syntax:

void nsIProfile::shutDownCurrentProfile(
	in unsigned long shutDownType) 

Parameters:

shutDownType: A value that indicates the type of shutdown required.

See constants SHUTDOWN_PERSIST and SHUTDOWN_CLEANSE defined below.

nsresult:

NS_OK if successful.
createNewProfile

Creates a new profile. Initially this profile will be a copy of a previously existing profile.

Syntax:

void nsIProfile::createNewProfile(in wstring profileName, 
	in wstring nativeProfileDir, in wstring langcode,
	in boolean useExistingDir) 

Parameters:

profileName: The name to assign to the profile.
nativeProfileDir: The directory path where the profile is to be stored.
langcode: The language code appropriate for this profile. useExistingDir: If TRUE use existing profile directory.

nsresult:

NS_OK if successful.
renameProfile

Renames a profile.

Syntax:

void nsIProfile::renameProfile(in wstring oldName,
	in wstring newName) 

Parameters:

oldName: The old name of the profile.
newName: The new name of the profile.

nsresult:

NS_OK if successful.
deleteProfile

Removes a profile.

Syntax:

void nsIProfile::deleteProfile(in wstring name, 
	in boolean canDeleteFiles) 

Parameters:

name: The name of the profile to be deleted.
canDeleteFiles: Must be PR_TRUE or disk file will not be deleted.

nsresult:

NS_OK if successful.
NS_FAILED if not successful.
cloneProfile

Clones the current profile.

Syntax:

void nsIProfile::cloneProfile(in wstring profileName) 

Parameters:

profileName: The name to assign to the new profile.

nsresult:

NS_OK if successful.
NS_FAILED if not successful.
Attributes and Constants
readonly attribute long nsIProfile::profileCount

Gets the number of profiles.

attribute wstring nsIProfile::currentProfile

Gets the name of the current profile.

const unsigned long nsIProfile::SHUTDOWN_PERSIST=0x00000001

See shutDownCurrentProfile above.

const unsigned long nsIProfile:: SHUTDOWN_CLEANSE=0x00000002

See shutDownCurrentProfile above.


Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX