Yao Lu / BasicWeb

Dependents:   uVGAII_WebBrowser

Revision:
0:7fac52628f4e
Child:
1:41f0491dcc4c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BasicWeb.h	Wed Mar 06 16:13:02 2013 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+#include "TFT_4DGL.h"
+#include "HTTPClient.h"
+#include "EthernetInterface.h"
+
+class BasicWeb{
+    
+    EthernetInterface eth;
+    HTTPClient http;
+    TFT_4DGL vga;
+    
+    // current string element and its modifiers
+    char* str;
+    int strSize;
+    bool bold;
+    bool title;
+    int font;
+    int color;
+    
+    char urlStr[100];
+    char titleStr[30];
+    char text[10240];                            // holds html text web pages
+    int urlIndex;
+    int lineIndex;                              // current row on screen to print at
+    int index;                                  // current index of text
+    static const unsigned char table[160];      // PS2 scancode to ASCII table
+
+  public:
+    BasicWeb(PinName tx, PinName rx, PinName reset);
+    void browser();
+    void displayUrl();
+    void displayPage();
+    void parseStr();
+    bool applyTag();
+    bool compareTag(char* s, char* tag);
+    bool extractStr();
+    void newKey(char scancode);
+    void modKey(char scancode1, char scancode2);
+    bool printText(char* s);
+    void removeRL(char* s, int size);
+    void copyStr(char* s1, char* s2, int size);
+};