⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xbl_tokenizer.h

📁 手机浏览器源码程序,功能强大
💻 H
字号:
#include "xml/xml_tokenizer.h"

namespace XBL {

class XBLPrototypeBinding;
class XBLPrototypeHandler;
class XBLPrototypeImplementation;
class XBLPrototypeMember;
class XBLPrototypeMethod;
class XBLPrototypeParameter;
class XBLPrototypeProperty;
class XBLPrototypeField;
class XBLPrototypeConstructor;
class XBLPrototypeDestructor;
class XBLDocument;

// This class is used to handle tokens returned from an XML parser for the purpose of building the
// custom data structures required by an XBL document.
class XBLTokenHandler: public khtml::XMLHandler
{
typedef enum {
    eXBL_InDocument,
    eXBL_InBinding,
    eXBL_InResources,
    eXBL_InImplementation,
    eXBL_InHandlers,
    eXBL_InContent
} XBLPrimaryState;

typedef enum {
    eXBL_None,
    eXBL_InHandler,
    eXBL_InMethod,
    eXBL_InProperty,
    eXBL_InField,
    eXBL_InBody,
    eXBL_InGetter,
    eXBL_InSetter,
    eXBL_InConstructor,
    eXBL_InDestructor
} XBLSecondaryState;

public:
    XBLTokenHandler(DOM::DocumentPtr *_doc);
    ~XBLTokenHandler();
    
    XBLDocumentImpl* xblDocument() const;
    
    // Overrides from XMLTokenizer
    bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, 
                      const QXmlAttributes& attrs);
    bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName);
    bool characters(const QString& ch);

protected:
    // Helper methods.
    void createBinding();
    void createHandler(const QXmlAttributes& attrs);
    void createResource(const QString& localName, const QXmlAttributes& attrs);
    void createImplementation(const QXmlAttributes& attrs);
    void createConstructor();
    void createDestructor();
    void createField(const QXmlAttributes& attrs);
    void createProperty(const QXmlAttributes& attrs);
    void createMethod(const QXmlAttributes& attrs);
    void createParameter(const QXmlAttributes& attrs);

    void addMember(XBLPrototypeMember* member);

private:
    XBLPrimaryState m_state;
    XBLSecondaryState m_secondaryState;
    
    XBLPrototypeBinding* m_binding;
    XBLPrototypeHandler* m_handler;
    XBLPrototypeImplementation* m_implementation;
    XBLPrototypeMember* m_member;
    XBLPrototypeProperty* m_property;
    XBLPrototypeMethod* m_method;
    XBLPrototypeField* m_field;
};

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -