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

ev_Menu_Layouts.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 
00021 
00022 #ifndef EV_MENU_LAYOUTS_H
00023 #define EV_MENU_LAYOUTS_H
00024 
00025 #include "ut_types.h"
00026 #include "xap_Types.h"
00027 #include "ut_vector.h"
00028 #include "ut_string_class.h"
00029 
00030 /*****************************************************************
00031 ******************************************************************
00032 ** This file defines the basis for defining a menu layout.  A
00033 ** menu layout describes the actual items and their ordering
00034 ** for a specific menu.  With this we can do things like have
00035 ** simple (novice) or complex (expert) menus for a window and/or
00036 ** have different menus for different types of windows (such as
00037 ** normal-view vs outline-view vs page-preview-view).
00038 ******************************************************************
00039 *****************************************************************/
00040 
00041 typedef enum _ev_Menu_LayoutFlags
00042 {
00043     EV_MLF_Normal,
00044     EV_MLF_BeginSubMenu,
00045     EV_MLF_EndSubMenu,
00046     EV_MLF_BeginPopupMenu,
00047     EV_MLF_EndPopupMenu,
00048     EV_MLF_Separator
00049 
00050 } EV_Menu_LayoutFlags;
00051 
00052 /*****************************************************************/
00053 
00054 class ABI_EXPORT EV_Menu_LayoutItem
00055 {
00056 public:
00057     EV_Menu_LayoutItem(XAP_Menu_Id id, EV_Menu_LayoutFlags flags);
00058     ~EV_Menu_LayoutItem();
00059 
00060     XAP_Menu_Id                     getMenuId() const;
00061     EV_Menu_LayoutFlags             getMenuLayoutFlags() const;
00062 
00063 private:
00064     XAP_Menu_Id                     m_id;
00065     EV_Menu_LayoutFlags             m_flags;
00066 };
00067 
00068 /*****************************************************************/
00069 
00070 class EV_Menu_LabelSet;
00071 
00072 class ABI_EXPORT EV_Menu_Layout                 /* a glorified array with bounds checking */
00073 {
00074 public:
00075     EV_Menu_Layout(const UT_String &szName, UT_uint32 nrLayoutItems);
00076     ~EV_Menu_Layout();
00077 
00078     bool                    setLayoutItem(UT_sint32 indexLayoutItem, XAP_Menu_Id id, EV_Menu_LayoutFlags flags);
00079     XAP_Menu_Id             addLayoutItem(UT_sint32 indexLayoutItem, EV_Menu_LayoutFlags flags);
00080     void                    addFakeLayoutItem(UT_sint32 indexLayoutItem, EV_Menu_LayoutFlags flags);
00081     EV_Menu_LayoutItem *    getLayoutItem(UT_sint32 indexLayoutItem) const;
00082     UT_sint32               getLayoutIndex(XAP_Menu_Id id) const;
00083     const char *            getName() const;
00084     UT_sint32               getLayoutItemCount() const;
00085     inline UT_sint32        size() const { return getLayoutItemCount(); }
00086 
00087 private:
00088     UT_String               m_stName;           /* the name of our layout (like "MainMenu") */
00089     UT_GenericVector <EV_Menu_LayoutItem *> m_layoutTable;
00090     XAP_Menu_Id             m_iMaxId;
00091 };
00092 
00093 #endif /* EV_MENU_LAYOUTS_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1