00001 /* AbiSource Program Utilities 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 EV_TOOLBAR_LABELS_H 00021 #define EV_TOOLBAR_LABELS_H 00022 00023 #include "xap_Types.h" 00024 00025 00026 /***************************************************************** 00027 ****************************************************************** 00028 ** This file defines a framework for the string and image labels 00029 ** which are used with toolbars. This binding allows us to localize 00030 ** toolbars in a platform-independent manner. 00031 ** 00032 ** We create one EV_Toolbar_Label per toolbar-item (such as "File|Open") 00033 ** per language per application (not per window or actual toolbar). 00034 ** 00035 ** We create one EV_Toolbar_LabelSet per language per application. 00036 ** 00037 ****************************************************************** 00038 *****************************************************************/ 00039 00040 // TODO decide if we should make all labels Unicode 00041 00042 class ABI_EXPORT EV_Toolbar_Label 00043 { 00044 public: 00045 EV_Toolbar_Label(XAP_Toolbar_Id id, 00046 const char * szToolbarLabel, /* label on the actual toolbar itself */ 00047 const char * szIconName, /* name of the icon we use */ 00048 const char * szToolTip, /* display message on tool tip */ 00049 const char * szStatusMsg); /* status bar message */ 00050 ~EV_Toolbar_Label(void); 00051 00052 XAP_Toolbar_Id getToolbarId(void) const; 00053 const char * getToolbarLabel(void) const; 00054 const char * getIconName(void) const; 00055 const char * getToolTip(void) const; 00056 const char * getStatusMsg(void) const; 00057 00058 protected: 00059 XAP_Toolbar_Id m_id; 00060 char * m_szToolbarLabel; 00061 char * m_szIconName; 00062 char * m_szToolTip; 00063 char * m_szStatusMsg; 00064 }; 00065 00066 /*****************************************************************/ 00067 00068 class ABI_EXPORT EV_Toolbar_LabelSet /* a glorified array with bounds checking */ 00069 { 00070 public: 00071 EV_Toolbar_LabelSet(const char * szLanguage, 00072 XAP_Toolbar_Id first, XAP_Toolbar_Id last); 00073 ~EV_Toolbar_LabelSet(void); 00074 00075 bool setLabel(XAP_Toolbar_Id id, 00076 const char * szToolbarLabel, 00077 const char * szIconName, 00078 const char * szToolTip, 00079 const char * szStatusMsg); 00080 EV_Toolbar_Label * getLabel(XAP_Toolbar_Id id); 00081 const char * getLanguage(void) const; 00082 void setLanguage(const char * szLanguage); 00083 00084 protected: 00085 EV_Toolbar_Label ** m_labelTable; 00086 XAP_Toolbar_Id m_first; 00087 XAP_Toolbar_Id m_last; 00088 char * m_szLanguage; /* for the convenience of the app only */ 00089 }; 00090 00091 #endif /* EV_TOOLBAR_LABELS_H */