aknlayoutcompiler/inc/HtmlParse.h
changeset 0 f58d6ec98e88
child 1 b700e12870ca
equal deleted inserted replaced
-1:000000000000 0:f58d6ec98e88
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HTMLPARSE_H
       
    20 #define HTMLPARSE_H
       
    21 
       
    22 // disable "identifier was truncated to '255' characters in the browser information" warning
       
    23 #pragma warning (disable:4786)
       
    24 #include <iosfwd>
       
    25 #include <vector>
       
    26 #include <string>
       
    27 #include "layout.h"
       
    28 using namespace std;
       
    29 
       
    30 /**
       
    31 *  THtmlParseLayoutTable 
       
    32 *  Parse a layout table from an HTML version of a LAF spec
       
    33 */
       
    34 class THtmlParseLayoutTable : public TLayoutTable
       
    35 	{
       
    36 private:
       
    37 	typedef vector<string> Row;
       
    38 
       
    39 public:
       
    40 	THtmlParseLayoutTable(TLayout* aTables);
       
    41 	~THtmlParseLayoutTable();
       
    42 
       
    43 	bool Read(istream& in);
       
    44 
       
    45 private:
       
    46 	bool SearchForTableStart();
       
    47 	void ExtractTitle(const string& aText);
       
    48 	void ExtractTable();
       
    49 
       
    50 	string Next();
       
    51 	bool IsToken(const string& aText);
       
    52 	void PutBack(const string& aText);
       
    53 	char Get();
       
    54 	void PutBack(char aChar);
       
    55 	bool Eof();
       
    56 	
       
    57 	int GetVal(const string& aText, const string& aField);
       
    58 
       
    59 	bool IsWindowTable();
       
    60 	bool IsTextTable();
       
    61 
       
    62 	string StripTo(const string& aText, const string& aValid);
       
    63 	string UnHtml(const string& aText);
       
    64 	char HtmlChar(const string& aText);
       
    65 	string CleanMultiCell(const string& aText);
       
    66 	Row MakeParamTable(const Row& row, int start, int num);
       
    67 	string ConvertToAknName(const string& aText);
       
    68 	string SplitMultiCell(const string& aCell, const string& aValid);
       
    69 	string CleanCell(const string& cell, const Row& row);
       
    70 
       
    71 	void AddRow(Row& row);
       
    72 	void AddColumnNameRow(Row& row);
       
    73 	void AddLineRow(const Row& row);
       
    74 	void AddTitleRow(const Row& row);
       
    75 
       
    76 private:
       
    77 	istream* iIn;
       
    78 	string iPutBack;
       
    79 	};
       
    80 
       
    81 
       
    82 /**
       
    83 *  THtmlParseLayout 
       
    84 *  Parse the entire layout from an HTML version of a LAF spec
       
    85 */
       
    86 class THtmlParseLayout : public TLayout
       
    87 	{
       
    88 public:
       
    89 	void Parse(istream &aIn);
       
    90 	};
       
    91 
       
    92 
       
    93 #endif
       
    94 
       
    95 // End of File