[f-spot/cleanup-backend: 13/24] Add DatabaseSource



commit 8ab588eb310e13bd1098161aa8cc80fe81888a82
Author: Mike Gemünde <mike gemuende de>
Date:   Thu Jul 15 09:52:26 2010 +0200

    Add DatabaseSource
    
    This commit introduces a simple implementation of a database source
    which will be extended now.

 src/Makefile.am               |    1 +
 src/Sources/DatabaseSource.cs |   81 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 8540aa1..648dec4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -120,6 +120,7 @@ SOURCES = \
 	SingleView.cs \
 	Sharpener.cs \
 	SoftFocus.cs \
+	Sources/DatabaseSource.cs \
 	TagCommands.cs \
 	TagPopup.cs \
 	TagQueryWidget.cs \
diff --git a/src/Sources/DatabaseSource.cs b/src/Sources/DatabaseSource.cs
new file mode 100644
index 0000000..607a001
--- /dev/null
+++ b/src/Sources/DatabaseSource.cs
@@ -0,0 +1,81 @@
+/*
+ * DatabaseSource.cs
+ *
+ * Author(s):
+ *  Mike Gemuende <mike gemuende de>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using System;
+
+using Mono.Unix;
+
+
+namespace FSpot.Sources
+{
+
+
+    public class DatabaseSource : IPhotoSource
+    {
+
+#region Private Fields
+
+        private Db database;
+        private PhotoQuery query;
+
+#endregion
+
+#region Constructors
+
+        public DatabaseSource (Db database)
+        {
+            this.database = database;
+
+            query = new PhotoQuery (database.Photos);
+        }
+
+#endregion
+
+#region IPhotoSource Implementation
+
+        public string Name {
+            get { return Catalog.GetString ("Photo Library"); }
+        }
+
+        public bool CanAddPhotos {
+            get { return true; }
+        }
+
+        public bool CanDeletePhotos {
+            get { return true; }
+        }
+
+        public bool CanRemovePhotos {
+            get { return true; }
+        }
+
+        public void AddPhotos (IBrowsableCollection photos)
+        {
+            throw new System.NotImplementedException ();
+        }
+
+        public void DeletePhotos (IBrowsableCollection photos)
+        {
+            throw new System.NotImplementedException ();
+        }
+
+        public void RemovePhotos (IBrowsableCollection photos)
+        {
+            throw new System.NotImplementedException ();
+        }
+
+        public IBrowsableCollection Photos {
+            get { return query; }
+        }
+
+#endregion
+
+
+    }
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]