diff options
Diffstat (limited to 'comm/suite/components/profile/nsSuiteDirectoryProvider.h')
-rw-r--r-- | comm/suite/components/profile/nsSuiteDirectoryProvider.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/comm/suite/components/profile/nsSuiteDirectoryProvider.h b/comm/suite/components/profile/nsSuiteDirectoryProvider.h new file mode 100644 index 0000000000..6a06be3c30 --- /dev/null +++ b/comm/suite/components/profile/nsSuiteDirectoryProvider.h @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef SuiteDirectoryProvider_h__ +#define SuiteDirectoryProvider_h__ + +#include "nsCOMArray.h" +#include "nsIDirectoryService.h" +#include "nsIFile.h" +#include "nsISimpleEnumerator.h" +#include "nsString.h" +#include "nsCOMPtr.h" +#include "nsIProperties.h" +#include "mozilla/Attributes.h" +#include "nsSuiteCID.h" + +#define NS_APP_BOOKMARKS_50_FILE "BMarks" + +class nsSuiteDirectoryProvider final : public nsIDirectoryServiceProvider2 +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIDIRECTORYSERVICEPROVIDER + NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 + +private: + ~nsSuiteDirectoryProvider() {} + + void EnsureProfileFile(const nsACString& aLeafName, + nsIFile* aParentDir, nsIFile* aTarget); + + void AppendDistroSearchDirs(nsIProperties* aDirSvc, + nsCOMArray<nsIFile> &array); + + void AppendFileKey(const char *key, nsIProperties* aDirSvc, + nsCOMArray<nsIFile> &array); + + class AppendingEnumerator final : public nsISimpleEnumerator + { + public: + NS_DECL_ISUPPORTS + NS_DECL_NSISIMPLEENUMERATOR + + AppendingEnumerator(nsISimpleEnumerator* aBase, + const char* const aLeafName); + + private: + ~AppendingEnumerator() {} + void GetNext(); + + nsCOMPtr<nsISimpleEnumerator> mBase; + nsDependentCString mLeafName; + nsCOMPtr<nsIFile> mNext; + }; +}; + +#endif |