messagingfw/biomsgfw/T_BIOMSG/INC/parsers.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __PARSERS_H
       
    17 #define __PARSERS_H
       
    18 
       
    19 #include "testframeparse.h"
       
    20 #include "harness.h"
       
    21 
       
    22 //
       
    23 // This class parses the main section
       
    24 class CBioMainSectionParser : public CBaseSectionParser
       
    25 	{
       
    26 public:
       
    27 	static CBioMainSectionParser* NewL(CMainTestHarness& aMainTest, CTestScript& aScript);
       
    28 
       
    29 protected:
       
    30 	void ConstructL();
       
    31 	inline CBioMainSectionParser(CMainTestHarness& aMainTest, CTestScript& aScript) : CBaseSectionParser(aScript), iMainTest(aMainTest) {}
       
    32 	void LogComment(const TDesC& aComment);
       
    33 
       
    34 private:
       
    35 	CMainTestHarness& iMainTest;
       
    36 };
       
    37 
       
    38 //
       
    39 // This class parses the bio_client_test command in the main section
       
    40 class CBioMainCommandsParser : public CBaseCommandParser
       
    41 {
       
    42 public:
       
    43 	void ProcessL();
       
    44 	static CBioMainCommandsParser* NewL(CTestScript& aScript, CMainTestHarness& aMainTest);
       
    45 
       
    46 private:
       
    47 	void ConstructL();
       
    48 	inline CBioMainCommandsParser(CTestScript& aScript, CMainTestHarness& aMainTest) : iMainTest(aMainTest), iScript(aScript) {}
       
    49 	CMainTestHarness& iMainTest;
       
    50 	CTestScript& iScript;
       
    51 };
       
    52 
       
    53 //
       
    54 // This class parses the client secion specified in the bio_client_test cmd
       
    55 class CBioClientSectionParser : public CBaseSectionParser
       
    56 {
       
    57 public:
       
    58 	static CBioClientSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
    59 
       
    60 protected:
       
    61 	void LogComment(const TDesC& aComment);
       
    62 	void ConstructL(const TDesC& aNewSectionName);
       
    63 	inline CBioClientSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
    64 
       
    65 private: 
       
    66 	CClientTestHarness& iClientTest;
       
    67 	CTestScript& iScript;
       
    68 };
       
    69 
       
    70 //
       
    71 // This class parses the commands in the client secion
       
    72 class CBioClientCommandsParser : public CBaseCommandParser
       
    73 {
       
    74 public:
       
    75 	void ProcessL();
       
    76 	static CBioClientCommandsParser* NewL(CClientTestHarness& aMainTest);
       
    77 
       
    78 private:
       
    79 	void ConstructL();
       
    80 	inline CBioClientCommandsParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
    81 	CClientTestHarness& iClientTest;
       
    82 };
       
    83 
       
    84 //
       
    85 // This class parses the SmsSettings section
       
    86 class CBioSmsSettingsSectionParser : public CBaseSectionParser
       
    87 {
       
    88 public:
       
    89 	static CBioSmsSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
    90 
       
    91 protected:
       
    92 	void LogComment(const TDesC& aComment);
       
    93 	void ConstructL(const TDesC& aNewSectionName);
       
    94 	inline CBioSmsSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
    95 
       
    96 private: 
       
    97 	CClientTestHarness& iClientTest;
       
    98 	CTestScript& iScript;
       
    99 };
       
   100 
       
   101 //
       
   102 // This class handles the Sms commands
       
   103 class CBioSmsSettingsCommandsParser : public CBaseCommandParser
       
   104 {
       
   105 public:
       
   106 	void ProcessL();
       
   107 	static CBioSmsSettingsCommandsParser* NewL(CClientTestHarness& aMainTest);
       
   108 private:
       
   109 	void ConstructL();
       
   110 	inline CBioSmsSettingsCommandsParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
   111 	CClientTestHarness& iClientTest;	
       
   112 };
       
   113 
       
   114 //
       
   115 // This class parses the Pop3Settings section
       
   116 class CBioPop3SettingsSectionParser : public CBaseSectionParser
       
   117 {
       
   118 public:
       
   119 	static CBioPop3SettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
   120 
       
   121 protected:
       
   122 	void LogComment(const TDesC& aComment);
       
   123 	void ConstructL(const TDesC& aNewSectionName);
       
   124 	inline CBioPop3SettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   125 
       
   126 private: 
       
   127 	CClientTestHarness& iClientTest;
       
   128 	CTestScript& iScript;
       
   129 };
       
   130 
       
   131 //
       
   132 // This class parses the Pop3Settings section
       
   133 class CBioPop3NamedSettingsSectionParser : public CBaseSectionParser
       
   134 {
       
   135 public:
       
   136 	static CBioPop3NamedSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   137 
       
   138 protected:
       
   139 	void LogComment(const TDesC& aComment);
       
   140 	void ConstructL(const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   141 	inline CBioPop3NamedSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   142 
       
   143 private: 
       
   144 	CClientTestHarness& iClientTest;
       
   145 	CTestScript& iScript;
       
   146 };
       
   147 
       
   148 //
       
   149 // This class handles the POP3 commands
       
   150 class CBioPop3SettingsCommandsParser : public CBaseCommandParser
       
   151 {
       
   152 public:
       
   153 	void ProcessL();
       
   154 	static CBioPop3SettingsCommandsParser* NewL(CClientTestHarness& aMainTest);
       
   155 private:
       
   156 	void ConstructL();
       
   157 	inline CBioPop3SettingsCommandsParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
   158 	CClientTestHarness& iClientTest;	
       
   159 };
       
   160 
       
   161 //
       
   162 // This class parses the SMTPSettings section
       
   163 class CBioSmtpSettingsSectionParser : public CBaseSectionParser
       
   164 {
       
   165 public:
       
   166 	static CBioSmtpSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
   167 
       
   168 protected:
       
   169 	void LogComment(const TDesC& aComment);
       
   170 	void ConstructL(const TDesC& aNewSectionName);
       
   171 	inline CBioSmtpSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   172 
       
   173 private: 
       
   174 	CClientTestHarness& iClientTest;
       
   175 	CTestScript& iScript;
       
   176 };
       
   177 
       
   178 //
       
   179 // This class parses the SmtpSettings section
       
   180 class CBioSmtpNamedSettingsSectionParser : public CBaseSectionParser
       
   181 {
       
   182 public:
       
   183 	static CBioSmtpNamedSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   184 
       
   185 protected:
       
   186 	void LogComment(const TDesC& aComment);
       
   187 	void ConstructL(const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   188 	inline CBioSmtpNamedSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   189 
       
   190 private: 
       
   191 	CClientTestHarness& iClientTest;
       
   192 	CTestScript& iScript;
       
   193 };
       
   194 
       
   195 
       
   196 //
       
   197 // This class handles the SMTP commands
       
   198 class CBioSmtpSettingsCommandsParser : public CBaseCommandParser
       
   199 {
       
   200 public:
       
   201 	void ProcessL();
       
   202 	static CBioSmtpSettingsCommandsParser* NewL(CClientTestHarness& aMainTest);
       
   203 private:
       
   204 	void ConstructL();
       
   205 	inline CBioSmtpSettingsCommandsParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
   206 	CClientTestHarness& iClientTest;	
       
   207 };
       
   208 
       
   209 
       
   210 //
       
   211 // This class parses the ImapSettings section
       
   212 class CBioImapSettingsSectionParser : public CBaseSectionParser
       
   213 {
       
   214 public:
       
   215 	static CBioImapSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
   216 
       
   217 protected:
       
   218 	void LogComment(const TDesC& aComment);
       
   219 	void ConstructL(const TDesC& aNewSectionName);
       
   220 	inline CBioImapSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   221 
       
   222 private: 
       
   223 	CClientTestHarness& iClientTest;
       
   224 	CTestScript& iScript;
       
   225 };
       
   226 
       
   227 
       
   228 
       
   229 //
       
   230 // This class parses the ImapSettings section
       
   231 class CBioImapNamedSettingsSectionParser : public CBaseSectionParser
       
   232 {
       
   233 public:
       
   234 	static CBioImapNamedSettingsSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   235 
       
   236 protected:
       
   237 	void LogComment(const TDesC& aComment);
       
   238 	void ConstructL(const TDesC& aNewSectionName, const TDesC& aSettingsName);
       
   239 	inline CBioImapNamedSettingsSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   240 
       
   241 private: 
       
   242 	CClientTestHarness& iClientTest;
       
   243 	CTestScript& iScript;
       
   244 };
       
   245 
       
   246 
       
   247 //
       
   248 // This class handles the Imap commands
       
   249 class CBioImapSettingsCommandsParser : public CBaseCommandParser
       
   250 {
       
   251 public:
       
   252 	void ProcessL();
       
   253 	static CBioImapSettingsCommandsParser* NewL(CClientTestHarness& aMainTest);
       
   254 private:
       
   255 	void ConstructL();
       
   256 	inline CBioImapSettingsCommandsParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
   257 	CClientTestHarness& iClientTest;	
       
   258 };
       
   259 
       
   260 //
       
   261 // This class parses the CommDB section
       
   262 class CBioCommDBSectionParser : public CBaseSectionParser
       
   263 {
       
   264 public:
       
   265 	static CBioCommDBSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aTableName, const TDesC& aNewSectionName);
       
   266 	void SectionFinishedL(TTestDebugInfo& aDebugInfo);
       
   267 
       
   268 protected:
       
   269 	void LogComment(const TDesC& aComment);
       
   270 	void ConstructL(const TDesC& aTableName, const TDesC& aNewSectionName);
       
   271 	inline CBioCommDBSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   272 
       
   273 private: 
       
   274 	CClientTestHarness& iClientTest;
       
   275 	CTestScript& iScript;
       
   276 };
       
   277 
       
   278 //
       
   279 // This class handles the CommDB commands
       
   280 class CBioCommDBCommandParser : public CBaseCommandParser
       
   281 {
       
   282 public:
       
   283 	void ProcessL();
       
   284 	static CBioCommDBCommandParser* NewL(CClientTestHarness& aMainTest, const TDesC& aTableName);
       
   285 	void SectionFinishedL(TTestDebugInfo& aDebugInfo);
       
   286 
       
   287 private:
       
   288 	void ConstructL();
       
   289 	inline CBioCommDBCommandParser(CClientTestHarness& aClientTest, const TDesC& aTableName) : iClientTest(aClientTest), iTableName(aTableName) {}
       
   290 
       
   291 private:
       
   292 	CClientTestHarness& iClientTest;
       
   293 	TBuf<50> iTableName;
       
   294 };
       
   295 
       
   296 //
       
   297 // This class parses the gen_msg_from_section section
       
   298 class CBioGenMsgCommandParser;
       
   299 class CBioGenMsgSectionParser : public CBaseSectionParser
       
   300 {
       
   301 public:
       
   302 	static CBioGenMsgSectionParser* NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
   303 	void SectionFinishedL();
       
   304 
       
   305 protected:
       
   306 	void LogComment(const TDesC& aComment);
       
   307 	void ConstructL(const TDesC& aNewSectionName);
       
   308 	inline CBioGenMsgSectionParser(CClientTestHarness& aTest, CTestScript& aScript) : CBaseSectionParser(aScript), iClientTest(aTest), iScript(aScript) {}
       
   309 
       
   310 private: 
       
   311 	CClientTestHarness& iClientTest;
       
   312 	CTestScript& iScript;
       
   313 	CBioGenMsgCommandParser* iCmdParser;	// Created, but NOT owned by us.
       
   314 };
       
   315 
       
   316 //
       
   317 // This class parses the commands in the gen_msg_from_section section
       
   318 class CBioGenMsgCommandParser : public CBaseCommandParser
       
   319 {
       
   320 public:
       
   321 	void ProcessL();
       
   322 	static CBioGenMsgCommandParser* NewL(CClientTestHarness& aMainTest);
       
   323 	void SectionFinishedL();
       
   324 
       
   325 private:
       
   326 	void ConstructL();
       
   327 	inline CBioGenMsgCommandParser(CClientTestHarness& aClientTest) : iClientTest(aClientTest) {}
       
   328 	inline ~CBioGenMsgCommandParser() { delete iBuffer; }
       
   329 
       
   330 private:
       
   331 	CClientTestHarness& iClientTest;
       
   332 	HBufC* iBuffer;
       
   333 	TBIOMessageType iMsgType;
       
   334 };
       
   335 
       
   336 #endif