00001 /* AbiWord 00002 * Copyright (C) 2000 AbiSource, Inc. 00003 * Copyright (C) 2005,2011 Hubert Figuiere 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301 USA. 00019 */ 00020 00021 #ifndef AP_UNIXDIALOG_WORDCOUNT_H 00022 #define AP_UNIXDIALOG_WORDCOUNT_H 00023 00024 #include <string> 00025 00026 #include "ap_Dialog_WordCount.h" 00027 #include "ut_timer.h" 00028 00029 class XAP_UnixFrame; 00030 00031 /*****************************************************************/ 00032 00033 class AP_UnixDialog_WordCount: public AP_Dialog_WordCount 00034 { 00035 public: 00036 AP_UnixDialog_WordCount(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00037 virtual ~AP_UnixDialog_WordCount(void); 00038 00039 virtual void runModeless(XAP_Frame * pFrame); 00040 virtual void destroy(void); 00041 virtual void activate(void); 00042 virtual void notifyActiveFrame(XAP_Frame *pFrame); 00043 00044 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id); 00045 00046 // callbacks can fire these events 00047 00048 void event_OK(void); 00049 void event_WindowDelete(void); 00050 00051 protected: 00052 virtual XAP_Widget *getWidget(xap_widget_id wid); 00053 virtual void constructDialog(void); 00054 00055 static void s_response(GtkWidget * wid, gint id, AP_UnixDialog_WordCount * me ) ; 00056 00057 // private construction functions 00058 // GtkWidget * _constructWindow(void); 00059 00060 static void autoupdateWC(UT_Worker * pTimer); 00061 00062 // pointers to widgets we need to query/set 00063 GtkWidget * m_windowMain; 00064 00065 // Labels for the Word Count data 00066 GtkWidget * m_labelWCount; 00067 GtkWidget * m_labelWNoFootnotesCount; 00068 GtkWidget * m_labelPCount; 00069 GtkWidget * m_labelCCount; 00070 GtkWidget * m_labelCNCount; 00071 GtkWidget * m_labelLCount; 00072 GtkWidget * m_labelPgCount; 00073 GtkWidget * m_labelLabelWCount; 00074 GtkWidget * m_labelWNFCount; 00075 GtkWidget * m_labelLabelPCount; 00076 GtkWidget * m_labelLabelCCount; 00077 GtkWidget * m_labelLabelCNCount; 00078 GtkWidget * m_labelLabelLCount; 00079 GtkWidget * m_labelLabelPgCount; 00080 GtkWidget * m_labelTitle; 00081 std::string m_labelTitleMarkupFormat; 00082 00083 UT_Timer * m_pAutoUpdateWC; 00084 00085 // Handshake variables 00086 bool m_bDestroy_says_stopupdating; 00087 bool m_bAutoUpdate_happening_now; 00088 }; 00089 00090 #endif /* AP_UNIXDIALOG_WORDCOUNT_H */ 00091 00092 00093 00094 00095 00096 00097 00098