summaryrefslogtreecommitdiff
path: root/plugins/de.appplant.cordova.plugin.email-composer/src/wp8
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/de.appplant.cordova.plugin.email-composer/src/wp8')
-rw-r--r--plugins/de.appplant.cordova.plugin.email-composer/src/wp8/EmailComposer.cs133
-rw-r--r--plugins/de.appplant.cordova.plugin.email-composer/src/wp8/Options.cs76
2 files changed, 0 insertions, 209 deletions
diff --git a/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/EmailComposer.cs b/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/EmailComposer.cs
deleted file mode 100644
index db0d613e..00000000
--- a/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/EmailComposer.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- Copyright 2013-2015 appPlant UG
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-using De.APPPlant.Cordova.Plugin.EmailComposer;
-using Microsoft.Phone.Tasks;
-using System;
-using System.Linq;
-using WPCordovaClassLib.Cordova;
-using WPCordovaClassLib.Cordova.Commands;
-using WPCordovaClassLib.Cordova.JSON;
-
-namespace Cordova.Extension.Commands
-{
- /// <summary>
- /// Implementes access to email composer task
- /// http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394003(v=vs.105).aspx
- /// </summary>
- public class EmailComposer : BaseCommand
- {
- /// <summary>
- /// Überprüft, ob Emails versendet werden können.
- /// </summary>
- public void isAvailable(string jsonArgs)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, true));
- }
-
- /// <summary>
- /// Öffnet den Email-Kontroller mit vorausgefüllten Daten.
- /// </summary>
- public void open(string jsonArgs)
- {
- string[] args = JsonHelper.Deserialize<string[]>(jsonArgs);
- Options options = JsonHelper.Deserialize<Options>(args[0]);
- EmailComposeTask draft = GetDraftWithProperties(options);
-
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, true));
-
- OpenDraft(draft);
- }
-
- /// </summary>
- /// Erstellt den Email-Composer und fügt die übergebenen Eigenschaften ein.
- /// </summary>
- private EmailComposeTask GetDraftWithProperties(Options options)
- {
- EmailComposeTask draft = new EmailComposeTask();
-
- SetSubject(options.Subject, draft);
- SetBody(options.Body, options.IsHtml, draft);
- SetTo(options.To, draft);
- SetCc(options.Cc, draft);
- SetBcc(options.Bcc, draft);
- SetAttachments(options.Attachments, draft);
-
- return draft;
- }
-
- /// </summary>
- /// Zeigt den ViewController zum Versenden/Bearbeiten der Mail an.
- /// </summary>
- private void OpenDraft(EmailComposeTask draft)
- {
- draft.Show();
- }
-
- /// </summary>
- /// Setzt den Subject der Mail.
- /// </summary>
- private void SetSubject(string subject, EmailComposeTask draft)
- {
- draft.Subject = subject;
- }
-
- /// </summary>
- /// Setzt den Body der Mail.
- /// </summary>
- private void SetBody(string body, Boolean isHTML, EmailComposeTask draft)
- {
- draft.Body = body;
- }
-
- /// </summary>
- /// Setzt die Empfänger der Mail.
- /// </summary>
- private void SetTo(string[] recipients, EmailComposeTask draft)
- {
- draft.To = string.Join(",", recipients);
- }
-
- /// </summary>
- /// Setzt die CC-Empfänger der Mail.
- /// </summary>
- private void SetCc(string[] recipients, EmailComposeTask draft)
- {
- draft.Cc = string.Join(",", recipients);
- }
-
- /// </summary>
- /// Setzt die BCC-Empfänger der Mail.
- /// </summary>
- private void SetBcc(string[] recipients, EmailComposeTask draft)
- {
- draft.Bcc = string.Join(",", recipients);
- }
-
- /// </summary>
- /// Fügt die Anhände zur Mail hinzu.
- /// </summary>
- private void SetAttachments(string[] attachments, EmailComposeTask draft)
- {
- // Not supported on WP8.0 and WP8.1 Silverlight
- }
- }
-}
diff --git a/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/Options.cs b/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/Options.cs
deleted file mode 100644
index b7c7206e..00000000
--- a/plugins/de.appplant.cordova.plugin.email-composer/src/wp8/Options.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Copyright 2013-2015 appPlant UG
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-using System;
-using System.Linq;
-using System.Runtime.Serialization;
-
-namespace De.APPPlant.Cordova.Plugin.EmailComposer
-{
- /// <summary>
- /// Represents email composer task options
- /// </summary>
- [DataContract]
- class Options
- {
- /// <summary>
- /// Represents the subject of the email
- /// </summary>
- [DataMember(IsRequired = false, Name = "subject")]
- public string Subject { get; set; }
-
- /// <summary>
- /// Represents the email body (could be HTML code, in this case set isHtml to true)
- /// </summary>
- [DataMember(IsRequired = false, Name = "body")]
- public string Body { get; set; }
-
- /// <summary>
- /// Indicats if the body is HTML or plain text
- /// </summary>
- [DataMember(IsRequired = false, Name = "isHtml")]
- public bool IsHtml { get; set; }
-
- /// <summary>
- /// Contains all the email addresses for TO field
- /// </summary>
- [DataMember(IsRequired = false, Name = "to")]
- public string[] To { get; set; }
-
- /// <summary>
- /// Contains all the email addresses for CC field
- /// </summary>
- [DataMember(IsRequired = false, Name = "cc")]
- public string[] Cc { get; set; }
-
- /// <summary>
- /// Contains all the email addresses for BCC field
- /// </summary>
- [DataMember(IsRequired = false, Name = "bcc")]
- public string[] Bcc { get; set; }
-
- /// <summary>
- /// Contains all full paths to the files you want to attach
- /// </summary>
- [DataMember(IsRequired = false, Name = "attachments")]
- public string[] Attachments { get; set; }
- }
-}