Eneboo - Documentación para desarrolladores
|
00001 /* 00002 odf-gen: Simple API to generate OpenDocument documents. 00003 Copyright (C) 2009 Pablo Jorge, FuDePAN 00004 00005 This file is part of the odf-gen project. 00006 00007 odf-gen is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 odf-gen 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 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with odf-gen. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef IMAGE_H 00022 #define IMAGE_H 00023 00024 #include <iostream> 00025 00026 #include "odstype.h" 00027 #include "length.h" 00028 00029 class Image 00030 { 00031 public: 00032 Image( const std::string &name, 00033 const Length &width, 00034 const Length &height, 00035 const Length &x, 00036 const Length &y, 00037 const std::string &link ) 00038 : _name( name ), 00039 _width( width.str() ), 00040 _height( height.str() ), 00041 _x( x.str() ), 00042 _y( y.str() ), 00043 _link( link ) 00044 {} 00045 00046 std::ostream& operator << ( std::ostream& ostream ) const 00047 { 00048 ostream << "<image name=\"" << _name << "\"" 00049 << " width=\"" << _width << "\"" 00050 << " height=\"" << _height << "\"" 00051 << " x=\"" << _x << "\"" 00052 << " y=\"" << _y << "\"" 00053 << " link=\"" << _link << "\"" 00054 << ">" 00055 << "</image>"; 00056 return ostream; 00057 } 00058 00059 private: 00060 std::string _name, 00061 _width, 00062 _height, 00063 _x, 00064 _y, 00065 _link; 00066 }; 00067 00068 MAP_ODS_TYPE(Image, image); 00069 00070 inline 00071 std::ostream& operator << ( std::ostream &ostream, 00072 const Image& image ) 00073 { 00074 return image.operator << (ostream); 00075 } 00076 00077 #endif // IMAGE_H