1 /* 2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef HYPER_LINK_H 6 #define HYPER_LINK_H 7 8 9 #include <String.h> 10 11 12 class HyperLink { 13 public: 14 enum Type { 15 TYPE_URL, 16 TYPE_PATH, 17 TYPE_PATH_WITH_LINE, 18 TYPE_PATH_WITH_LINE_AND_COLUMN 19 }; 20 21 public: 22 HyperLink(); 23 HyperLink(const BString& address, Type type); 24 HyperLink(const BString& text, 25 const BString& address, Type type); 26 27 bool IsValid() const { return !fAddress.IsEmpty(); } 28 29 const BString& Text() const { return fText; } 30 const BString& Address() const { return fAddress; } 31 Type GetType() const { return fType; } 32 33 status_t Open(); 34 35 private: 36 BString fText; 37 BString fAddress; 38 Type fType; 39 }; 40 41 42 #endif // HYPER_LINK_H 43