Add example code to use beagle as a service provider.
[beagle.git] / search / Tiles / ArchivedFile.cs
blob3bf39dbc3f3d8565522fa7b3330d7d4422ad1b66
1 using System;
2 using System.Diagnostics;
3 using Mono.Unix;
4 using Beagle.Util;
6 namespace Search.Tiles {
8 public class ArchivedFileActivator : TileActivator {
10 public ArchivedFileActivator () : base ()
12 AddSupportedFlavor (new HitFlavor (null, "File", null));
15 public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
17 return new TileArchivedFile (hit, query);
20 public override bool Validate (Beagle.Hit hit)
22 if (! base.Validate (hit))
23 return false;
25 string str = hit.GetFirstProperty ("fixme:inside_archive");
26 if (hit.ParentUri == null || str == null || str == "false")
27 return false;
29 Weight += 1;
31 return true;
35 public class TileArchivedFile : TileFile {
37 public TileArchivedFile (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
39 Description = String.Format (Catalog.GetString ("Inside archive {0}"), GetTitle (hit, true));
42 protected override void LoadIcon (Gtk.Image image, int size)
44 // FIXME: Emblemize some sort of archive icon on top of
45 // the main icon.
46 base.LoadIcon (image, size);