summaryrefslogtreecommitdiffstats
path: root/mailnews/jsaccount/public
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
commit302bf1b523012e11b60425d6eee1221ebc2724eb (patch)
treeb191a895f8716efcbe42f454f37597a545a6f421 /mailnews/jsaccount/public
parent21b3f6247403c06f85e1f45d219f87549862198f (diff)
downloadUXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/jsaccount/public')
-rw-r--r--mailnews/jsaccount/public/moz.build17
-rw-r--r--mailnews/jsaccount/public/msgIDelegateList.idl19
-rw-r--r--mailnews/jsaccount/public/msgIOverride.idl42
-rw-r--r--mailnews/jsaccount/public/msgJsAccountCID.h35
4 files changed, 113 insertions, 0 deletions
diff --git a/mailnews/jsaccount/public/moz.build b/mailnews/jsaccount/public/moz.build
new file mode 100644
index 000000000..a635ffca9
--- /dev/null
+++ b/mailnews/jsaccount/public/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+XPIDL_SOURCES += [
+ 'msgIDelegateList.idl',
+ 'msgIOverride.idl',
+]
+
+EXPORTS += [
+ 'msgJsAccountCID.h',
+]
+
+XPIDL_MODULE = 'msgjsaccount'
+
diff --git a/mailnews/jsaccount/public/msgIDelegateList.idl b/mailnews/jsaccount/public/msgIDelegateList.idl
new file mode 100644
index 000000000..dce1b0bb6
--- /dev/null
+++ b/mailnews/jsaccount/public/msgIDelegateList.idl
@@ -0,0 +1,19 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:set ts=2 sw=2 sts=2 et cindent: */
+/* 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/. */
+
+#include "nsISupports.idl"
+
+/**
+ * This interface provides a list of methods that should be delegated to
+ * a JsObject rather than a C++ XPCOM base object in JsAccount classes.
+ */
+
+[scriptable, builtinclass, uuid(627D3A34-F8A3-40eb-91FE-E413D6638D27)]
+interface msgIDelegateList : nsISupports
+{
+ /// Method name to delegate to JavaScript.
+ void add(in string aMethod);
+};
diff --git a/mailnews/jsaccount/public/msgIOverride.idl b/mailnews/jsaccount/public/msgIOverride.idl
new file mode 100644
index 000000000..cad1bf415
--- /dev/null
+++ b/mailnews/jsaccount/public/msgIOverride.idl
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:set ts=2 sw=2 sts=2 et cindent: */
+/* 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/. */
+
+#include "nsISupports.idl"
+#include "msgIDelegateList.idl"
+
+/**
+ * Mailnews code typically has a C++ base class for objects, which is then
+ * specialized for each account type with a C++ subclass of the base class.
+ *
+ * This interface provides the ability of JavaScript-based account
+ * implementations to use the same C++ base classes as core objects, but
+ * use JavaScript to override methods instead of C++.
+ */
+
+[scriptable, uuid(68075269-8BBD-4a09-AC04-3241BF44F633)]
+interface msgIOverride : nsISupports
+{
+ /**
+ *
+ * A list of methods in the C++ base class that will be delegated to the JS
+ * delegate. This is calculated once, and then a fixed value is set to
+ * all subsequent instances so that it does not need to be recalculated each
+ * time. If the value has not yet been set, this will return a new instance.
+ */
+ attribute msgIDelegateList methodsToDelegate;
+
+ /**
+ * JavaScript-based xpcom object that overrides C++ methods.
+ */
+ attribute nsISupports jsDelegate;
+
+ /**
+ * C++ class used to implement default functionality. This is used when
+ * JavaScript methods want to call the base class default action, bypassing a
+ * possible JS override.
+ */
+ readonly attribute nsISupports cppBase;
+};
diff --git a/mailnews/jsaccount/public/msgJsAccountCID.h b/mailnews/jsaccount/public/msgJsAccountCID.h
new file mode 100644
index 000000000..330569312
--- /dev/null
+++ b/mailnews/jsaccount/public/msgJsAccountCID.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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/. */
+
+// Contains the definitions of contract IDs for modules in JsAccounts.
+
+#ifndef _msgJsAccountCID_H_
+#define _msgJsAccountCID_H_
+
+#define JACPPURLDELEGATOR_CID \
+{ 0x1a0b778c, 0x2fe6, 0x4012, { 0xb4, 0xf3, 0xe8, 0x1c, 0xc, 0x11, 0x64, 0x9 } }
+#define JACPPURLDELEGATOR_CONTRACTID "@mozilla.org/jacppurldelegator;1"
+
+#define JACPPABDIRECTORYDELEGATOR_CID \
+{ 0x77b5592c, 0x5018, 0x436d, { 0xa4, 0x66, 0xc4, 0xe5, 0x44, 0x3a, 0x16, 0x69 } }
+#define JACPPABDIRECTORYDELEGATOR_CONTRACTID "@mozilla.org/jacppabdirectorydelegator;1"
+
+#define JACPPINCOMINGSERVERDELEGATOR_CID \
+{ 0x7aa11dd3, 0x5590, 0x4e01, { 0xbd, 0x87, 0x91, 0xf6, 0x02, 0x72, 0xd0, 0x1a } }
+#define JACPPINCOMINGSERVERDELEGATOR_CONTRACTID "@mozilla.org/jacppincomingserverdelegator;1"
+
+#define JACPPCOMPOSEDELEGATOR_CID \
+{ 0xcfcd1caa, 0x00d9, 0x40d0, { 0x83, 0x1e, 0x67, 0x38, 0x20, 0xe0, 0x4f, 0xc6 } }
+#define JACPPCOMPOSEDELEGATOR_CONTRACTID "@mozilla.org/jacppcomposedelegator;1"
+
+#define JACPPMSGFOLDERDELEGATOR_CID \
+{ 0xd6bd81fa, 0xb1d4, 0x424a, { 0x88, 0xea, 0xbb, 0x3e, 0xa8, 0x38, 0x1d, 0x50 } }
+#define JACPPMSGFOLDERDELEGATOR_CONTRACTID "@mozilla.org/jacppmsgfolderdelegator;1"
+
+#define JACPPSENDDELEGATOR_CID \
+{ 0x36fcb887, 0x2b04, 0x42d4, { 0x92, 0xc9, 0xae, 0xd2, 0xac, 0xa1, 0xd4, 0x5b } }
+#define JACPPSENDDELEGATOR_CONTRACTID "@mozilla.org/jacppsenddelegator;1"
+#endif