| 1 |
/* AbiWord |
| 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 |
#ifndef XAP_TOOLBAR_CONTROLFACTORY_H |
| 21 |
#define XAP_TOOLBAR_CONTROLFACTORY_H |
| 22 |
|
| 23 |
/***************************************************************** |
| 24 |
****************************************************************** |
| 25 |
** This file defines the base class for the cross-platform |
| 26 |
** application Toolbar_Control factory. This is used as a container |
| 27 |
** and constructor for all Toolbar_Controls. |
| 28 |
****************************************************************** |
| 29 |
*****************************************************************/ |
| 30 |
|
| 31 |
/* pre-emptive dismissal; ut_types.h is needed by just about everything, |
| 32 |
* so even if it's commented out in-file that's still a lot of work for |
| 33 |
* the preprocessor to do... |
| 34 |
*/ |
| 35 |
#ifndef UT_TYPES_H |
| 36 |
#include "ut_types.h" |
| 37 |
#endif |
| 38 |
/* #include "ut_vector.h" */ |
| 39 |
|
| 40 |
/* #include "EV_Toolbar_Control.h" */ |
| 41 |
|
| 42 |
#include "xap_Types.h" |
| 43 |
|
| 44 |
class EV_Toolbar_Control; |
| 45 |
class EV_Toolbar; |
| 46 |
|
| 47 |
/*****************************************************************/ |
| 48 |
|
| 49 |
class ABI_EXPORT XAP_Toolbar_ControlFactory |
| 50 |
{ |
| 51 |
public: |
| 52 |
struct _ctl_table |
| 53 |
{ |
| 54 |
XAP_Toolbar_Id m_id; |
| 55 |
EV_Toolbar_Control * (*m_pfnStaticConstructor)(EV_Toolbar * pToolbar, XAP_Toolbar_Id id); |
| 56 |
}; |
| 57 |
|
| 58 |
XAP_Toolbar_ControlFactory(int nrElem, const struct _ctl_table * pDlgTable); |
| 59 |
virtual ~XAP_Toolbar_ControlFactory(void); |
| 60 |
|
| 61 |
EV_Toolbar_Control * getControl(EV_Toolbar * pToolbar, XAP_Toolbar_Id id); |
| 62 |
|
| 63 |
protected: |
| 64 |
bool _find_ControlInTable(XAP_Toolbar_Id id, UT_uint32 * pIndex) const; |
| 65 |
|
| 66 |
UT_uint32 m_nrElementsCtlTable; |
| 67 |
const _ctl_table * m_ctl_table; /* an array of elements */ |
| 68 |
}; |
| 69 |
|
| 70 |
#endif /* XAP_TOOLBAR_CONTROLFACTORY_H */ |