Support for a query:<forumla> url type :) (still needs unencoding of quotes)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20378 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2007-03-12 14:46:45 +00:00
parent e4b4574f41
commit 4f18055dfa
2 changed files with 42 additions and 3 deletions
+39 -2
View File
@@ -11,6 +11,7 @@
#include <Debug.h>
#define HANDLE_FILE
#define HANDLE_QUERY
//#define HANDLE_MID_CID // http://www.rfc-editor.org/rfc/rfc2392.txt query MAIL:cid
#define HANDLE_SH
#define HANDLE_BESHARE
@@ -334,6 +335,41 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
}
#endif
#ifdef HANDLE_QUERY
// XXX:TODO
if (u.proto == "query") {
// mktemp ?
BString qname("/tmp/query-url-temp-");
qname << getpid() << "-" << system_time();
BFile query(qname.String(), O_CREAT|O_EXCL);
// XXX: should check for failure
BString s;
int32 v;
// TODO:
// UnurlString(full);
// TODO: handle options (list of attrs in the column, ...)
v = 'qybF'; // QuerY By Formula XXX: any #define for that ?
query.WriteAttr("_trk/qryinitmode", B_INT32_TYPE, 0LL, &v, sizeof(v));
s = "TextControl";
query.WriteAttr("_trk/focusedView", B_STRING_TYPE, 0LL, s.String(), s.Length()+1);
s = u.full;
query.WriteAttr("_trk/qryinitstr", B_STRING_TYPE, 0LL, s.String(), s.Length()+1);
query.WriteAttr("_trk/qrystr", B_STRING_TYPE, 0LL, s.String(), s.Length()+1);
s = "application/x-vnd.Be-query";
query.WriteAttr("BEOS:TYPE", 'MIMS', 0LL, s.String(), s.Length()+1);
BEntry e(qname.String());
entry_ref er;
if (e.GetRef(&er) >= B_OK)
be_roster->Launch(&er);
return;
}
#endif
#ifdef HANDLE_SH
if (u.proto == "sh") {
BString cmd(u.Full());
@@ -402,7 +438,7 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
#ifdef HANDLE_AUDIO
// TODO
#endif
// vnc: ?
// irc: ?
//
@@ -415,7 +451,8 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
//
// itps: pcast: podcast: s//http/ + parse xml to get url to mp3 stream...
// audio: s//http:/ + default MediaPlayer -- see http://forums.winamp.com/showthread.php?threadid=233130
//
//
// gps: ? I should submit an RFC for that one :)
}
+3 -1
View File
@@ -10,9 +10,11 @@ resource(1, "BEOS:FILE_TYPES") message
"types" = "application/x-vnd.Be.URL.finger",
"types" = "application/x-vnd.Be.URL.sh",
"types" = "application/x-vnd.Be.URL.file",
"types" = "application/x-vnd.Be.URL.query",
"types" = "application/x-vnd.Be.URL.beshare",
"types" = "application/x-vnd.Be.URL.mms",
"types" = "application/x-vnd.Be.URL.rtp",
"types" = "application/x-vnd.Be.URL.rtsp"
"types" = "application/x-vnd.Be.URL.rtsp",
"types" = "application/x-vnd.Be.URL.audio"
};