Last change
on this file since 10769 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
1.3 KB
|
Rev | Line | |
---|
[9394] | 1 | /*! |
---|
| 2 | * @file net_link.h |
---|
| 3 | * @brief Definition of a NetLink class |
---|
| 4 | * NetLink is a File link to a page of file link to the Internet, |
---|
| 5 | * or the local file-system |
---|
| 6 | * |
---|
| 7 | * Opening a link should be made easy through this class |
---|
| 8 | * |
---|
| 9 | * !! DANGER IT IS POSSIBLE TO EXECUTE ALL PROGRAMMS WITH USER'S RIGHTS |
---|
| 10 | * !! ON THE DESIGNATED MACHINE |
---|
| 11 | * !! THIS CLASS SHOULD BE USED WITH CAUTION WHEN USING OVER IN NETWORK |
---|
| 12 | * !! MODE |
---|
| 13 | */ |
---|
[9393] | 14 | |
---|
| 15 | #ifndef __NET_LINK_H__ |
---|
| 16 | #define __NET_LINK_H__ |
---|
| 17 | |
---|
| 18 | #include <string> |
---|
| 19 | #include <list> |
---|
| 20 | |
---|
[10618] | 21 | #include "threads/mutex.h" |
---|
[9394] | 22 | |
---|
| 23 | //! NetLink is a File and Link executer for Internet Links |
---|
| 24 | /** |
---|
| 25 | * @example: NetLink("http://www.orxonox.net").openInBrowser(); |
---|
| 26 | */ |
---|
[9393] | 27 | class NetLink |
---|
| 28 | { |
---|
| 29 | public: |
---|
[9394] | 30 | NetLink(const std::string& linkName); |
---|
[9393] | 31 | |
---|
[9394] | 32 | void openInBrowser() const; |
---|
[9393] | 33 | |
---|
| 34 | static void setDefaultBrowser(const std::string& browserName); |
---|
[9395] | 35 | static const std::string& defaultBrowser() { return NetLink::_defaultBrowser; }; |
---|
[9393] | 36 | |
---|
| 37 | private: |
---|
[9394] | 38 | static int openupInBrowser(void* url); |
---|
[9393] | 39 | |
---|
[9394] | 40 | static std::list<std::string> buildBrowserList(); |
---|
[9393] | 41 | |
---|
[9394] | 42 | |
---|
[9393] | 43 | private: |
---|
[9394] | 44 | std::string _link; //!< Linkname |
---|
[9393] | 45 | |
---|
[9394] | 46 | |
---|
[9393] | 47 | // static lists. |
---|
[9394] | 48 | static OrxThread::Mutex _mutex; //!< One mutex to lock them all. |
---|
[9395] | 49 | static std::string _defaultBrowser; //!< The default Browser. |
---|
[9393] | 50 | static std::list<std::string> _browserList; |
---|
| 51 | }; |
---|
| 52 | |
---|
| 53 | #endif /** __NET_LINK_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.