diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-07-20 09:19:04 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-07-20 09:19:04 +0000 |
commit | da9f6e8a856fc87172fb0d5997c607b4a930c102 (patch) | |
tree | a3f086c9e36a19b717a1cb1026a2eb751cfca078 /plugins/IEView/src/TextToken.h | |
parent | aa4076ff72097fd65a6c8a2369749afee6adf034 (diff) |
IEView, IgnoreState: changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1070 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/TextToken.h')
-rw-r--r-- | plugins/IEView/src/TextToken.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/plugins/IEView/src/TextToken.h b/plugins/IEView/src/TextToken.h new file mode 100644 index 0000000000..ad6c46d711 --- /dev/null +++ b/plugins/IEView/src/TextToken.h @@ -0,0 +1,90 @@ +/*
+
+IEView Plugin for Miranda IM
+Copyright (C) 2005-2010 Piotr Piastucki
+
+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
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef TEXTTOKEN_INCLUDED
+#define TEXTTOKEN_INCLUDED
+#include "IEView.h"
+class TextToken {
+private:
+ int type;
+ bool end;
+ int tag;
+ DWORD value;
+ wchar_t *wtext;
+ char *text;
+ wchar_t *wlink;
+ char *link;
+ TextToken *next;
+ static TextToken* tokenizeBBCodes(const wchar_t *text, int len);
+public:
+ enum TOKENS {
+ END = 0,
+ TEXT,
+ LINK,
+ WWWLINK,
+ SMILEY,
+ BBCODE,
+ MATH,
+ };
+ enum BBCODES {
+ BB_B = 0,
+ BB_I,
+ BB_U,
+ BB_S,
+ BB_COLOR,
+ BB_SIZE,
+ BB_IMG,
+ BB_BIMG,
+ BB_URL,
+ BB_CODE,
+ BB_BACKGROUND
+ };
+ TextToken(int type, const char *text, int len);
+ TextToken(int type, const wchar_t *wtext, int len);
+ ~TextToken();
+ int getType();
+ const char * getText();
+ const wchar_t* getTextW();
+ const char * getLink();
+ const wchar_t * getLinkW();
+ void setLink(const char *link);
+ void setLink(const wchar_t *wlink);
+ int getTag();
+ void setTag(int);
+ bool isEnd();
+ void setEnd(bool);
+ TextToken * getNext();
+ void setNext(TextToken *);
+// void toString(char **str, int *sizeAlloced);
+ void toString(wchar_t **str, int *sizeAlloced);
+// static char * htmlEncode(const char *str);
+// static char * urlEncode2(const char *str);
+// static TextToken* tokenizeLinks(const char *text);
+// static TextToken* tokenizeSmileys(const char *proto, const char *text);
+ // UNICODE
+ wchar_t * htmlEncode(const wchar_t *str);
+ static TextToken* tokenizeLinks(const wchar_t *wtext);
+ static TextToken* tokenizeSmileys(HANDLE hContact, const char *proto, const wchar_t *wtext, bool isSent);
+ static TextToken* tokenizeBBCodes(const wchar_t *text);
+ static TextToken* tokenizeMath(const wchar_t *text);
+ static TextToken* tokenizeChatFormatting(const wchar_t *text);
+};
+#endif
|