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_DIALOG_MERGECELLS_H 00021 #define AP_DIALOG_MERGECELLS_H 00022 00023 #include "ut_types.h" 00024 #include "xap_Frame.h" 00025 #include "xap_Dialog.h" 00026 #include "xav_View.h" 00027 #include "pt_Types.h" 00028 00029 class UT_Timer; 00030 class XAP_Frame; 00031 class fp_TableContainer; 00032 00033 class ABI_EXPORT AP_Dialog_MergeCells : public XAP_Dialog_Modeless 00034 { 00035 public: 00036 AP_Dialog_MergeCells(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00037 virtual ~AP_Dialog_MergeCells(void); 00038 00039 virtual void runModeless(XAP_Frame * pFrame) = 0; 00040 00041 typedef enum { a_OK, a_CANCEL } tAnswer; 00042 typedef enum { radio_left, radio_right, radio_above, radio_below } mergeWithCell; 00043 00044 AP_Dialog_MergeCells::tAnswer getAnswer(void) const; 00045 PT_DocPosition getCellSource(void); 00046 PT_DocPosition getCellDestination(void); 00047 virtual void startUpdater(void); 00048 virtual void stopUpdater(void); 00049 static void autoUpdateMC(UT_Worker * pTimer); 00050 virtual void setSensitivity( mergeWithCell mergeThis, bool bSens) = 0; 00051 virtual void setActiveFrame(XAP_Frame *pFrame); 00052 void ConstructWindowName(void); 00053 void setAllSensitivities(void); 00054 void event_update(void); 00055 void finalize(void); 00056 void setMergeType( mergeWithCell iMergeType); 00057 void onMerge(void); 00058 00059 protected: 00060 AP_Dialog_MergeCells::tAnswer m_answer; 00061 char m_WindowName[100]; 00062 private: 00063 void _generateSrcDest(void); 00064 00065 PT_DocPosition m_iCellSource; 00066 PT_DocPosition m_iCellDestination; 00067 AP_Dialog_MergeCells::mergeWithCell m_mergeType; 00068 UT_sint32 m_iLeft; 00069 UT_sint32 m_iRight; 00070 UT_sint32 m_iTop; 00071 UT_sint32 m_iBot; 00072 UT_sint32 m_iNumRows; 00073 UT_sint32 m_iNumCols; 00074 fp_TableContainer * m_pTab; 00075 UT_Timer * m_pAutoUpdaterMC; 00076 // Handshake variables 00077 bool m_bDestroy_says_stopupdating; 00078 bool m_bAutoUpdate_happening_now; 00079 00080 }; 00081 00082 #endif /* AP_DIALOG_MERGECELLS_H */