WPXPropertyList.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwpd
00003  * Copyright (C) 2004 William Lachance (wrlach@gmail.com)
00004  * Copyright (C) 2005 Net Integration Technologies (http://www.net-itech.com)
00005  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00020  *
00021  * For further information visit http://libwpd.sourceforge.net
00022  */
00023 
00024 /* "This product is not manufactured, approved, or supported by
00025  * Corel Corporation or Corel Corporation Limited."
00026  */
00027 
00028 #ifndef WPXPROPERTYLIST_H
00029 #define WPXPROPERTYLIST_H
00030 #include "WPXProperty.h"
00031 
00032 // we use the pimpl pattern so we don't expose any STL symbols to the rest of
00033 // the world.. yes, this is quite annoying.
00034 
00035 class WPXMapImpl;
00036 class WPXMapIterImpl;
00037 
00038 class WPXPropertyList
00039 {
00040 public:
00041         WPXPropertyList();
00042         WPXPropertyList(const WPXPropertyList &);
00043         virtual ~WPXPropertyList();
00044         void insert(const char *name, WPXProperty *prop);
00045         void insert(const char *name, const char *val);
00046         void insert(const char *name, const int val);
00047         void insert(const char *name, const bool val);
00048         void insert(const char *name, const WPXString &val);
00049         void insert(const char *name, const double val, const WPXUnit units = WPX_INCH);
00050 
00051         void remove(const char *name);
00052         const WPXProperty *operator[](const char *name) const;
00053         const WPXPropertyList &operator=(const WPXPropertyList &propList);
00054         void clear();
00055 
00056         class Iter
00057         {
00058         public:
00059                 Iter(const WPXPropertyList &propList);
00060                 virtual ~Iter();
00061                 void rewind();
00062                 bool next();
00063                 bool last();
00064                 const WPXProperty *operator()() const;
00065                 const char *key();
00066         private:
00067                 WPXMapIterImpl *m_iterImpl;
00068                 Iter(const Iter &);
00069                 Iter &operator=(const Iter &);
00070         };
00071         friend class WPXPropertyList::Iter;
00072 
00073 private:
00074         mutable WPXMapImpl *m_mapImpl;
00075 };
00076 #endif /* WPXPROPERTYLIST_H */
00077 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */