nsPlacesImportExportService.h
Go to the documentation of this file.
1 #ifndef nsPlacesImportExportService_h__
2 #define nsPlacesImportExportService_h__
3 
4 #include "nsIPlacesImportExportService.h"
5 
6 #include "nsCOMPtr.h"
7 #include "nsILocalFile.h"
8 #include "nsIOutputStream.h"
9 #include "nsIFaviconService.h"
10 #include "nsIAnnotationService.h"
11 #include "nsILivemarkService.h"
12 #include "nsINavHistoryService.h"
13 #include "nsINavBookmarksService.h"
14 #include "nsIMicrosummaryService.h"
15 #include "nsIChannel.h"
16 
18  public nsINavHistoryBatchCallback
19 {
20  public:
22  NS_DECL_NSIPLACESIMPORTEXPORTSERVICE
23  NS_DECL_NSINAVHISTORYBATCHCALLBACK
25 
26  private:
27  virtual ~nsPlacesImportExportService();
28 
29  protected:
30  nsCOMPtr<nsIFaviconService> mFaviconService;
31  nsCOMPtr<nsIAnnotationService> mAnnotationService;
32  nsCOMPtr<nsINavBookmarksService> mBookmarksService;
33  nsCOMPtr<nsINavHistoryService> mHistoryService;
34  nsCOMPtr<nsILivemarkService> mLivemarkService;
35  nsCOMPtr<nsIMicrosummaryService> mMicrosummaryService;
36 
37  nsCOMPtr<nsIChannel> mImportChannel;
39 
40  nsresult ImportHTMLFromFileInternal(nsILocalFile* aFile, PRBool aAllowRootChanges,
41  PRInt64 aFolder, PRBool aIsImportDefaults);
42  nsresult WriteContainer(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
43  nsresult WriteContainerHeader(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
44  nsresult WriteTitle(nsINavHistoryResultNode* aItem, nsIOutputStream* aOutput);
45  nsresult WriteItem(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
46  nsresult WriteLivemark(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
47  nsresult WriteContainerContents(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
48  nsresult WriteSeparator(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
49  nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream* aOutput);
50 
51  inline nsresult EnsureServiceState() {
52  NS_ENSURE_STATE(mHistoryService);
53  NS_ENSURE_STATE(mFaviconService);
54  NS_ENSURE_STATE(mAnnotationService);
55  NS_ENSURE_STATE(mBookmarksService);
56  NS_ENSURE_STATE(mLivemarkService);
57  NS_ENSURE_STATE(mMicrosummaryService);
58  return NS_OK;
59  }
60 };
61 
62 #endif // nsPlacesImportExportService_h__
nsCOMPtr< nsIFaviconService > mFaviconService
return NS_OK
nsresult WriteLivemark(nsINavHistoryResultNode *aFolder, const nsACString &aIndent, nsIOutputStream *aOutput)
nsCOMPtr< nsIMicrosummaryService > mMicrosummaryService
nsresult ImportHTMLFromFileInternal(nsILocalFile *aFile, PRBool aAllowRootChanges, PRInt64 aFolder, PRBool aIsImportDefaults)
nsCOMPtr< nsILivemarkService > mLivemarkService
nsCOMPtr< nsINavHistoryService > mHistoryService
NS_DECL_ISUPPORTS NS_DECL_NSIPLACESIMPORTEXPORTSERVICE NS_DECL_NSINAVHISTORYBATCHCALLBACK nsPlacesImportExportService()
nsCOMPtr< nsINavBookmarksService > mBookmarksService
nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream *aOutput)
nsresult WriteContainerHeader(nsINavHistoryResultNode *aFolder, const nsACString &aIndent, nsIOutputStream *aOutput)
nsresult WriteSeparator(nsINavHistoryResultNode *aItem, const nsACString &aIndent, nsIOutputStream *aOutput)
nsresult WriteContainerContents(nsINavHistoryResultNode *aFolder, const nsACString &aIndent, nsIOutputStream *aOutput)
nsCOMPtr< nsIAnnotationService > mAnnotationService
nsresult WriteTitle(nsINavHistoryResultNode *aItem, nsIOutputStream *aOutput)
nsresult WriteItem(nsINavHistoryResultNode *aItem, const nsACString &aIndent, nsIOutputStream *aOutput)
nsresult WriteContainer(nsINavHistoryResultNode *aFolder, const nsACString &aIndent, nsIOutputStream *aOutput)