00001 /* AbiWord 00002 * Copyright (C) 2011 AbiSource, Inc. 00003 * Copyright (C) 2011 Ben Martin 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_DIALOG_MODELESS_H 00022 #define AP_DIALOG_MODELESS_H 00023 00024 #include <string> 00025 00026 #include "xap_Dialog.h" 00027 #include "fv_View.h" 00028 #include "pd_DocumentRDF.h" 00029 #include "xap_Strings.h" 00030 class XAP_Frame; 00031 00032 class ABI_EXPORT AP_Dialog_Modeless : public XAP_Dialog_Modeless 00033 { 00034 protected: 00035 /************************************************************/ 00036 /************************************************************/ 00037 /************************************************************/ 00038 /*** These methods rely on the later pure virtual ones to provide */ 00039 /*** reasonable defaults. They are virtual so that subclasses can */ 00040 /*** change them if specialized behavior is desired. */ 00041 /************************************************************/ 00042 /************************************************************/ 00043 /************************************************************/ 00044 00045 virtual void ConstructWindowName(); 00046 00047 /************************************************************/ 00048 /************************************************************/ 00049 /************************************************************/ 00050 /*** pure virtual methods used by the above methods *********/ 00051 /************************************************************/ 00052 /************************************************************/ 00053 /************************************************************/ 00054 // 00055 virtual XAP_String_Id getWindowTitleStringId() = 0; 00056 virtual void setStatus( const std::string& msg ); 00057 00058 public: 00059 AP_Dialog_Modeless(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id, const char * helpUrl = NULL ); 00060 virtual ~AP_Dialog_Modeless(); 00061 00062 // these are kinda screwy now, but we never return anything but on 00063 // "cancel" or "close" 00064 typedef enum { 00065 a_CLOSE 00066 } tAnswer; 00067 00068 AP_Dialog_Modeless::tAnswer getAnswer() const; 00069 // These are called from edit methods or from dialogs 00070 // to set or read the variables in the current 00071 // instance of the dialog. These do not read the persistent 00072 // values. 00073 bool setView(FV_View * view); 00074 FV_View * getView() const; 00075 void setActiveFrame(XAP_Frame *pFrame); 00076 00077 virtual void maybeClosePopupPreviewBubbles(); 00078 void closePopupPreviewBubbles(); 00079 virtual void maybeReallowPopupPreviewBubbles(); 00080 00081 protected: 00082 // These are the "current use" dialog data items, 00083 // which are liberally read and set by the 00084 // accessor methods above. 00085 FV_View * m_pView; 00086 std::string m_WindowName; 00087 // is this used in a modeless dialog like this? 00088 tAnswer m_answer; 00089 00090 FV_View_BubbleBlocker m_bubbleBlocker; 00091 }; 00092 00093 #endif