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

ev_Toolbar_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_TOOLBAR_LAYOUTS_H
00023 #define EV_TOOLBAR_LAYOUTS_H
00024 
00025 #include "ut_types.h"
00026 #include "xap_Types.h"
00027 
00028 
00029 /*****************************************************************
00030 ******************************************************************
00031 ** This file defines the basis for defining a toolbar layout.  A
00032 ** toolbar layout describes the actual items and their ordering
00033 ** for a specific toolbar.  With this we can do things like have
00034 ** simple (novice) or complex (expert) toolbars for a window and/or
00035 ** have different toolbars for different types of windows (such as
00036 ** normal-view vs outline-view vs page-preview-view).
00037 ******************************************************************
00038 *****************************************************************/
00039 
00040 typedef enum _ev_Toolbar_LayoutFlags
00041 {
00042     EV_TLF_Normal,
00043     EV_TLF_Spacer
00044 
00045 } EV_Toolbar_LayoutFlags;
00046 
00047 /*****************************************************************/
00048 
00049 class ABI_EXPORT EV_Toolbar_LayoutItem
00050 {
00051 public:
00052     EV_Toolbar_LayoutItem(XAP_Toolbar_Id id, EV_Toolbar_LayoutFlags flags);
00053     ~EV_Toolbar_LayoutItem(void);
00054 
00055     XAP_Toolbar_Id              getToolbarId(void) const;
00056     EV_Toolbar_LayoutFlags      getToolbarLayoutFlags(void) const;
00057 
00058 protected:
00059     XAP_Toolbar_Id              m_id;
00060     EV_Toolbar_LayoutFlags      m_flags;
00061 };
00062 
00063 /*****************************************************************/
00064 
00065 class ABI_EXPORT EV_Toolbar_Layout                  /* a glorified array with bounds checking */
00066 {
00067 public:
00068     EV_Toolbar_Layout(const char * szName, UT_uint32 nrLayoutItems);
00069     EV_Toolbar_Layout(EV_Toolbar_Layout * pTB);
00070     ~EV_Toolbar_Layout(void);
00071 
00072     bool                        setLayoutItem(UT_uint32 indexLayoutItem,
00073                                               XAP_Toolbar_Id id, EV_Toolbar_LayoutFlags flags);
00074     EV_Toolbar_LayoutItem *     getLayoutItem(UT_uint32 indexLayoutItem) const;
00075     const char *                getName(void) const;
00076     UT_uint32                   getLayoutItemCount(void) const;
00077 
00078 protected:
00079     char *                      m_szName;           /* the name of our layout (like "MainToolbar") */
00080     UT_uint32                   m_nrLayoutItems;
00081     EV_Toolbar_LayoutItem **    m_layoutTable;
00082 };
00083 
00084 #endif /* EV_TOOLBAR_LAYOUTS_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1