[f-spot/cleanup-backend: 2/23] Add DatabaseSource
- From: Mike Gemünde <mgemuende src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot/cleanup-backend: 2/23] Add DatabaseSource
- Date: Fri, 16 Jul 2010 17:25:31 +0000 (UTC)
commit 61af28485c5b666c5c0863f298e837393c9e442c
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 92568a8..d476e7b 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]