00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */ 00002 /* AbiWord 00003 * Copyright (C) 2002 Dom Lachowicz 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_ANNOTATION_H 00022 #define AP_DIALOG_ANNOTATION_H 00023 00024 #include <string> 00025 00026 #include "xap_Frame.h" 00027 #include "xap_Dialog.h" 00028 #include "xav_View.h" 00029 00030 class XAP_Frame; 00031 00032 #define DCL_PROP(name) \ 00033 public: \ 00034 void set##name(const std::string & val) { m_##name = val ; } \ 00035 const std::string & get##name() const { return m_##name ; } \ 00036 private: std::string m_##name ; 00037 00038 class ABI_EXPORT AP_Dialog_Annotation : public XAP_Dialog_NonPersistent 00039 { 00040 public: 00041 AP_Dialog_Annotation(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid) 00042 : XAP_Dialog_NonPersistent ( pDlgFactory, dlgid, "interface/dialogproperties" ), m_answer ( a_CANCEL ) 00043 { 00044 } 00045 00046 virtual ~AP_Dialog_Annotation() 00047 { 00048 } 00049 00050 virtual void runModal(XAP_Frame * pFrame) = 0; 00051 00052 typedef enum { a_APPLY, a_OK, a_CANCEL } tAnswer; 00053 00054 AP_Dialog_Annotation::tAnswer getAnswer(void) const 00055 { 00056 return m_answer ; 00057 } 00058 00059 // Obj-C Class on Mac needs to access that. 00060 void setAnswer ( AP_Dialog_Annotation::tAnswer a ) 00061 { 00062 m_answer = a ; 00063 } 00064 00065 DCL_PROP(Title) 00066 DCL_PROP(Author) 00067 DCL_PROP(Description) 00068 00069 00070 protected: 00071 00072 private: 00073 00074 AP_Dialog_Annotation::tAnswer m_answer; 00075 }; 00076 00077 #undef DCL_PROP 00078 00079 #endif /* AP_DIALOG_STUB_H */