| 1 |
/* AbiSource Application Framework |
| 2 |
* Copyright (C) 1998 AbiSource, Inc. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
|
| 21 |
#ifndef XAP_MENU_LAYOUTS_H |
| 22 |
#define XAP_MENU_LAYOUTS_H |
| 23 |
|
| 24 |
#include "ev_Menu_Layouts.h" |
| 25 |
/* #include "ev_Menu_Labels.h" */ |
| 26 |
#include "ev_EditBits.h" |
| 27 |
#include "xap_Features.h" |
| 28 |
|
| 29 |
class EV_Menu_LabelSet; |
| 30 |
|
| 31 |
class XAP_App; |
| 32 |
class XAP_StringSet; |
| 33 |
|
| 34 |
class ABI_EXPORT XAP_Menu_Factory |
| 35 |
{ |
| 36 |
public: |
| 37 |
|
| 38 |
XAP_Menu_Factory(XAP_App * pApp); |
| 39 |
~XAP_Menu_Factory(void); |
| 40 |
EV_Menu_Layout * CreateMenuLayout(const char * szName); |
| 41 |
const char * FindContextMenu(EV_EditMouseContext emc); |
| 42 |
XAP_Menu_Id addNewMenuAfter(const char * szMenu, |
| 43 |
const char * szLanguage, |
| 44 |
const XAP_Menu_Id afterID, |
| 45 |
EV_Menu_LayoutFlags flags, |
| 46 |
XAP_Menu_Id newID = 0); |
| 47 |
XAP_Menu_Id addNewMenuAfter(const char * szMenu, |
| 48 |
const char * szLanguage, |
| 49 |
const char * szAfter, |
| 50 |
EV_Menu_LayoutFlags flags, |
| 51 |
XAP_Menu_Id menuID = 0); |
| 52 |
XAP_Menu_Id addNewMenuBefore(const char * szMenu, |
| 53 |
const char * szLanguage, |
| 54 |
const XAP_Menu_Id beforeID, |
| 55 |
EV_Menu_LayoutFlags flags, |
| 56 |
XAP_Menu_Id newID = 0); |
| 57 |
XAP_Menu_Id addNewMenuBefore(const char * szMenu, |
| 58 |
const char * szLanguage, |
| 59 |
const char * szBefore, |
| 60 |
EV_Menu_LayoutFlags flags, XAP_Menu_Id menuID = 0); |
| 61 |
XAP_Menu_Id getNewID(void); |
| 62 |
XAP_Menu_Id removeMenuItem(const char * szMenu, |
| 63 |
const char * szLanguage, |
| 64 |
XAP_Menu_Id nukeID); |
| 65 |
XAP_Menu_Id removeMenuItem(const char * szMenu, |
| 66 |
const char * szLanguage, |
| 67 |
const char * szNuke); |
| 68 |
void resetMenusToDefault(void); |
| 69 |
UT_uint32 GetMenuLabelSetLanguageCount(void); |
| 70 |
const char * GetNthMenuLabelLanguageName(UT_uint32 ndx); |
| 71 |
EV_Menu_LabelSet * CreateMenuLabelSet(const char * szLanguage_); |
| 72 |
bool buildMenuLabelSet(const char * szLanguage_); |
| 73 |
bool buildBuiltInMenuLabelSet( EV_Menu_LabelSet *& pLabelSet); |
| 74 |
bool addNewLabel(const char * szMenu, |
| 75 |
XAP_Menu_Id newID, |
| 76 |
const char * szNewLabel, |
| 77 |
const char * szNewTooltip); |
| 78 |
bool removeLabel(const char * szMenu, |
| 79 |
XAP_Menu_Id nukeID); |
| 80 |
|
| 81 |
void resetLabelsToDefault(void); |
| 82 |
|
| 83 |
EV_EditMouseContext createContextMenu(const char * szMenu); |
| 84 |
void removeContextMenu(EV_EditMouseContext menuID); |
| 85 |
|
| 86 |
private: |
| 87 |
|
| 88 |
mutable UT_Vector m_vecTT; |
| 89 |
XAP_App * m_pApp; |
| 90 |
EV_Menu_LabelSet * m_pLabelSet; |
| 91 |
EV_Menu_LabelSet * m_pEnglishLabelSet; |
| 92 |
XAP_Menu_Id m_maxID; |
| 93 |
XAP_StringSet * m_pBSS; |
| 94 |
EV_EditMouseContext m_NextContext; |
| 95 |
}; |
| 96 |
#endif /* XAP_MENU_LAYOUTS_H */ |