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

ev_Menu.h

Go to the documentation of this file.
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_MENU_H
00021 #define EV_MENU_H
00022 
00023 /*****************************************************************/
00024 /*****************************************************************/
00025 /*****************************************************************/
00026 /*****************************************************************/
00027 
00028 #include "ut_types.h"
00029 #include "xap_Types.h"
00030 
00031 class EV_EditMethodContainer;
00032 class EV_EditMethod;
00033 class EV_Menu_Layout;
00034 class EV_Menu_LabelSet;
00035 class EV_Menu_Action;
00036 class EV_Menu_Label;
00037 class AV_View;
00038 class XAP_App;
00039 class XAP_Frame;
00040 class UT_String;
00041 
00042 class ABI_EXPORT EV_Menu
00043 {
00044 public:
00045     EV_Menu(XAP_App* pApp,
00046             EV_EditMethodContainer * pEMC,
00047             const char * szMenuLayoutName,
00048             const char * szMenuLanguageName);
00049     virtual ~EV_Menu();
00050 
00051     bool invokeMenuMethod(AV_View * pView,
00052                           EV_EditMethod * pEM,
00053                           UT_UCSChar * pData,
00054                           UT_uint32 dataLength);
00055 
00056     bool invokeMenuMethod(AV_View* pView,
00057                           EV_EditMethod* pEM,
00058                           const UT_String& szScriptName);
00059 
00060     const EV_Menu_Layout *      getLayout() const { return m_pMenuLayout; }
00061     const EV_Menu_LabelSet *    getLabelSet() const { return m_pMenuLabelSet; }
00062     EV_Menu_Layout *            getLayout() { return m_pMenuLayout; }
00063     EV_Menu_LabelSet *          getLabelSet() { return m_pMenuLabelSet; }
00064 
00065     XAP_Menu_Id                 addMenuItem(const UT_String& path, const UT_String& description);
00066 
00067 protected:
00068     const char **               getLabelName(XAP_App * pApp,
00069                                              const EV_Menu_Action * pAction, const EV_Menu_Label * pLabel);
00070     XAP_App *                   getApp() { return m_pApp; }
00071 
00072 // private: TODO: our inherited classes should have no business with our variables!
00073     EV_EditMethodContainer *    m_pEMC;
00074     EV_Menu_Layout *            m_pMenuLayout;  /* abstract ordering of our menu */
00075     EV_Menu_LabelSet *          m_pMenuLabelSet;/* strings (in a given language) for the menu */
00076 
00077 protected:
00078     virtual bool                _doAddMenuItem(UT_uint32 layout_pos) = 0;
00079 
00080 private:
00081     XAP_App *                   m_pApp;
00082 };
00083 
00084 XAP_Menu_Id EV_searchMenuLabel(const EV_Menu_LabelSet* labels, const UT_String &label);
00085 
00086 #endif /* EV_MENU_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1