38 #ifndef browserprofilemigratorutils___h___
39 #define browserprofilemigratorutils___h___
41 #define MIGRATION_ITEMBEFOREMIGRATE "Migration:ItemBeforeMigrate"
42 #define MIGRATION_ITEMAFTERMIGRATE "Migration:ItemAfterMigrate"
43 #define MIGRATION_STARTED "Migration:Started"
44 #define MIGRATION_ENDED "Migration:Ended"
46 #define NOTIFY_OBSERVERS(message, item) \
47 mObserverService->NotifyObservers(nsnull, message, item)
49 #define COPY_DATA(func, replace, itemIndex) \
50 if (NS_SUCCEEDED(rv) && (aItems & itemIndex || !aItems)) { \
52 index.AppendInt(itemIndex); \
53 NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get()); \
55 NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get()); \
58 #define NC_URI(property) \
59 NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#"#property)
61 #define BATCH_ACTION_HISTORY 0
62 #define BATCH_ACTION_HISTORY_REPLACE 1
63 #define BATCH_ACTION_BOOKMARKS 2
64 #define BATCH_ACTION_BOOKMARKS_REPLACE 3
66 #include "nsIPrefBranch.h"
68 #include "nsStringAPI.h"
71 class nsIProfileStartup;
79 void SetProxyPref(
const nsAString& aHostPort,
const char* aPref,
90 PRInt32 aDataArrayLength,
92 nsIFile* aSourceProfile,
98 void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
106 nsIFile* aTargetBookmarksFile,
107 const char* aToolbarFolderName);
116 PRBool aImportIntoRoot,
117 PRBool aOverwriteDefaults,
118 const PRUnichar* aImportSourceNameKey);
void ParseOverrideServers(const nsAString &aServers, nsIPrefBranch *aBranch)
void SetProxyPref(const nsAString &aHostPort, const char *aPref, const char *aPortPref, nsIPrefBranch *aPrefs)
void GetProfilePath(nsIProfileStartup *aStartup, nsCOMPtr< nsIFile > &aProfileDir)
nsresult InitializeBookmarks(nsIFile *aTargetProfile)
void SetUnicharPref(const char *aPref, const nsAString &aValue, nsIPrefBranch *aPrefs)
nsresult ImportBookmarksHTML(nsIFile *aBookmarksFile, PRBool aImportIntoRoot, PRBool aOverwriteDefaults, const PRUnichar *aImportSourceNameKey)
nsresult AnnotatePersonalToolbarFolder(nsIFile *aSourceBookmarksFile, nsIFile *aTargetBookmarksFile, const char *aToolbarFolderName)
void GetMigrateDataFromArray(MigrationData *aDataArray, PRInt32 aDataArrayLength, PRBool aReplace, nsIFile *aSourceProfile, PRUint16 *aResult)