removed nsDefaultTokenHandler.*

git-svn-id: svn://10.0.0.236/trunk@1150 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg
1998-05-05 20:25:19 +00:00
parent 96958337e4
commit ed863f453a
4 changed files with 0 additions and 1604 deletions

View File

@@ -1,639 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#include "nsDefaultTokenHandler.h"
#include "nsHTMLParser.h"
#include "nsHTMLTokens.h"
#include "nsDebug.h"
static const char* kNullParserGiven = "Error: Null parser given as argument";
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CDefaultTokenHandler::CDefaultTokenHandler(eHTMLTokenTypes aType) {
mType=aType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CDefaultTokenHandler::~CDefaultTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
eHTMLTokenTypes CDefaultTokenHandler::GetTokenType(void){
return mType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CDefaultTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CDefaultTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
PRBool result=PR_FALSE;
if(aParser){
result=PR_TRUE;
}
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStartTokenHandler::CStartTokenHandler() : CDefaultTokenHandler(eToken_start) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStartTokenHandler::~CStartTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStartTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleStartToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStartTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEndTokenHandler::CEndTokenHandler(): CDefaultTokenHandler(eToken_end) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEndTokenHandler::~CEndTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEndTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleEndToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEndTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CCommentTokenHandler::CCommentTokenHandler() : CDefaultTokenHandler(eToken_comment) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CCommentTokenHandler::~CCommentTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CCommentTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleCommentToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CCommentTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEntityTokenHandler::CEntityTokenHandler() : CDefaultTokenHandler(eToken_entity) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEntityTokenHandler::~CEntityTokenHandler() {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEntityTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleEntityToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEntityTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CWhitespaceTokenHandler::CWhitespaceTokenHandler() : CDefaultTokenHandler(eToken_whitespace) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CWhitespaceTokenHandler::~CWhitespaceTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CWhitespaceTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleWhitespaceToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CWhitespaceTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CNewlineTokenHandler::CNewlineTokenHandler() : CDefaultTokenHandler(eToken_newline) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CNewlineTokenHandler::~CNewlineTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CNewlineTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleNewlineToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CNewlineTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTextTokenHandler::CTextTokenHandler() : CDefaultTokenHandler(eToken_text) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTextTokenHandler::~CTextTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CTextTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleTextToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CTextTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CAttributeTokenHandler::CAttributeTokenHandler() : CDefaultTokenHandler(eToken_attribute) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CAttributeTokenHandler::~CAttributeTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CAttributeTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleAttributeToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CAttributeTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CScriptTokenHandler::CScriptTokenHandler() : CDefaultTokenHandler(eToken_script) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CScriptTokenHandler::~CScriptTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CScriptTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleScriptToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CScriptTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStyleTokenHandler::CStyleTokenHandler() : CDefaultTokenHandler(eToken_style) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStyleTokenHandler::~CStyleTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStyleTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleStyleToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStyleTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CSkippedContentTokenHandler::CSkippedContentTokenHandler() : CDefaultTokenHandler(eToken_skippedcontent) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CSkippedContentTokenHandler::~CSkippedContentTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CSkippedContentTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleSkippedContentToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CSkippedContentTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}

View File

@@ -1,163 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#ifndef CDEFAULTTOKENHANDLER__
#define CDEFAULTTOKENHANDLER__
#include "prtypes.h"
#include "nsString.h"
#include "nsHTMLTokens.h"
#include "nsITokenHandler.h"
class CToken;
class nsHTMLParser;
class CDefaultTokenHandler : public CITokenHandler {
public:
CDefaultTokenHandler(eHTMLTokenTypes aType=eToken_unknown);
virtual ~CDefaultTokenHandler();
virtual eHTMLTokenTypes GetTokenType(void);
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
protected:
eHTMLTokenTypes mType;
};
class CStartTokenHandler : public CDefaultTokenHandler {
public:
CStartTokenHandler();
virtual ~CStartTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CEndTokenHandler : public CDefaultTokenHandler {
public:
CEndTokenHandler();
virtual ~CEndTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CCommentTokenHandler : public CDefaultTokenHandler {
public:
CCommentTokenHandler();
virtual ~CCommentTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CEntityTokenHandler : public CDefaultTokenHandler {
public:
CEntityTokenHandler();
virtual ~CEntityTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CWhitespaceTokenHandler : public CDefaultTokenHandler {
public:
CWhitespaceTokenHandler();
virtual ~CWhitespaceTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CNewlineTokenHandler : public CDefaultTokenHandler {
public:
CNewlineTokenHandler();
virtual ~CNewlineTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CTextTokenHandler : public CDefaultTokenHandler {
public:
CTextTokenHandler();
virtual ~CTextTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CAttributeTokenHandler : public CDefaultTokenHandler {
public:
CAttributeTokenHandler();
virtual ~CAttributeTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CScriptTokenHandler : public CDefaultTokenHandler {
public:
CScriptTokenHandler();
virtual ~CScriptTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CStyleTokenHandler : public CDefaultTokenHandler {
public:
CStyleTokenHandler();
virtual ~CStyleTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CSkippedContentTokenHandler : public CDefaultTokenHandler {
public:
CSkippedContentTokenHandler();
virtual ~CSkippedContentTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
#endif

View File

@@ -1,639 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#include "nsDefaultTokenHandler.h"
#include "nsHTMLParser.h"
#include "nsHTMLTokens.h"
#include "nsDebug.h"
static const char* kNullParserGiven = "Error: Null parser given as argument";
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CDefaultTokenHandler::CDefaultTokenHandler(eHTMLTokenTypes aType) {
mType=aType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CDefaultTokenHandler::~CDefaultTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
eHTMLTokenTypes CDefaultTokenHandler::GetTokenType(void){
return mType;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CDefaultTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CDefaultTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
PRBool result=PR_FALSE;
if(aParser){
result=PR_TRUE;
}
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStartTokenHandler::CStartTokenHandler() : CDefaultTokenHandler(eToken_start) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStartTokenHandler::~CStartTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStartTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleStartToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStartTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEndTokenHandler::CEndTokenHandler(): CDefaultTokenHandler(eToken_end) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEndTokenHandler::~CEndTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEndTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleEndToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEndTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CCommentTokenHandler::CCommentTokenHandler() : CDefaultTokenHandler(eToken_comment) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CCommentTokenHandler::~CCommentTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CCommentTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleCommentToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CCommentTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEntityTokenHandler::CEntityTokenHandler() : CDefaultTokenHandler(eToken_entity) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CEntityTokenHandler::~CEntityTokenHandler() {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEntityTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleEntityToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CEntityTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CWhitespaceTokenHandler::CWhitespaceTokenHandler() : CDefaultTokenHandler(eToken_whitespace) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CWhitespaceTokenHandler::~CWhitespaceTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CWhitespaceTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleWhitespaceToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CWhitespaceTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CNewlineTokenHandler::CNewlineTokenHandler() : CDefaultTokenHandler(eToken_newline) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CNewlineTokenHandler::~CNewlineTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CNewlineTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleNewlineToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CNewlineTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTextTokenHandler::CTextTokenHandler() : CDefaultTokenHandler(eToken_text) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CTextTokenHandler::~CTextTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CTextTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleTextToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CTextTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CAttributeTokenHandler::CAttributeTokenHandler() : CDefaultTokenHandler(eToken_attribute) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CAttributeTokenHandler::~CAttributeTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CAttributeTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleAttributeToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CAttributeTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CScriptTokenHandler::CScriptTokenHandler() : CDefaultTokenHandler(eToken_script) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CScriptTokenHandler::~CScriptTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CScriptTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleScriptToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CScriptTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStyleTokenHandler::CStyleTokenHandler() : CDefaultTokenHandler(eToken_style) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CStyleTokenHandler::~CStyleTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStyleTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleStyleToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CStyleTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CSkippedContentTokenHandler::CSkippedContentTokenHandler() : CDefaultTokenHandler(eToken_skippedcontent) {
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
CSkippedContentTokenHandler::~CSkippedContentTokenHandler(){
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CSkippedContentTokenHandler::operator()(CToken* aToken,nsHTMLParser* aParser){
NS_ASSERTION(0!=aParser,kNullParserGiven);
if(aParser){
return aParser->HandleSkippedContentToken(aToken);
}
return PR_FALSE;
}
/**
*
*
* @update gess 4/2/98
* @param
* @return
*/
PRBool CSkippedContentTokenHandler::CanHandle(eHTMLTokenTypes aType){
PRBool result=PR_FALSE;
return result;
}

View File

@@ -1,163 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
*/
#ifndef CDEFAULTTOKENHANDLER__
#define CDEFAULTTOKENHANDLER__
#include "prtypes.h"
#include "nsString.h"
#include "nsHTMLTokens.h"
#include "nsITokenHandler.h"
class CToken;
class nsHTMLParser;
class CDefaultTokenHandler : public CITokenHandler {
public:
CDefaultTokenHandler(eHTMLTokenTypes aType=eToken_unknown);
virtual ~CDefaultTokenHandler();
virtual eHTMLTokenTypes GetTokenType(void);
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
protected:
eHTMLTokenTypes mType;
};
class CStartTokenHandler : public CDefaultTokenHandler {
public:
CStartTokenHandler();
virtual ~CStartTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CEndTokenHandler : public CDefaultTokenHandler {
public:
CEndTokenHandler();
virtual ~CEndTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CCommentTokenHandler : public CDefaultTokenHandler {
public:
CCommentTokenHandler();
virtual ~CCommentTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CEntityTokenHandler : public CDefaultTokenHandler {
public:
CEntityTokenHandler();
virtual ~CEntityTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CWhitespaceTokenHandler : public CDefaultTokenHandler {
public:
CWhitespaceTokenHandler();
virtual ~CWhitespaceTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CNewlineTokenHandler : public CDefaultTokenHandler {
public:
CNewlineTokenHandler();
virtual ~CNewlineTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CTextTokenHandler : public CDefaultTokenHandler {
public:
CTextTokenHandler();
virtual ~CTextTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CAttributeTokenHandler : public CDefaultTokenHandler {
public:
CAttributeTokenHandler();
virtual ~CAttributeTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CScriptTokenHandler : public CDefaultTokenHandler {
public:
CScriptTokenHandler();
virtual ~CScriptTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CStyleTokenHandler : public CDefaultTokenHandler {
public:
CStyleTokenHandler();
virtual ~CStyleTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
class CSkippedContentTokenHandler : public CDefaultTokenHandler {
public:
CSkippedContentTokenHandler();
virtual ~CSkippedContentTokenHandler();
virtual PRBool operator()(CToken* aToken,nsHTMLParser* aParser);
virtual PRBool CanHandle(eHTMLTokenTypes aType);
};
#endif