gecko/toolkit/components/places/nsPlacesExportService.h
Paolo Amadini 3706e25e63 Bug 728174 - Replace old synchronous favicons calls in the bookmarks HTML import. r=mak
--HG--
extra : rebase_source : ddb3109fa13f41bdfb2f265f7850453905145a07
2012-04-12 12:27:36 +02:00

64 lines
2.3 KiB
C++
Executable File

#ifndef nsPlacesExportService_h_
#define nsPlacesExportService_h_
#include "nsIPlacesImportExportService.h"
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsIOutputStream.h"
#include "nsIFaviconService.h"
#include "nsIAnnotationService.h"
#include "mozIAsyncLivemarks.h"
#include "nsINavHistoryService.h"
#include "nsINavBookmarksService.h"
#include "nsIChannel.h"
class nsPlacesExportService : public nsIPlacesImportExportService
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPLACESIMPORTEXPORTSERVICE
nsPlacesExportService();
/**
* Obtains the service's object.
*/
static nsPlacesExportService* GetSingleton();
/**
* Initializes the service's object. This should only be called once.
*/
nsresult Init();
private:
static nsPlacesExportService* gExportService;
virtual ~nsPlacesExportService();
protected:
nsCOMPtr<nsIFaviconService> mFaviconService;
nsCOMPtr<nsIAnnotationService> mAnnotationService;
nsCOMPtr<nsINavBookmarksService> mBookmarksService;
nsCOMPtr<nsINavHistoryService> mHistoryService;
nsCOMPtr<mozIAsyncLivemarks> mLivemarkService;
nsresult WriteContainer(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteContainerHeader(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteTitle(nsINavHistoryResultNode* aItem, nsIOutputStream* aOutput);
nsresult WriteItem(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteLivemark(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteContainerContents(nsINavHistoryResultNode* aFolder, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteSeparator(nsINavHistoryResultNode* aItem, const nsACString& aIndent, nsIOutputStream* aOutput);
nsresult WriteDescription(PRInt64 aId, PRInt32 aType, nsIOutputStream* aOutput);
inline nsresult EnsureServiceState() {
NS_ENSURE_STATE(mHistoryService);
NS_ENSURE_STATE(mFaviconService);
NS_ENSURE_STATE(mAnnotationService);
NS_ENSURE_STATE(mBookmarksService);
NS_ENSURE_STATE(mLivemarkService);
return NS_OK;
}
};
#endif // nsPlacesExportService_h_