00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef GR_VECTORIMAGE_H 00021 #define GR_VECTORIMAGE_H 00022 00023 #include "ut_types.h" 00024 #include "gr_Image.h" 00025 00026 class GR_Graphics; 00027 00028 class ABI_EXPORT GR_VectorImage : public GR_Image 00029 { 00030 public: 00031 GR_VectorImage(const char* szName); 00032 GR_VectorImage(); 00033 virtual ~GR_VectorImage(); 00034 00035 virtual bool convertToBuffer(UT_ConstByteBufPtr & ppBB) const; 00036 virtual bool convertFromBuffer(const UT_ConstByteBufPtr & pBB, const std::string& mimetype, 00037 UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight); 00038 00039 virtual GR_Image * createImageSegment(GR_Graphics * /*pG*/, 00040 const UT_Rect & /*rec*/) 00041 // TODO: we need createImageSegment for converting inline images to positioned images 00042 // via the context menu 00043 { UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED) ; return NULL; } 00044 00045 virtual GRType getType() const { return GRT_Vector; } 00046 virtual bool render(GR_Graphics *pGR, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight); 00047 virtual bool hasAlpha(void) const; 00048 virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y); 00049 00050 private: 00051 UT_ConstByteBufPtr m_pBB_Image; 00052 }; 00053 00054 #endif /* GR_VECTORIMAGE */