00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libetonyek project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 */ 00009 00010 #ifndef KEY2STYLEPARSER_H_INCLUDED 00011 #define KEY2STYLEPARSER_H_INCLUDED 00012 00013 #include "KEY2ParserUtils.h" 00014 #include "KEYPropertyMap.h" 00015 #include "KEYTypes_fwd.h" 00016 00017 namespace libetonyek 00018 { 00019 00020 class KEYCollector; 00021 class KEYDefaults; 00022 class KEYXMLReader; 00023 00024 class KEY2StyleParser : private KEY2ParserUtils 00025 { 00026 // disable copying 00027 KEY2StyleParser(const KEY2StyleParser &other); 00028 KEY2StyleParser &operator=(const KEY2StyleParser &other); 00029 00030 public: 00031 KEY2StyleParser(int nameId, int nsId, KEYCollector *collector, const KEYDefaults &defaults, bool nested = false); 00032 00033 void parse(const KEYXMLReader &reader); 00034 00035 private: 00036 void parseProperty(const KEYXMLReader &reader, const char *key = 0); 00037 00047 bool parsePropertyImpl(const KEYXMLReader &reader, const int propertyId, const char *key); 00048 00049 void parsePropertyMap(const KEYXMLReader &reader); 00050 00051 KEYGeometryPtr_t readGeometry(const KEYXMLReader &reader); 00052 00053 private: 00054 const int m_nameId; 00055 const int m_nsId; 00056 const bool m_nested; 00057 KEYCollector *const m_collector; 00058 const KEYDefaults &m_defaults; 00059 KEYPropertyMap m_props; 00060 }; 00061 00062 } 00063 00064 #endif // KEY2STYLEPARSER_H_INCLUDED 00065 00066 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */