summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/import/src/nsImportService.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/import/src/nsImportService.h
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mailnews/import/src/nsImportService.h')
-rw-r--r--comm/mailnews/import/src/nsImportService.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/comm/mailnews/import/src/nsImportService.h b/comm/mailnews/import/src/nsImportService.h
new file mode 100644
index 0000000000..37dd95b935
--- /dev/null
+++ b/comm/mailnews/import/src/nsImportService.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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 nsImportService_h__
+#define nsImportService_h__
+
+#include "nsString.h"
+#include "nsMemory.h"
+#include "nsIImportModule.h"
+#include "nsIImportService.h"
+#include "nsIStringBundle.h"
+#include "nsTArray.h"
+
+class ImportModuleDesc {
+ public:
+ explicit ImportModuleDesc(nsIImportModule* importModule);
+
+ const nsAString& GetName(void) { return m_name; }
+ const nsAString& GetDescription(void) { return m_description; }
+
+ nsCOMPtr<nsIImportModule>& GetModule() { return m_pModule; }
+
+ bool SupportsThings(const nsACString& pThings);
+
+ private:
+ nsString m_name;
+ nsString m_description;
+ nsCString m_supports;
+ nsCOMPtr<nsIImportModule> m_pModule;
+};
+
+class nsImportService : public nsIImportService {
+ public:
+ nsImportService();
+
+ NS_DECL_THREADSAFE_ISUPPORTS
+ NS_DECL_NSIIMPORTSERVICE
+
+ private:
+ virtual ~nsImportService();
+ nsresult LoadModuleInfo(const nsCString& contractId);
+ nsresult DoDiscover(void);
+ ImportModuleDesc* GetImportModule(const char* filter, int32_t index);
+
+ private:
+ AutoTArray<ImportModuleDesc, 10> m_importModules;
+ bool m_didDiscovery;
+ nsCString m_sysCharset;
+ nsCOMPtr<nsIStringBundle> m_stringBundle;
+};
+
+#endif // nsImportService_h__