00001 /* AbiWord 00002 * Copyright (c) 2001,2002 Tomas Frydrych 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_GETSTRINGCOMMON_H 00022 #define AP_DIALOG_GETSTRINGCOMMON_H 00023 00024 #include "xap_Dialog.h" 00025 #include "ut_xml.h" 00026 #include "fv_View.h" 00027 #include "pd_Document.h" 00028 #include "ut_string.h" 00029 #include "ut_string_class.h" 00030 00031 class XAP_Frame; 00032 00033 class ABI_EXPORT AP_Dialog_GetStringCommon : public XAP_Dialog_NonPersistent 00034 { 00035 protected: 00036 virtual int getStringSizeLimit() const 00037 { 00038 return 30; 00039 } 00040 public: 00041 AP_Dialog_GetStringCommon( XAP_DialogFactory * pDlgFactory, 00042 XAP_Dialog_Id id, 00043 const char* dialogfile ); 00044 virtual ~AP_Dialog_GetStringCommon(); 00045 00046 virtual void runModal(XAP_Frame * pFrame) = 0; 00047 00048 typedef enum { a_OK=0, a_CANCEL=1, a_DELETE=2 } tAnswer; 00049 00050 tAnswer getAnswer() const; 00051 void setAnswer(tAnswer a); 00052 const std::string & getString() const; 00053 void setString( const std::string& s ); 00054 void setDoc(FV_View * pView); 00055 00056 private: 00057 PD_Document* m_pDoc; 00058 std::string m_string; 00059 AP_Dialog_GetStringCommon::tAnswer m_answer; 00060 }; 00061 00062 #endif