2007-05-03 01:56:41 -07:00
|
|
|
#ifndef nsPlacesImportExportService_h__
|
|
|
|
#define nsPlacesImportExportService_h__
|
|
|
|
|
|
|
|
#include "nsIPlacesImportExportService.h"
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsILocalFile.h"
|
|
|
|
#include "nsIOutputStream.h"
|
|
|
|
#include "nsIFaviconService.h"
|
|
|
|
#include "nsIAnnotationService.h"
|
|
|
|
#include "nsILivemarkService.h"
|
|
|
|
#include "nsINavHistoryService.h"
|
|
|
|
#include "nsINavBookmarksService.h"
|
2007-05-15 16:23:51 -07:00
|
|
|
#include "nsIMicrosummaryService.h"
|
2007-05-31 17:44:43 -07:00
|
|
|
#include "nsIChannel.h"
|
2007-05-03 01:56:41 -07:00
|
|
|
|
2007-05-31 17:44:43 -07:00
|
|
|
class nsPlacesImportExportService : public nsIPlacesImportExportService,
|
|
|
|
public nsINavHistoryBatchCallback
|
2007-05-03 01:56:41 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPLACESIMPORTEXPORTSERVICE
|
2007-05-31 17:44:43 -07:00
|
|
|
NS_DECL_NSINAVHISTORYBATCHCALLBACK
|
2007-05-03 01:56:41 -07:00
|
|
|
nsPlacesImportExportService();
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual ~nsPlacesImportExportService();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIFaviconService> mFaviconService;
|
|
|
|
nsCOMPtr<nsIAnnotationService> mAnnotationService;
|
|
|
|
nsCOMPtr<nsINavBookmarksService> mBookmarksService;
|
|
|
|
nsCOMPtr<nsINavHistoryService> mHistoryService;
|
|
|
|
nsCOMPtr<nsILivemarkService> mLivemarkService;
|
2007-05-15 16:23:51 -07:00
|
|
|
nsCOMPtr<nsIMicrosummaryService> mMicrosummaryService;
|
2007-05-03 01:56:41 -07:00
|
|
|
|
2007-05-31 17:44:43 -07:00
|
|
|
nsCOMPtr<nsIChannel> mImportChannel;
|
|
|
|
PRBool mIsImportDefaults;
|
|
|
|
|
2007-05-03 01:56:41 -07:00
|
|
|
nsresult ImportHTMLFromFileInternal(nsILocalFile* aFile, PRBool aAllowRootChanges,
|
|
|
|
PRInt64 aFolder, PRBool aIsImportDefaults);
|
2007-05-24 22:41:49 -07:00
|
|
|
nsresult WriteContainer(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
|
|
|
|
nsresult WriteContainerHeader(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
|
|
|
|
nsresult WriteTitle(nsINavHistoryResultNode* aItem, nsIOutputStream* aOutput);
|
2007-05-03 01:56:41 -07:00
|
|
|
nsresult WriteItem(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
|
2007-05-24 22:41:49 -07:00
|
|
|
nsresult WriteLivemark(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
|
|
|
|
nsresult WriteContainerContents(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
|
2007-05-14 21:18:25 -07:00
|
|
|
nsresult WriteSeparator(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
|
2007-05-11 12:26:14 -07:00
|
|
|
nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream* aOutput);
|
2007-05-03 01:56:41 -07:00
|
|
|
|
|
|
|
nsresult ArchiveBookmarksFile(PRInt32 aNumberOfBackups, PRBool aForceArchive);
|
2007-05-10 16:52:47 -07:00
|
|
|
|
|
|
|
inline nsresult EnsureServiceState() {
|
|
|
|
NS_ENSURE_STATE(mHistoryService);
|
|
|
|
NS_ENSURE_STATE(mFaviconService);
|
|
|
|
NS_ENSURE_STATE(mAnnotationService);
|
|
|
|
NS_ENSURE_STATE(mBookmarksService);
|
|
|
|
NS_ENSURE_STATE(mLivemarkService);
|
2007-05-15 16:23:51 -07:00
|
|
|
NS_ENSURE_STATE(mMicrosummaryService);
|
2007-05-10 16:52:47 -07:00
|
|
|
return NS_OK;
|
2007-06-16 12:53:59 -07:00
|
|
|
}
|
2007-05-03 01:56:41 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsPlacesImportExportService_h__
|