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

ap_LoadBindings.h

Go to the documentation of this file.
00001 /* AbiWord
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 AP_LOADBINDINGS_H
00021 #define AP_LOADBINDINGS_H
00022 #include "xap_LoadBindings.h"
00023 #include "ev_EditBits.h"
00024 #include "ut_vector.h"
00025 #include "ut_string.h"
00026 
00027 class EV_EditMethodContainer;
00028 class EV_EditBindingMap;
00029 class AP_BindingSet;
00031 #if defined(PT_TEST) || defined(FMT_TEST) || defined(UT_TEST)
00032 #  define FN_TEST_DUMP      "Test_Dump"
00033 #  define FN_TEST_FTR           "Test_Ftr"
00034 #else
00035 #  define FN_TEST_DUMP      ""
00036 #  define FN_TEST_FTR           ""
00037 #endif
00038 
00040 
00041 // binding set table to describe mouse bindings
00042 struct ap_bs_Mouse
00043 {
00044     EV_EditBits         m_eb;           // sans emo
00045     const char *        m_szMethod[EV_COUNT_EMO];
00046 };
00047 
00048 // binding set table to describe NVK bindings
00049 struct ap_bs_NVK
00050 {
00051     EV_EditBits         m_eb;           // sans ems
00052     const char *        m_szMethod[EV_COUNT_EMS];
00053 };
00054 
00055 // binding set table to describe NVK bindings which are
00056 // prefixes to other maps
00057 struct ap_bs_NVK_Prefix
00058 {
00059     EV_EditBits         m_eb;           // sans ems
00060     const char *        m_szMapName[EV_COUNT_EMS];
00061 };
00062 
00063 // binding set table to describe non-nvk bindings
00064 struct ap_bs_Char
00065 {
00066     EV_EditBits         m_eb;           // sans ems & shift
00067     const char *        m_szMethod[EV_COUNT_EMS_NoShift];
00068 };
00069 
00070 // binding set table to describe non-nvk bindings which are
00071 // prefixes to other maps
00072 struct ap_bs_Char_Prefix
00073 {
00074     EV_EditBits         m_eb;           // sans ems & shift
00075     const char *        m_szMapName[EV_COUNT_EMS_NoShift];
00076 };
00077 
00078 
00079 typedef bool (*ap_LoadBindings_pFn)(AP_BindingSet * pThis, EV_EditBindingMap * pebm);
00080 
00081 class ABI_EXPORT c_lb
00082 {
00083  public:
00084   c_lb(c_lb * pc_lb);
00085   c_lb( bool bCycle,    const char * name, ap_LoadBindings_pFn fn, EV_EditBindingMap * pebm);
00086   ~c_lb(void);
00087     bool                        m_bCanCycle;    // visible to CycleInputMode
00088     char *                  m_name;
00089     ap_LoadBindings_pFn         m_fn;
00090     EV_EditBindingMap *         m_pebm;         // must be deleted
00091 };
00092 
00093 /*****************************************************************/
00094 
00095 class ABI_EXPORT AP_BindingSet : public XAP_BindingSet
00096 {
00097 public:
00098     AP_BindingSet(EV_EditMethodContainer * pemc);
00099     virtual ~AP_BindingSet(void);
00100 
00101     virtual EV_EditBindingMap * getMap(const char * szName);
00102     void                            loadBuiltin(void);
00103     EV_EditBindingMap *            createMap(const char * szName);
00104     void _loadChar( EV_EditBindingMap*          pebm,
00105             const ap_bs_Char*           pCharTable,
00106             UT_uint32               cCharTable,
00107             const ap_bs_Char_Prefix*    pCharPrefixTable,
00108             UT_uint32           cCharPrefixTable);
00109     void _loadNVK(  EV_EditBindingMap*          pebm,
00110             const ap_bs_NVK*            pNVK,
00111             UT_uint32               cNVK,
00112             const ap_bs_NVK_Prefix*     pNVKPrefix,
00113             UT_uint32           cNVKPrefix);
00114     void _loadMouse(EV_EditBindingMap*      pebm,
00115             const ap_bs_Mouse*      pMouseTable,
00116             UT_uint32           cMouseTable);
00117 
00118     const char * getNextInCycle(const char * szCurrent);
00119  private:
00120     UT_GenericVector<c_lb *>         m_vecBindings;
00121 };
00122 
00123 #endif /* AP_LOADBINDINGS_H */
00124 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1