2 * Copyright 2009 Haiku Inc.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef _OPEN_WITH_TRACKER_H
6 #define _OPEN_WITH_TRACKER_H
10 #include <FindDirectory.h>
12 #include <Messenger.h>
17 OpenWithTracker(const entry_ref
* ref
)
20 BMessage
message(B_REFS_RECEIVED
);
21 message
.AddRef("refs", ref
);
23 BMessenger
tracker("application/x-vnd.Be-TRAK");
24 status
= tracker
.SendMessage(&message
);
30 OpenWithTracker(const char* path
)
34 status
= get_ref_for_path(path
, &ref
);
38 return OpenWithTracker(&ref
);
43 OpenWithTracker(directory_which which
, const char* relativePath
= NULL
,
44 bool createDirectory
= false, BVolume
* volume
= NULL
)
48 find_directory(which
, &path
, createDirectory
, volume
);
51 path
.Append(relativePath
);
54 BEntry
entry(path
.Path());
57 return B_NAME_NOT_FOUND
;
59 status
= entry
.GetRef(&ref
);
63 return OpenWithTracker(&ref
);
67 #endif // _OPEN_WITH_TRACKER_H