4 namespace Search
.Tiles
{
6 public class TextDocumentActivator
: TileActivator
{
8 public TextDocumentActivator () : base ()
10 AddSupportedFlavor (new HitFlavor (null, "File", "application/vnd.sun.xml.writer"));
11 AddSupportedFlavor (new HitFlavor (null, "File", "application/vnd.sun.xml.writer.template"));
12 AddSupportedFlavor (new HitFlavor (null, "File", "application/msword"));
13 AddSupportedFlavor (new HitFlavor (null, "File", "application/vnd.ms-word"));
14 AddSupportedFlavor (new HitFlavor (null, "File", "application/x-msword"));
15 AddSupportedFlavor (new HitFlavor (null, "File", "application/pdf"));
16 AddSupportedFlavor (new HitFlavor (null, "File", "application/x-abiword"));
17 AddSupportedFlavor (new HitFlavor (null, "File", "application/rtf"));
18 AddSupportedFlavor (new HitFlavor (null, "File", "application/x-chm"));
19 AddSupportedFlavor (new HitFlavor (null, "File", "application/vnd.oasis.opendocument.text"));
20 AddSupportedFlavor (new HitFlavor (null, "File", "application/vnd.oasis.opendocument.text.template"));
23 public override Tile
BuildTile (Beagle
.Hit hit
, Beagle
.Query query
)
25 return new TextDocument (hit
, query
);
29 public class TextDocument
: TileFile
{
31 public TextDocument (Beagle
.Hit hit
, Beagle
.Query query
) : base (hit
, query
)
33 Group
= TileGroup
.Documents
;
35 if (Hit
["fixme:page-count"] != null) {
36 int count
= Int32
.Parse (Hit
["fixme:page-count"]);
37 Description
= String
.Format (Catalog
.GetPluralString ("{0} page", "{0} pages", count
), count
);