| 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_TOOLBAR_LAYOUTS_H |
| 22 |
#define XAP_TOOLBAR_LAYOUTS_H |
| 23 |
|
| 24 |
#include "ut_string_class.h" |
| 25 |
#include "ut_vector.h" |
| 26 |
|
| 27 |
#include "xap_Strings.h" |
| 28 |
|
| 29 |
#include "ev_Toolbar_Layouts.h" |
| 30 |
#include "ev_EditBits.h" |
| 31 |
|
| 32 |
class XAP_App; |
| 33 |
|
| 34 |
EV_Toolbar_Layout * AP_CreateToolbarLayout(const char * szName); |
| 35 |
|
| 36 |
struct ABI_EXPORT XAP_Toolbar_Factory_lt |
| 37 |
{ |
| 38 |
EV_Toolbar_LayoutFlags m_flags; |
| 39 |
XAP_Toolbar_Id m_id; |
| 40 |
}; |
| 41 |
|
| 42 |
struct ABI_EXPORT XAP_Toolbar_Factory_tt |
| 43 |
{ |
| 44 |
const char * m_name; |
| 45 |
XAP_String_Id m_label; |
| 46 |
const gchar* m_prefKey; |
| 47 |
UT_uint32 m_nrEntries; |
| 48 |
XAP_Toolbar_Factory_lt * m_lt; |
| 49 |
}; |
| 50 |
|
| 51 |
class ABI_EXPORT XAP_Toolbar_Factory_vec |
| 52 |
{ |
| 53 |
public: |
| 54 |
XAP_Toolbar_Factory_vec(const char * szName); |
| 55 |
XAP_Toolbar_Factory_vec(XAP_Toolbar_Factory_tt * orig); |
| 56 |
XAP_Toolbar_Factory_vec(EV_Toolbar_Layout * orig); |
| 57 |
~XAP_Toolbar_Factory_vec(); |
| 58 |
UT_uint32 getNrEntries(void); |
| 59 |
void add_lt(XAP_Toolbar_Factory_lt * plt); |
| 60 |
XAP_Toolbar_Factory_lt * getNth_lt(UT_uint32 i); |
| 61 |
void insertLastItem(void * p); |
| 62 |
void insertItemBefore(void * p, XAP_Toolbar_Id id); |
| 63 |
void insertItemAfter(void * p, XAP_Toolbar_Id id); |
| 64 |
bool removeToolbarId(XAP_Toolbar_Id id); |
| 65 |
const char * getToolbarName(void); |
| 66 |
XAP_String_Id getLabelStringID(void); |
| 67 |
const gchar * getPrefKey(void); |
| 68 |
private: |
| 69 |
UT_String m_name; |
| 70 |
XAP_String_Id m_label; |
| 71 |
const gchar* m_prefKey; |
| 72 |
UT_Vector m_Vec_lt; |
| 73 |
}; |
| 74 |
|
| 75 |
class ABI_EXPORT XAP_Toolbar_Factory |
| 76 |
{ |
| 77 |
public: |
| 78 |
|
| 79 |
XAP_Toolbar_Factory(XAP_App * pApp); |
| 80 |
~XAP_Toolbar_Factory(void); |
| 81 |
EV_Toolbar_Layout * CreateToolbarLayout(const char * szName); |
| 82 |
EV_Toolbar_Layout * DuplicateToolbarLayout(const char * szName); |
| 83 |
void restoreToolbarLayout( EV_Toolbar_Layout * pTB); |
| 84 |
bool addIconBefore(const char * szName, |
| 85 |
XAP_Toolbar_Id newId, |
| 86 |
XAP_Toolbar_Id beforeId); |
| 87 |
bool addIconAfter(const char * szName, |
| 88 |
XAP_Toolbar_Id newId, |
| 89 |
XAP_Toolbar_Id afterId); |
| 90 |
bool addIconAtEnd(const char * szName, |
| 91 |
XAP_Toolbar_Id newId); |
| 92 |
bool removeIcon(const char * szName, |
| 93 |
XAP_Toolbar_Id nukeId); |
| 94 |
bool saveToolbarsInCurrentScheme(void); |
| 95 |
bool restoreToolbarsFromCurrentScheme(void); |
| 96 |
const UT_Vector & getToolbarNames(void); |
| 97 |
UT_uint32 countToolbars(void) const; |
| 98 |
const gchar* prefKeyForToolbar(UT_uint32 t) const; |
| 99 |
private: |
| 100 |
UT_Vector m_vecTT; |
| 101 |
XAP_App * m_pApp; |
| 102 |
UT_Vector m_tbNames; |
| 103 |
}; |
| 104 |
|
| 105 |
|
| 106 |
#endif /* XAP_TOOLBAR_LAYOUTS_H */ |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|