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_Win32Dialog_List_H 00021 #define AP_Win32Dialog_List_H 00022 00023 #include "ap_Dialog_Lists.h" 00024 #include "xap_Win32DialogHelper.h" 00025 #include "xap_Win32PreviewWidget.h" 00026 #include "xap_Frame.h" 00027 #include "xap_Win32DialogBase.h" 00028 00029 /*****************************************************************/ 00030 00031 class ABI_EXPORT AP_Win32Dialog_Lists: public AP_Dialog_Lists, XAP_Win32Dialog, public XAP_Win32DialogBase 00032 { 00033 public: 00034 AP_Win32Dialog_Lists(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00035 virtual ~AP_Win32Dialog_Lists(void); 00036 00037 virtual void runModal(XAP_Frame* pFrame); 00038 virtual void runModeless(XAP_Frame* pFrame); 00039 virtual void destroy(); 00040 virtual void activate(); 00041 00042 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00043 static void autoupdateLists(UT_Worker * pTimer); 00044 virtual void setFoldLevelInGUI(void); 00045 virtual bool isPageLists(void); 00046 00047 protected: 00048 BOOL _onInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam); 00049 BOOL _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam); 00050 BOOL _onDeltaPos(NM_UPDOWN * pnmud); 00051 00052 void _enableControls(); 00053 void _onApply(); 00054 00055 private: 00056 // overridden virtual functions 00057 virtual void notifyActiveFrame(XAP_Frame *pFrame); 00058 virtual void * pGetWindowHandle() { return (void *) m_hThisDlg; } 00059 00060 // current selection of the drop-list combo boxes 00061 int _getTypeComboCurSel() const; 00062 int _getStyleComboCurSel() const; 00063 int _getFoldingComboCurSel() const; 00064 void _setTypeComboCurSel(int iSel); 00065 void _setStyleComboCurSel(int iSel); 00066 void _setFoldingComboCurSel(int iSel); 00067 00068 bool _isNewListChecked() const; 00069 bool _isApplyToCurrentChecked() const; 00070 bool _isResumeListChecked() const; 00071 void _fillTypeList(); 00072 void _fillStyleList(int iType); 00073 void _fillFoldingList(); 00074 void _typeChanged(); 00075 void _styleChanged(); 00076 void _foldingChanged(); 00077 void _resetCustomValues(); 00078 void _enableCustomControls(bool bEnable = true); 00079 void _updateCaption(); 00080 void _previewExposed(); 00081 void _setDisplayedData(); // data -> "view" 00082 void _getDisplayedData(UT_sint32 controlId = -1); // "view" -> data 00083 FL_ListType _getListTypeFromCombos() const; 00084 void _setListType(FL_ListType type); 00085 void _selectFont(); 00086 00087 bool m_bDestroy_says_stopupdating; 00088 bool m_bAutoUpdate_happening_now; 00089 UT_Timer* m_pAutoUpdateLists; 00090 XAP_Win32DialogHelper _win32Dialog; 00091 XAP_Win32PreviewWidget* m_pPreviewWidget; 00092 bool m_bEnableCustomControls; 00093 HWND m_hThisDlg; 00094 }; 00095 00096 #endif /* AP_Win32Dialog_List_H */