00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource Program Utilities 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef EV_UNIXTOOLBAR_H 00023 #define EV_UNIXTOOLBAR_H 00024 00025 #include <gtk/gtk.h> 00026 #include "ut_types.h" 00027 #include "ut_vector.h" 00028 #include "xap_Types.h" 00029 #include "ev_Toolbar.h" 00030 #include "xav_Listener.h" 00031 #include "ap_Toolbar_Id.h" 00032 #include "ap_UnixToolbar_StyleCombo.h" 00033 #include "xap_FontPreview.h" 00034 00035 class XAP_UnixApp; 00036 class XAP_Frame; 00037 class EV_UnixToolbar_ViewListener; 00038 00039 class _wd; 00040 00041 class EV_UnixToolbar : public EV_Toolbar 00042 { 00043 public: 00044 EV_UnixToolbar(XAP_UnixApp * pUnixApp, 00045 XAP_Frame *pFrame, 00046 const char * szToolbarLayoutName, 00047 const char * szToolbarLabelSetName); 00048 00049 virtual ~EV_UnixToolbar(void); 00050 00051 bool toolbarEvent(_wd * wd, const UT_UCSChar * pData, UT_uint32 dataLength); 00052 virtual bool synthesize(void); 00053 bool bindListenerToView(AV_View * pView); 00054 virtual bool refreshToolbar(AV_View * pView, AV_ChangeMask mask); 00055 virtual bool repopulateStyles(void); 00056 UT_sint32 destroy(void); 00057 void rebuildToolbar(UT_sint32 oldpos); 00058 XAP_UnixApp * getApp(void); 00059 XAP_Frame * getFrame(void); 00060 void setCurrentEvent(GdkEvent * event) {m_eEvent = event;} 00061 virtual void show(void); 00062 virtual void hide(void); 00063 00064 XAP_FontPreview * m_pFontPreview; 00065 gint m_pFontPreviewPositionX; 00066 protected: 00067 virtual GtkToolbarStyle getStyle(void); 00068 virtual bool getDetachable(void) { return true; } 00069 virtual void setDetachable(gboolean /*detachable*/) { /* only the GNOME version does that ATM */ } 00070 00071 virtual GtkBox* _getContainer(); 00072 00073 void _releaseListener(void); 00074 00075 XAP_UnixApp * m_pUnixApp; 00076 XAP_Frame * m_pFrame; 00077 EV_UnixToolbar_ViewListener * m_pViewListener; 00078 AV_ListenerId m_lid; /* view listener id */ 00079 00080 GdkEvent * m_eEvent; 00081 GtkWidget * m_wToolbar; 00082 GtkSizeGroup * m_wHSizeGroup; 00083 GtkSizeGroup * m_wVSizeGroup; 00084 UT_GenericVector<_wd*> m_vecToolbarWidgets; 00085 }; 00086 00087 #endif /* EV_UNIXTOOLBAR_H */