nsIEProfileMigrator.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
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/
9  *
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.
14  *
15  * The Original Code is mozilla.org code.
16  *
17  * The Initial Developer of the Original Code is
18  * Netscape Communications Corporation.
19  * Portions created by the Initial Developer are Copyright (C) 2002
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  *
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.
35  *
36  * ***** END LICENSE BLOCK ***** */
37 
38 /* Private header describing the class to migrate preferences from
39  Windows Trident to Gecko. This is a virtual class. */
40 
41 #ifndef ieprofilemigrator___h___
42 #define ieprofilemigrator___h___
43 
44 #include <time.h>
45 #include <windows.h>
46 #include "nsIBrowserProfileMigrator.h"
47 #include "nsIObserverService.h"
48 #include "nsTArray.h"
49 #include "nsINavHistoryService.h"
50 
51 class nsIFile;
52 class nsICookieManager2;
53 class nsIRDFResource;
54 class nsINavBookmarksService;
55 class nsIPrefBranch;
56 
57 struct SignonData {
58  PRUnichar* user;
59  PRUnichar* pass;
60  char* realm;
61 };
62 
63 #import PSTOREC_DLL raw_interfaces_only
64 using namespace PSTORECLib;
65 
67  public nsINavHistoryBatchCallback {
68 public:
69  NS_DECL_NSIBROWSERPROFILEMIGRATOR
70  NS_DECL_NSINAVHISTORYBATCHCALLBACK
72 
74  virtual ~nsIEProfileMigrator();
75 
76 protected:
77  nsresult CopyPreferences(PRBool aReplace);
78  nsresult CopyStyleSheet(PRBool aReplace);
79  nsresult CopyCookies(PRBool aReplace);
80  nsresult CopyProxyPreferences(nsIPrefBranch* aPrefs);
81  nsresult CopySecurityPrefs(nsIPrefBranch* aPrefs);
90  nsresult CopyHistory(PRBool aReplace);
91  nsresult CopyHistoryBatched(PRBool aReplace);
92 
93  PRBool KeyIsURI(const nsAString& aKey, char** aRealm);
94 
95  nsresult CopyPasswords(PRBool aReplace);
96  nsresult MigrateSiteAuthSignons(IPStore* aPStore);
97  nsresult GetSignonsListFromPStore(IPStore* aPStore, nsTArray<SignonData>* aSignonsFound);
98  nsresult ResolveAndMigrateSignons(IPStore* aPStore, nsTArray<SignonData>* aSignonsFound);
99  void EnumerateUsernames(const nsAString& aKey, PRUnichar* aData, unsigned long aCount, nsTArray<SignonData>* aSignonsFound);
100  void GetUserNameAndPass(unsigned char* data, unsigned long len, unsigned char** username, unsigned char** pass);
101 
102  nsresult CopyFormData(PRBool aReplace);
103  nsresult AddDataToFormHistory(const nsAString& aKey, PRUnichar* data, unsigned long len);
113  nsresult CopyFavorites(PRBool aReplace);
114  nsresult CopyFavoritesBatched(PRBool aReplace);
115  void ResolveShortcut(const nsString &aFileName, char** aOutURL);
116  nsresult ParseFavoritesFolder(nsIFile* aDirectory,
117  PRInt64 aParentFolder,
118  nsINavBookmarksService* aBookmarksService,
119  const nsAString& aPersonalToolbarFolderName,
120  PRBool aIsAtRootLevel);
121  nsresult CopySmartKeywords(nsINavBookmarksService* aBMS,
122  PRInt64 aParentFolder);
123 
124  nsresult CopyCookiesFromBuffer(char *aBuffer, PRUint32 aBufferLength,
125  nsICookieManager2 *aCookieManager);
126  void DelimitField(char **aBuffer, const char *aBufferEnd, char **aField);
127  time_t FileTimeToTimeT(const char *aLowDateIntString,
128  const char *aHighDateIntString);
129  void GetUserStyleSheetFile(nsIFile **aUserFile);
130  PRBool TestForIE7();
131 
132 private:
133  nsCOMPtr<nsIObserverService> mObserverService;
134 };
135 
136 #endif
137 
const nsIPrefBranch
PRUnichar * user
restoreHistoryPrecursor aCount
PRUnichar * pass
observe data
Definition: FeedWriter.js:1329
_updateTextAndScrollDataForFrame aData