00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* librevenge 00003 * Version: MPL 2.0 / LGPLv2.1+ 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 * Major Contributor(s): 00010 * Copyright (C) 2004 William Lachance (wrlach@gmail.com) 00011 * 00012 * For minor contributions see the git repository. 00013 * 00014 * Alternatively, the contents of this file may be used under the terms 00015 * of the GNU Lesser General Public License Version 2.1 or later 00016 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00017 * applicable instead of those above. 00018 */ 00019 00020 #ifndef RVNGPROPERTY_H 00021 #define RVNGPROPERTY_H 00022 00023 #include "librevenge-api.h" 00024 00025 #include "RVNGString.h" 00026 00027 namespace librevenge 00028 { 00029 00030 enum RVNGUnit { RVNG_INCH, RVNG_PERCENT, RVNG_POINT, RVNG_TWIP, RVNG_GENERIC, RVNG_UNIT_ERROR }; 00031 00032 class REVENGE_API RVNGProperty 00033 { 00034 public: 00035 virtual ~RVNGProperty(); 00036 virtual int getInt() const = 0; 00037 virtual double getDouble() const = 0; 00039 virtual RVNGUnit getUnit() const = 0; 00040 virtual RVNGString getStr() const = 0; 00041 virtual RVNGProperty *clone() const = 0; 00042 }; 00043 00044 class REVENGE_API RVNGPropertyFactory 00045 { 00046 public: 00047 static RVNGProperty *newStringProp(const RVNGString &str); 00048 static RVNGProperty *newStringProp(const char *str); 00049 static RVNGProperty *newBinaryDataProp(const RVNGBinaryData &data); 00050 static RVNGProperty *newBinaryDataProp(const unsigned char *buffer, 00051 const unsigned long bufferSize); 00052 static RVNGProperty *newIntProp(const int val); 00053 static RVNGProperty *newBoolProp(const bool val); 00054 static RVNGProperty *newDoubleProp(const double val); 00055 static RVNGProperty *newInchProp(const double val); 00056 static RVNGProperty *newPercentProp(const double val); 00057 static RVNGProperty *newPointProp(const double val); 00058 static RVNGProperty *newTwipProp(const double val); 00059 }; 00060 00061 } 00062 00063 #endif /* RVNGPROPERTY_H */ 00064 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */