Index: trunk/src/lib/util/filesys/net_link.cc
===================================================================
--- trunk/src/lib/util/filesys/net_link.cc	(revision 9406)
+++ trunk/src/lib/util/filesys/net_link.cc	(revision 9406)
@@ -0,0 +1,83 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#include "net_link.h"
+#include "debug.h"
+
+
+#ifdef __OSX__
+#include <ApplicationServices/ApplicationServices.h>
+#elif defined __WIN32__
+//#include <shellapi.h>
+#endif
+
+
+NetLink::NetLink(const std::string& linkName)
+{
+  this->_link = linkName;
+}
+
+
+void NetLink::openInBrowser() const
+{
+  SDL_CreateThread(NetLink::openupInBrowser, (void*)&this->_link);
+}
+
+OrxThread::Mutex NetLink::_mutex;
+std::string NetLink::_defaultBrowser = "firefox";
+std::list<std::string> NetLink::_browserList = NetLink::buildBrowserList();
+
+
+
+
+int NetLink::openupInBrowser(void* url)
+{
+  OrxThread::MutexLock lock(&NetLink::_mutex);
+
+  std::string URL = *(std::string*)url;
+#ifdef __linux__
+  system ((std::string(NetLink::defaultBrowser()) + " " + URL).c_str());
+
+#elif defined __OSX__
+  CFURLRef url_handle = CFURLCreateWithBytes (NULL, (UInt8 *)URL.c_str(), URL.size(),
+                                              kCFStringEncodingASCII, NULL);
+  LSOpenCFURLRef (url_handle, NULL);
+  CFRelease (url_handle);
+
+#elif defined __WIN32__
+  /*  ShellExecute(GetActiveWindow(),
+               "open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL);
+}*/
+#endif
+  PRINTF(3)("loaded external webpage %s\n", URL.c_str());
+
+  return 0;
+}
+
+void NetLink::setDefaultBrowser(const std::string& browserName)
+{
+  OrxThread::MutexLock lock(&NetLink::_mutex);
+  NetLink::_defaultBrowser = browserName;
+}
+
+std::list<std::string> NetLink::buildBrowserList()
+{
+  std::list<std::string> browserList;
+  browserList.push_back("firefox");
+  browserList.push_back("mozilla");
+  browserList.push_back("konqueror");
+
+  return  browserList;
+}
Index: trunk/src/lib/util/filesys/net_link.h
===================================================================
--- trunk/src/lib/util/filesys/net_link.h	(revision 9406)
+++ trunk/src/lib/util/filesys/net_link.h	(revision 9406)
@@ -0,0 +1,53 @@
+/*!
+ * @file net_link.h
+ * @brief Definition of a NetLink class
+ * NetLink is a File link to a page of file link to the Internet,
+ * or the local file-system
+ *
+ * Opening a link should be made easy through this class
+ *
+ * !! DANGER IT IS POSSIBLE TO EXECUTE ALL PROGRAMMS WITH USER'S RIGHTS
+ * !! ON THE DESIGNATED MACHINE
+ * !! THIS CLASS SHOULD BE USED WITH CAUTION WHEN USING OVER IN NETWORK
+ * !! MODE
+ */
+
+#ifndef __NET_LINK_H__
+#define __NET_LINK_H__
+
+#include <string>
+#include <list>
+
+#include "threading.h"
+
+//! NetLink is a File and Link executer for Internet Links
+/**
+ * @example: NetLink("http://www.orxonox.net").openInBrowser();
+ */
+class NetLink
+{
+public:
+  NetLink(const std::string& linkName);
+
+  void openInBrowser() const;
+
+  static void setDefaultBrowser(const std::string& browserName);
+  static const std::string& defaultBrowser() {  return NetLink::_defaultBrowser; };
+
+private:
+  static int openupInBrowser(void* url);
+
+  static std::list<std::string> buildBrowserList();
+
+
+private:
+  std::string                     _link;             //!< Linkname
+
+
+  // static lists.
+  static OrxThread::Mutex         _mutex;            //!< One mutex to lock them all.
+  static std::string              _defaultBrowser;   //!< The default Browser.
+  static std::list<std::string>   _browserList;
+};
+
+#endif /** __NET_LINK_H__ */
