00001 /* AbiSource Application Framework 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 00021 #ifndef XAP_PREVIEW_H 00022 #define XAP_PREVIEW_H 00023 00024 /* pre-emptive dismissal; ut_types.h is needed by just about everything, 00025 * so even if it's commented out in-file that's still a lot of work for 00026 * the preprocessor to do... 00027 */ 00028 #ifndef UT_TYPES_H 00029 #include "ut_types.h" 00030 #endif 00031 #include "ut_misc.h" 00032 #include "xap_CustomWidget.h" 00033 00034 /* #include "ev_EditBits.h" */ 00035 00036 class GR_Graphics; 00037 00038 class ABI_EXPORT XAP_Preview: public XAP_CustomWidget 00039 { 00040 public: 00041 XAP_Preview(GR_Graphics * gc); 00042 virtual ~XAP_Preview(void); 00043 00044 void setWindowSize(UT_sint32, UT_sint32); 00045 inline UT_sint32 getWindowWidth(void) const { return m_iWindowWidth; }; 00046 inline UT_sint32 getWindowHeight(void) const { return m_iWindowHeight; }; 00047 00048 // we probably don't need this one 00049 /* 00050 inline GR_Graphics * getGraphicsContext(void) const { return m_graphics; }; 00051 */ 00052 00053 // function to handle mouse down event. 00054 virtual void onLeftButtonDown(UT_sint32 /*x*/, UT_sint32 /*y*/) { }; 00055 00056 protected: 00057 XAP_Preview(); 00058 GR_Graphics * m_gc; 00059 00060 private: 00061 // TODO : 00062 // later we might add some useful high-level macro-like drawing functions 00063 // for previews, like drawing page boundaries, etc. 00064 00065 UT_sint32 m_iWindowHeight; 00066 UT_sint32 m_iWindowWidth; 00067 }; 00068 00069 #endif /* XAP_PREVIEW_H */