xref: /haiku/src/kits/tracker/TrackerInitialState.cpp (revision d9cebac2b77547b7064f22497514eecd2d047160)
1 /*
2 Open Tracker License
3 
4 Terms and Conditions
5 
6 Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
7 
8 Permission is hereby granted, free of charge, to any person obtaining a copy of
9 this software and associated documentation files (the "Software"), to deal in
10 the Software without restriction, including without limitation the rights to
11 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12 of the Software, and to permit persons to whom the Software is furnished to do
13 so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice applies to all licensees
16 and shall be included in all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 
25 Except as contained in this notice, the name of Be Incorporated shall not be
26 used in advertising or otherwise to promote the sale, use or other dealings in
27 this Software without prior written authorization from Be Incorporated.
28 
29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
30 of Be Incorporated in the United States and other countries. Other brand product
31 names are registered trademarks or trademarks of their respective holders.
32 All rights reserved.
33 */
34 
35 // ToDo:
36 // add code to initialize a subset of the mime database, including
37 // important sniffer rules
38 
39 #include <Directory.h>
40 #include <InterfaceDefs.h>
41 #include <Message.h>
42 #include <Node.h>
43 #include <Path.h>
44 #include <Screen.h>
45 #include <VolumeRoster.h>
46 
47 #include <fs_attr.h>
48 #include <fs_index.h>
49 
50 #include "pr_server.h"
51 
52 #include "Attributes.h"
53 #include "AttributeStream.h"
54 #include "BackgroundImage.h"
55 #include "Bitmaps.h"
56 #include "ContainerWindow.h"
57 #include "MimeTypes.h"
58 #include "FSUtils.h"
59 #include "QueryContainerWindow.h"
60 #include "Tracker.h"
61 
62 enum {
63 	kForceLargeIcon = 0x1,
64 	kForceMiniIcon = 0x2,
65 	kForceShortDescription = 0x4,
66 	kForceLongDescription = 0x8,
67 	kForcePreferredApp = 0x10
68 };
69 
70 
71 const char *kAttrName = "META:name";
72 const char *kAttrCompany = "META:company";
73 const char *kAttrAddress = "META:address";
74 const char *kAttrCity = "META:city";
75 const char *kAttrState = "META:state";
76 const char *kAttrZip = "META:zip";
77 const char *kAttrCountry = "META:country";
78 const char *kAttrHomePhone = "META:hphone";
79 const char *kAttrWorkPhone = "META:wphone";
80 const char *kAttrFax = "META:fax";
81 const char *kAttrEmail = "META:email";
82 const char *kAttrURL = "META:url";
83 const char *kAttrGroup = "META:group";
84 const char *kAttrNickname = "META:nickname";
85 
86 const char *kNetPositiveSignature = "application/x-vnd.Be-NPOS";
87 const char *kPeopleSignature = "application/x-vnd.Be-PEPL";
88 
89 namespace BPrivate {
90 
91 class ExtraAttributeLazyInstaller {
92 public:
93 	ExtraAttributeLazyInstaller(const char *type);
94 	~ExtraAttributeLazyInstaller();
95 
96 	bool AddExtraAttribute(const char *publicName, const char *name,
97 		uint32 type, bool viewable, bool editable, float width,
98 		int32 alignment, bool extra);
99 
100 	status_t InitCheck() const;
101 public:
102 	BMimeType fMimeType;
103 	BMessage fExtraAttrs;
104 	bool fDirty;
105 };
106 
107 }
108 
109 ExtraAttributeLazyInstaller::ExtraAttributeLazyInstaller(const char *type)
110 	:	fMimeType(type),
111 		fDirty(false)
112 {
113 	if (fMimeType.InitCheck() == B_OK)
114 		fMimeType.GetAttrInfo(&fExtraAttrs);
115 }
116 
117 
118 ExtraAttributeLazyInstaller::~ExtraAttributeLazyInstaller()
119 {
120 	if (fMimeType.InitCheck() == B_OK && fDirty)
121 		fMimeType.SetAttrInfo(&fExtraAttrs);
122 }
123 
124 bool
125 ExtraAttributeLazyInstaller::AddExtraAttribute(const char *publicName, const char *name,
126 	uint32 type, bool viewable, bool editable, float width, int32 alignment,
127 	bool extra)
128 {
129 	for (int32 index = 0; ; index++) {
130 		const char *oldPublicName;
131 		if (fExtraAttrs.FindString("attr:public_name", index, &oldPublicName) != B_OK)
132 			break;
133 
134 		if (strcmp(oldPublicName, publicName) == 0)
135 			// already got this extra atribute, no work left
136 			return false;
137 	}
138 
139 	fExtraAttrs.AddString("attr:public_name", publicName);
140 	fExtraAttrs.AddString("attr:name", name);
141 	fExtraAttrs.AddInt32("attr:type", (int32)type);
142 	fExtraAttrs.AddBool("attr:viewable", viewable);
143 	fExtraAttrs.AddBool("attr:editable", editable);
144 	fExtraAttrs.AddInt32("attr:width", (int32)width);
145 	fExtraAttrs.AddInt32("attr:alignment", alignment);
146 	fExtraAttrs.AddBool("attr:extra", extra);
147 
148 	fDirty = true;
149 	return true;
150 }
151 
152 
153 bool
154 TTracker::InstallMimeIfNeeded(const char *type, int32 bitsID,
155 	const char *shortDescription, const char *longDescription,
156 	const char *preferredAppSignature, uint32 forceMask)
157 {
158 	// used by InitMimeTypes - checks if a metamime of a given <type> is
159 	// installed and if it has all the specified attributes; if not, the
160 	// whole mime type is installed and all attributes are set; nulls can
161 	// be passed for attributes that don't matter; returns true if anything
162 	// had to be changed
163 
164 #ifndef __HAIKU__
165 # define B_BITMAP_NO_SERVER_LINK 0
166 #endif
167 
168 #ifdef __HAIKU__
169 	BBitmap vectorIcon(BRect(0, 0, 31, 31), B_BITMAP_NO_SERVER_LINK, B_RGB32);
170 #endif
171 	BBitmap largeIcon(BRect(0, 0, 31, 31), B_BITMAP_NO_SERVER_LINK, B_CMAP8);
172 	BBitmap miniIcon(BRect(0, 0, 15, 15), B_BITMAP_NO_SERVER_LINK, B_CMAP8);
173 	char tmp[B_MIME_TYPE_LENGTH];
174 
175 	BMimeType mime(type);
176 	bool installed = mime.IsInstalled();
177 
178 	if (!installed
179 #ifdef __HAIKU__
180 		|| (bitsID >= 0 && ((forceMask & kForceLargeIcon)
181 			|| mime.GetIcon(&vectorIcon, B_LARGE_ICON) != B_OK))
182 #endif
183 		|| (bitsID >= 0 && ((forceMask & kForceLargeIcon)
184 			|| mime.GetIcon(&largeIcon, B_LARGE_ICON) != B_OK))
185 		|| (bitsID >= 0 && ((forceMask & kForceMiniIcon)
186 			|| mime.GetIcon(&miniIcon, B_MINI_ICON) != B_OK))
187 		|| (shortDescription && ((forceMask & kForceShortDescription)
188 			|| mime.GetShortDescription(tmp) != B_OK))
189 		|| (longDescription && ((forceMask & kForceLongDescription)
190 			|| mime.GetLongDescription(tmp) != B_OK))
191 		|| (preferredAppSignature && ((forceMask & kForcePreferredApp)
192 			|| mime.GetPreferredApp(tmp) != B_OK))) {
193 
194 		if (!installed)
195 			mime.Install();
196 
197 		if (bitsID >= 0) {
198 #ifdef __HAIKU__
199 			const uint8* iconData;
200 			size_t iconSize;
201 			if (GetTrackerResources()->
202 					GetIconResource(bitsID, &iconData, &iconSize) == B_OK)
203 				mime.SetIcon(iconData, iconSize);
204 #endif
205 
206 			if (GetTrackerResources()->
207 					GetIconResource(bitsID, B_LARGE_ICON, &largeIcon) == B_OK)
208 				mime.SetIcon(&largeIcon, B_LARGE_ICON);
209 
210 			if (GetTrackerResources()->
211 					GetIconResource(bitsID, B_MINI_ICON, &miniIcon) == B_OK)
212 				mime.SetIcon(&miniIcon, B_MINI_ICON);
213 		}
214 
215 		if (shortDescription)
216 			mime.SetShortDescription(shortDescription);
217 
218 		if (longDescription)
219 			mime.SetLongDescription(longDescription);
220 
221 		if (preferredAppSignature)
222 			mime.SetPreferredApp(preferredAppSignature);
223 
224 		return true;
225 	}
226 	return false;
227 }
228 
229 void
230 TTracker::InitMimeTypes()
231 {
232 	InstallMimeIfNeeded(B_DIR_MIMETYPE, kResFolderIcon,
233 		"Folder", "Folder container for file system items.", kTrackerSignature);
234 
235 	InstallMimeIfNeeded(B_APP_MIME_TYPE, kResAppIcon,
236 		"Be Application", "Generic Be Application executable.", kTrackerSignature);
237 
238 	InstallMimeIfNeeded(B_FILE_MIMETYPE, kResFileIcon,
239 		"Generic file", "Generic document file.", kTrackerSignature);
240 
241 	InstallMimeIfNeeded(B_VOLUME_MIMETYPE, kResHardDiskIcon,
242 		"Be Volume", "Disk volume.", kTrackerSignature);
243 
244 	InstallMimeIfNeeded(B_QUERY_MIMETYPE, kResQueryIcon,
245 		"Be Query", "Query to locate items on disks.", kTrackerSignature);
246 
247 	InstallMimeIfNeeded(B_QUERY_TEMPLATE_MIMETYPE, kResQueryTemplateIcon,
248 		"Be Query Template", "", kTrackerSignature);
249 
250 	InstallMimeIfNeeded(B_LINK_MIMETYPE, kResBrokenLinkIcon,
251 		"Symbolic Link", "Link to another item in the file system.", kTrackerSignature);
252 
253 	InstallMimeIfNeeded(B_ROOT_MIMETYPE, kResBeBoxIcon,
254 		"Be Root", "File system root.", kTrackerSignature);
255 
256 	InstallMimeIfNeeded(B_BOOKMARK_MIMETYPE, kResBookmarkIcon,
257 		"Bookmark", "Bookmark for a web page.", kNetPositiveSignature);
258 
259 	{
260 		// install a couple of extra fields for bookmark
261 
262 		ExtraAttributeLazyInstaller installer(B_BOOKMARK_MIMETYPE);
263 		installer.AddExtraAttribute("URL", "META:url", B_STRING_TYPE, true, true,
264 			170, B_ALIGN_LEFT, false);
265 		installer.AddExtraAttribute("Keywords", "META:keyw", B_STRING_TYPE, true, true,
266 			130, B_ALIGN_LEFT, false);
267 		installer.AddExtraAttribute("Title", "META:title", B_STRING_TYPE, true, true,
268 			130, B_ALIGN_LEFT, false);
269 	}
270 
271 	InstallMimeIfNeeded(B_PERSON_MIMETYPE, kResPersonIcon,
272 		"Person", "Contact information for a person.", kPeopleSignature);
273 
274 	{
275 		ExtraAttributeLazyInstaller installer(B_PERSON_MIMETYPE);
276 		installer.AddExtraAttribute("Contact Name", kAttrName, B_STRING_TYPE, true, true,
277 			120, B_ALIGN_LEFT, false);
278 		installer.AddExtraAttribute("Company", kAttrCompany, B_STRING_TYPE, true, true,
279 			120, B_ALIGN_LEFT, false);
280 		installer.AddExtraAttribute("Address", kAttrAddress, B_STRING_TYPE, true, true,
281 			120, B_ALIGN_LEFT, false);
282 		installer.AddExtraAttribute("City", kAttrCity, B_STRING_TYPE, true, true,
283 			90, B_ALIGN_LEFT, false);
284 		installer.AddExtraAttribute("State", kAttrState, B_STRING_TYPE, true, true,
285 			50, B_ALIGN_LEFT, false);
286 		installer.AddExtraAttribute("Zip", kAttrZip, B_STRING_TYPE, true, true,
287 			50, B_ALIGN_LEFT, false);
288 		installer.AddExtraAttribute("Country", kAttrCountry, B_STRING_TYPE, true, true,
289 			120, B_ALIGN_LEFT, false);
290 		installer.AddExtraAttribute("E-mail", kAttrEmail, B_STRING_TYPE, true, true,
291 			120, B_ALIGN_LEFT, false);
292 		installer.AddExtraAttribute("Home Phone", kAttrHomePhone, B_STRING_TYPE, true, true,
293 			90, B_ALIGN_LEFT, false);
294 		installer.AddExtraAttribute("Work Phone", kAttrWorkPhone, B_STRING_TYPE, true, true,
295 			90, B_ALIGN_LEFT, false);
296 		installer.AddExtraAttribute("Fax", kAttrFax, B_STRING_TYPE, true, true,
297 			90, B_ALIGN_LEFT, false);
298 		installer.AddExtraAttribute("URL", kAttrURL, B_STRING_TYPE, true, true,
299 			120, B_ALIGN_LEFT, false);
300 		installer.AddExtraAttribute("Group", kAttrGroup, B_STRING_TYPE, true, true,
301 			120, B_ALIGN_LEFT, false);
302 		installer.AddExtraAttribute("Nickname", kAttrNickname, B_STRING_TYPE, true, true,
303 			120, B_ALIGN_LEFT, false);
304 	}
305 
306 	InstallMimeIfNeeded(B_PRINTER_SPOOL_MIMETYPE, kResSpoolFileIcon,
307 		"Printer spool", "Printer spool file.", "application/x-vnd.Be-PRNT");
308 
309 	{
310 #if B_BEOS_VERSION_DANO
311 		ExtraAttributeLazyInstaller installer(B_PRINTER_SPOOL_MIMETYPE);
312 		installer.AddExtraAttribute("Status", PSRV_SPOOL_ATTR_STATUS, B_STRING_TYPE, true, false,
313 			60, B_ALIGN_LEFT, false);
314 		installer.AddExtraAttribute("Page Count", PSRV_SPOOL_ATTR_PAGECOUNT, B_INT32_TYPE, true, false,
315 			40, B_ALIGN_RIGHT, false);
316 		installer.AddExtraAttribute("Description", PSRV_SPOOL_ATTR_DESCRIPTION, B_STRING_TYPE, true, true,
317 			100, B_ALIGN_LEFT, false);
318 		installer.AddExtraAttribute("Printer Name", PSRV_SPOOL_ATTR_PRINTER, B_STRING_TYPE, true, false,
319 			80, B_ALIGN_LEFT, false);
320 		installer.AddExtraAttribute("Job creator type", PSRV_SPOOL_ATTR_MIMETYPE, B_ASCII_TYPE, true, false,
321 			60, B_ALIGN_LEFT, false);
322 #else
323 		ExtraAttributeLazyInstaller installer(B_PRINTER_SPOOL_MIMETYPE);
324 		installer.AddExtraAttribute("Page Count", "_spool/Page Count", B_INT32_TYPE, true, false,
325 			40, B_ALIGN_RIGHT, false);
326 		installer.AddExtraAttribute("Description", "_spool/Description", B_ASCII_TYPE, true, true,
327 			100, B_ALIGN_LEFT, false);
328 		installer.AddExtraAttribute("Printer Name", "_spool/Printer", B_ASCII_TYPE, true, false,
329 			80, B_ALIGN_LEFT, false);
330 		installer.AddExtraAttribute("Job creator type", "_spool/MimeType", B_ASCII_TYPE, true, false,
331 			60, B_ALIGN_LEFT, false);
332 #endif
333 	}
334 
335 	InstallMimeIfNeeded(B_PRINTER_MIMETYPE, kResGenericPrinterIcon,
336 		"Printer", "Printer queue.", kTrackerSignature /*application/x-vnd.Be-PRNT*/);
337 		// for now set tracker as a default handler for the printer because we
338 		// just want to open it as a folder
339 #if B_BEOS_VERSION_DANO
340 	{
341 		ExtraAttributeLazyInstaller installer(B_PRINTER_MIMETYPE);
342 		installer.AddExtraAttribute("Driver", PSRV_PRINTER_ATTR_DRV_NAME, B_STRING_TYPE, true, false,
343 			120, B_ALIGN_LEFT, false);
344 		installer.AddExtraAttribute("Transport", PSRV_PRINTER_ATTR_TRANSPORT, B_STRING_TYPE, true, false,
345 			60, B_ALIGN_RIGHT, false);
346 		installer.AddExtraAttribute("Connection", PSRV_PRINTER_ATTR_CNX, B_STRING_TYPE, true, false,
347 			40, B_ALIGN_LEFT, false);
348 		installer.AddExtraAttribute("Description", PSRV_PRINTER_ATTR_COMMENTS, B_STRING_TYPE, true, true,
349 			140, B_ALIGN_LEFT, false);
350 	}
351 #endif
352 }
353 
354 void
355 TTracker::InstallIndices()
356 {
357 	BVolumeRoster roster;
358 	BVolume volume;
359 
360 	roster.Rewind();
361 	while (roster.GetNextVolume(&volume) == B_OK) {
362 		if (volume.IsReadOnly() || !volume.IsPersistent()
363 			|| !volume.KnowsAttr() || !volume.KnowsQuery())
364 			continue;
365 		InstallIndices(volume.Device());
366 	}
367 }
368 
369 void
370 TTracker::InstallIndices(dev_t device)
371 {
372 	status_t error = fs_create_index(device, kAttrQueryLastChange, B_INT32_TYPE, 0);
373 	error = fs_create_index(device, "_trk/recentQuery", B_INT32_TYPE, 0);
374 }
375 
376 const int32 kDefaultQueryTemplateCount = 3;
377 extern const AttributeTemplate kDefaultQueryTemplate[];
378 extern const AttributeTemplate kBookmarkQueryTemplate[];
379 extern const AttributeTemplate kPersonQueryTemplate[];
380 extern const AttributeTemplate kEmailQueryTemplate[];
381 
382 void
383 TTracker::InstallDefaultTemplates()
384 {
385 	BNode node;
386 	BString query(kQueryTemplates);
387 	query += "/application_octet-stream";
388 
389 	if (!BContainerWindow::DefaultStateSourceNode(query.String(), &node, false))
390 		if (BContainerWindow::DefaultStateSourceNode(query.String(), &node, true)) {
391 			AttributeStreamFileNode fileNode(&node);
392 			AttributeStreamTemplateNode tmp(kDefaultQueryTemplate, 3);
393 			fileNode << tmp;
394 		}
395 
396 	(query = kQueryTemplates) += "/application_x-vnd.Be-bookmark";
397 	if (!BContainerWindow::DefaultStateSourceNode(query.String(), &node, false))
398 		if (BContainerWindow::DefaultStateSourceNode(query.String(), &node, true)) {
399 			AttributeStreamFileNode fileNode(&node);
400 			AttributeStreamTemplateNode tmp(kBookmarkQueryTemplate, 3);
401 			fileNode << tmp;
402 		}
403 
404 	(query = kQueryTemplates) += "/application_x-person";
405 	if (!BContainerWindow::DefaultStateSourceNode(query.String(), &node, false))
406 		if (BContainerWindow::DefaultStateSourceNode(query.String(), &node, true)) {
407 			AttributeStreamFileNode fileNode(&node);
408 			AttributeStreamTemplateNode tmp(kPersonQueryTemplate, 3);
409 			fileNode << tmp;
410 		}
411 
412 	(query = kQueryTemplates) += "/text_x-email";
413 	if (!BContainerWindow::DefaultStateSourceNode(query.String(), &node, false))
414 		if (BContainerWindow::DefaultStateSourceNode(query.String(), &node, true)) {
415 			AttributeStreamFileNode fileNode(&node);
416 			AttributeStreamTemplateNode tmp(kEmailQueryTemplate, 3);
417 			fileNode << tmp;
418 		}
419 }
420 
421 static void
422 InstallTemporaryBackgroundImages(BNode *node, BMessage *message)
423 {
424 	int32 size = message->FlattenedSize();
425 	char *buffer = new char [size];
426 	message->Flatten(buffer, size);
427 	node->WriteAttr(kBackgroundImageInfo, B_MESSAGE_TYPE, 0, buffer, (size_t)size);
428 	delete [] buffer;
429 }
430 
431 static void
432 AddTemporaryBackgroundImages(BMessage *message, const char *imagePath,
433 	BackgroundImage::Mode mode, BPoint offset, uint32 workspaces, bool textWidgetOutlines)
434 {
435 	message->AddString(kBackgroundImageInfoPath, imagePath);
436 	message->AddInt32(kBackgroundImageInfoWorkspaces, (int32)workspaces);
437 	message->AddInt32(kBackgroundImageInfoMode, mode);
438 	message->AddBool(kBackgroundImageInfoTextOutline, textWidgetOutlines);
439 	message->AddPoint(kBackgroundImageInfoOffset, offset);
440 }
441 
442 static void
443 InstallTemporaryBackgroundImagesIfNeeded(BNode *node, const char *imagePath,
444 	BackgroundImage::Mode mode, BPoint offset, uint32 workspaces, bool textWidgetOutlines)
445 {
446 	attr_info info;
447 	if (node->GetAttrInfo(kBackgroundImageInfo, &info) != B_OK) {
448 		BMessage message;
449 		AddTemporaryBackgroundImages(&message, imagePath, mode, offset, workspaces,
450 			textWidgetOutlines);
451 		InstallTemporaryBackgroundImages(node, &message);
452 	}
453 }
454 
455 void
456 TTracker::InstallTemporaryBackgroundImages()
457 {
458 	// make the large Haiku Logo the default background
459 
460 //	BPath path;
461 	BPath path("/boot/beos/etc/artwork");
462 //	FSFindTrackerSettingsDir(&path, false);
463 //	path.Append(kDefaultFolderTemplate);
464 
465 	BString defaultBackgroundImage("/HAIKU logo - white on blue - big.png");
466 	BString defaultBackgroundTexture("/backgroundTexture.tga");
467 
468 	BNode node;
469 	if (BContainerWindow::DefaultStateSourceNode(kDefaultFolderTemplate, &node, true)) {
470 		// install a default background texture for folders in icon view mode
471 		InstallTemporaryBackgroundImagesIfNeeded(&node,
472 			(BString(path.Path()) << defaultBackgroundTexture).String(),
473 			BackgroundImage::kTiled,
474 			BPoint(0, 0), 0xffffffff, false);
475 	}
476 
477 	BDirectory dir;
478 	if (FSGetBootDeskDir(&dir) == B_OK) {
479 		// install a default background if there is no background defined yet
480 		attr_info info;
481 		if (dir.GetAttrInfo(kBackgroundImageInfo, &info) != B_OK) {
482 			BScreen screen(B_MAIN_SCREEN_ID);
483 			BPoint logoPos;
484 			logoPos.x = floorf((screen.Frame().Width() - 605) * (sqrtf(5) - 1) / 2);
485 			logoPos.y = floorf((screen.Frame().Height() - 190) * 0.9);
486 			BMessage message;
487 			AddTemporaryBackgroundImages(&message,
488 				(BString(path.Path()) << defaultBackgroundImage).String(),
489 				BackgroundImage::kAtOffset,
490 				logoPos, 0xffffffff, false);
491 			::InstallTemporaryBackgroundImages(&dir, &message);
492 		}
493 	}
494 }
495 
496 
497 // the following templates are in big endian and we rely on the Tracker
498 // translation support to swap them on little endian machines
499 //
500 // in case there is an attribute (B_RECT_TYPE) that gets swapped by the media (unzip,
501 // file system endianness swapping, etc., the correct endianness for the
502 // correct machine has to be used here
503 
504 const BRect kDefaultFrame(40, 40, 500, 350);
505 
506 const AttributeTemplate kDefaultQueryTemplate[] =
507 	/* /boot/home/config/settings/Tracker/DefaultQueryTemplates/application_octet-stream */
508 {
509 	{		 /* default frame */
510 		kAttrWindowFrame,
511 		B_RECT_TYPE,
512 		16,
513 		(const char *)&kDefaultFrame
514 	},
515 	{		 /* attr: _trk/viewstate */
516 		kAttrViewState_be,
517 		B_RAW_TYPE,
518 		49,
519 		"o^\365R\000\000\000\012Tlst\000\000\000\000\000\000\000\000\000\000"
520 		"\000\000\000\000\000\000\000\000\000\000\357\323\335RCSTR\000\000\000"
521 		"\000\000\000\000\000\000"
522 	},
523 	{		 /* attr: _trk/columns */
524 		kAttrColumns_be,
525 		B_RAW_TYPE,
526 		223,
527 		"O\362VR\000\000\000\025\000\000\000\004Name\000B \000\000C\021\000"
528 		"\000\000\000\000\000\000\000\000\012_stat/name\000\357\323\335RCST"
529 		"R\001\001O\362VR\000\000\000\025\000\000\000\004Path\000CH\000\000"
530 		"Ca\000\000\000\000\000\000\000\000\000\011_trk/path\000\357_\174RC"
531 		"STR\000\000O\362VR\000\000\000\025\000\000\000\004Size\000C\334\000"
532 		"\000B$\000\000\000\000\000\001\000\000\000\012_stat/size\000\317\317"
533 		"\306TOFFT\001\000O\362VR\000\000\000\025\000\000\000\010Modified\000"
534 		"C\370\000\000C\012\000\000\000\000\000\000\000\000\000\016_stat/mo"
535 		"dified\000]KmETIME\001\000"
536 	}
537 };
538 
539 const AttributeTemplate kBookmarkQueryTemplate[] =
540 	/* /boot/home/config/settings/Tracker/DefaultQueryTemplates/application_x-vnd.Be-bookmark */
541 {
542 	{		 /* default frame */
543 		kAttrWindowFrame,
544 		B_RECT_TYPE,
545 		16,
546 		(const char *)&kDefaultFrame
547 	},
548 	{		 /* attr: _trk/viewstate */
549 		kAttrViewState_be,
550 		B_RAW_TYPE,
551 		49,
552 		"o^\365R\000\000\000\012Tlst\000\000\000\000\000\000\000\000\000\000"
553 		"\000\000\000\000\000\000\000\000\000\000w\373\175RCSTR\000\000\000"
554 		"\000\000\000\000\000\000"
555 	},
556 	{		 /* attr: _trk/columns */
557 		kAttrColumns_be,
558 		B_RAW_TYPE,
559 		163,
560 		"O\362VR\000\000\000\025\000\000\000\005Title\000B \000\000C+\000\000"
561 		"\000\000\000\000\000\000\000\012META:title\000w\373\175RCSTR\000\001"
562 		"O\362VR\000\000\000\025\000\000\000\003URL\000Cb\000\000C\217\200\000"
563 		"\000\000\000\000\000\000\000\010META:url\000\343[TRCSTR\000\001O\362"
564 		"VR\000\000\000\025\000\000\000\010Keywords\000D\004\000\000C\002\000"
565 		"\000\000\000\000\000\000\000\000\011META:keyw\000\333\363\334RCSTR"
566 		"\000\001"
567 	}
568 };
569 
570 const AttributeTemplate kPersonQueryTemplate[] =
571 	/* /boot/home/config/settings/Tracker/DefaultQueryTemplates/application_x-vnd.Be-bookmark */
572 {
573 	{		 /* default frame */
574 		kAttrWindowFrame,
575 		B_RECT_TYPE,
576 		16,
577 		(const char *)&kDefaultFrame
578 	},
579 	{		 /* attr: _trk/viewstate */
580 		kAttrViewState_be,
581 		B_RAW_TYPE,
582 		49,
583 		"o^\365R\000\000\000\012Tlst\000\000\000\000\000\000\000\000\000\000"
584 		"\000\000\000\000\000\000\000\000\000\000\357\323\335RCSTR\000\000\000"
585 		"\000\000\000\000\000\000"
586 	},
587 	{		 /* attr: _trk/columns */
588 		kAttrColumns_be,
589 		B_RAW_TYPE,
590 		230,
591 		"O\362VR\000\000\000\025\000\000\000\004Name\000B \000\000B\346\000"
592 		"\000\000\000\000\000\000\000\000\012_stat/name\000\357\323\335RCST"
593 		"R\001\001O\362VR\000\000\000\025\000\000\000\012Work Phone\000C*\000"
594 		"\000B\264\000\000\000\000\000\000\000\000\000\013META:wphone\000C_"
595 		"uRCSTR\000\001O\362VR\000\000\000\025\000\000\000\006E-mail\000C\211"
596 		"\200\000B\272\000\000\000\000\000\000\000\000\000\012META:email\000"
597 		"sW\337RCSTR\000\001O\362VR\000\000\000\025\000\000\000\007Company\000"
598 		"C\277\200\000B\360\000\000\000\000\000\000\000\000\000\014META:com"
599 		"pany\000CS\174RCSTR\000\001"
600 	},
601 };
602 
603 const AttributeTemplate kEmailQueryTemplate[] =
604 	/* /boot/home/config/settings/Tracker/DefaultQueryTemplates/text_x-email */
605 {
606 	{		 /* default frame */
607 		kAttrWindowFrame,
608 		B_RECT_TYPE,
609 		16,
610 		(const char *)&kDefaultFrame
611 	},
612 	{		 /* attr: _trk/viewstate */
613 		kAttrViewState_be,
614 		B_RAW_TYPE,
615 		49,
616 		"o^\365R\000\000\000\012Tlst\000\000\000\000\000\000\000\000\000\000"
617 		"\000\000\000\000\000\000\000\000\000\000\366_\377ETIME\000\000\000"
618 		"\000\000\000\000\000\000"
619 	},
620 	{		 /* attr: _trk/columns */
621 		kAttrColumns_be,
622 		B_RAW_TYPE,
623 		222,
624 		"O\362VR\000\000\000\025\000\000\000\007Subject\000B \000\000B\334\000"
625 		"\000\000\000\000\000\000\000\000\014MAIL:subject\000\343\173\337RC"
626 		"STR\000\000O\362VR\000\000\000\025\000\000\000\004From\000C%\000\000"
627 		"C\031\000\000\000\000\000\000\000\000\000\011MAIL:from\000\317s_RC"
628 		"STR\000\000O\362VR\000\000\000\025\000\000\000\004When\000C\246\200"
629 		"\000B\360\000\000\000\000\000\000\000\000\000\011MAIL:when\000\366"
630 		"_\377ETIME\000\000O\362VR\000\000\000\025\000\000\000\006Status\000"
631 		"C\352\000\000BH\000\000\000\000\000\001\000\000\000\013MAIL:status"
632 		"\000G\363\134RCSTR\000\001"
633 	},
634 };
635 
636