Some timeout issues
[pithos-ms-client] / trunk / Pithos.Core / IStatusNotification.cs
index 99f901b..1f29ad7 100644 (file)
@@ -1,3 +1,44 @@
+#region\r
+/* -----------------------------------------------------------------------\r
+ * <copyright file="IStatusNotification.cs" company="GRNet">\r
+ * \r
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or\r
+ * without modification, are permitted provided that the following\r
+ * conditions are met:\r
+ *\r
+ *   1. Redistributions of source code must retain the above\r
+ *      copyright notice, this list of conditions and the following\r
+ *      disclaimer.\r
+ *\r
+ *   2. Redistributions in binary form must reproduce the above\r
+ *      copyright notice, this list of conditions and the following\r
+ *      disclaimer in the documentation and/or other materials\r
+ *      provided with the distribution.\r
+ *\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS\r
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR\r
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF\r
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\r
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ * The views and conclusions contained in the software and\r
+ * documentation are those of the authors and should not be\r
+ * interpreted as representing official policies, either expressed\r
+ * or implied, of GRNET S.A.\r
+ * </copyright>\r
+ * -----------------------------------------------------------------------\r
+ */\r
+#endregion\r
 using System.Collections.Generic;\r
 using System.Diagnostics;\r
 using System.IO;\r
@@ -14,6 +55,10 @@ namespace Pithos.Core
         void NotifyConflicts(IEnumerable<FileSystemInfo> conflictFiles, string message);\r
         void NotifyForFiles(IEnumerable<FileSystemInfo> files, string message,TraceLevel level);\r
         void Notify(Notification notification);\r
+        void SetPithosStatus(PithosStatus status);\r
+        void SetPithosStatus(PithosStatus localSyncing, string format);\r
+        //Notifier GetNotifier(Notification startNotification, Notification endNotification);\r
+        Notifier GetNotifier(string startMessage, string endMessage,bool isActive=true,params object[] args);\r
     }\r
 \r
     public class Notification\r
@@ -30,6 +75,36 @@ namespace Pithos.Core
         }\r
     }\r
 \r
+    public class StatusNotification:Notification\r
+    {\r
+        public StatusNotification(string title)\r
+        {\r
+            Level = TraceLevel.Info;\r
+            Title = title;\r
+        }\r
+    }\r
+\r
+    public class ProgressNotification:Notification\r
+    {\r
+        public string FileName { get; set; }\r
+        public long Block { get; set; }\r
+        public int TotalBlocks { get; set; }\r
+        public long FileSize { get; set; }\r
+        public string Action { get; set; }\r
+        public int BlockPercentage { get; set; }\r
+        \r
+        public ProgressNotification(string fileName, string action, long block, int blockPercentage,int totalBlocks, long fileSize)\r
+        {\r
+            FileName = fileName;\r
+            Block = block;\r
+            TotalBlocks = totalBlocks;\r
+            FileSize = fileSize;\r
+            Action = action;\r
+            BlockPercentage = blockPercentage;\r
+\r
+        }\r
+    }\r
+\r
     public class Notification<T>:Notification\r
     {\r
         public T Data { get; set; }\r
@@ -53,4 +128,19 @@ namespace Pithos.Core
     {\r
         \r
     }\r
+    public class CloudDeleteNotification:CloudNotification\r
+    {\r
+        \r
+    }\r
+\r
+    public class ExpirationNotification:Notification<AccountSettings>\r
+    {\r
+        public ExpirationNotification(AccountSettings account)\r
+        {\r
+            Data = account;\r
+            Level = TraceLevel.Error;\r
+            Title = "Account key expired";\r
+            Message = string.Format("Please renew the key for the account {0} from the Preferences page", account.AccountName);\r
+        }\r
+    }\r
 }
\ No newline at end of file