• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

gr_CairoPrintGraphics.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 /* AbiWord
00003  * Copyright (C) 2008 Robert Staudinger
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 #ifndef GR_CAIROPRINTGRAPHICS_H
00022 #define GR_CAIROPRINTGRAPHICS_H
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include "config.h"
00026 #endif
00027 #include <cairo.h>
00028 
00029 #include "gr_UnixCairoGraphics.h"
00030 //
00031 // Device resolution of the PrintGraphics class.
00032 // Set this above that of the screen so we don't lose resolution
00033 // when printing images.
00034 //
00035 #define gr_PRINTRES  144.
00036 
00037 
00038 class ABI_EXPORT GR_CairoPrintGraphics : public GR_UnixCairoGraphicsBase
00039 {
00040     bool m_bDoShowPage;
00041 public:
00042     GR_CairoPrintGraphics(cairo_t *cr, UT_uint32 iDeviceResolution);
00043 
00044     virtual ~GR_CairoPrintGraphics();
00045 
00046     static UT_uint32 s_getClassId() {return GRID_UNIX_PANGO_PRINT;}
00047     virtual UT_uint32 getClassId() {return s_getClassId();}
00048 
00049     virtual GR_Capability  getCapability() {return GRCAP_PRINTER_ONLY;}
00050     static const char *    graphicsDescriptor(){return "Unix Cairo Print";}
00051 
00052     virtual bool queryProperties(GR_Graphics::Properties gp) const;
00053 
00054     virtual bool startPrint(void);
00055     virtual bool startPage(const char * /*szPagelabel*/, UT_uint32 /*pageNumber*/,
00056                            bool /*bPortrait*/, UT_uint32 /*iWidth*/, UT_uint32 /*iHeight*/);
00057     virtual bool endPrint(void);
00058 
00059     virtual void setCursor(GR_Graphics::Cursor /*c*/) { UT_ASSERT_NOT_REACHED(); }
00060     virtual GR_Graphics::Cursor getCursor(void) const { UT_ASSERT_NOT_REACHED(); return GR_CURSOR_INVALID; }
00061     virtual GR_Font * getGUIFont(void);
00062     virtual void setPageSize(char * /*pageSizeName*/, UT_uint32 /*iwidth*/ = 0, UT_uint32 /*iheight*/=0) { UT_ASSERT_NOT_REACHED(); }
00063 
00064     virtual void scroll(UT_sint32, UT_sint32) { UT_ASSERT_NOT_REACHED(); }
00065     virtual void scroll(UT_sint32, UT_sint32, UT_sint32, UT_sint32, UT_sint32, UT_sint32)
00066             { UT_ASSERT_NOT_REACHED(); }
00067 
00068     virtual GR_Image * genImageFromRectangle(const UT_Rect & /*r*/) { UT_ASSERT_NOT_REACHED(); return NULL;}
00069     virtual void      saveRectangle(UT_Rect & /*r*/, UT_uint32 /*iIndx*/) { UT_ASSERT_NOT_REACHED(); }
00070     virtual void      restoreRectangle(UT_uint32 /*iIndx*/) { UT_ASSERT_NOT_REACHED(); }
00071 
00072     double            getResolutionRatio(void) const;
00073     void              setResolutionRatio(double dres);
00074 
00075     virtual bool      canQuickPrint(void) const { return true;}
00076 
00077   protected:
00078 
00079 
00080  private:
00081     double            m_dResRatio;
00082 };
00083 
00084 #endif
00085 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1