00001 /* AbiSource Application Framework 00002 * Copyright (C) 2003 Tomas Frydrych <tomas@frydrych.uklinux.net> 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 XAP_DIALOG_LISTDOCS_H 00021 #define XAP_DIALOG_LISTDOCS_H 00022 00023 #include "xap_Dialog.h" 00024 #include "ut_assert.h" 00025 #include "ut_vector.h" 00026 00027 class AD_Document; 00028 00061 class ABI_EXPORT XAP_Dialog_ListDocuments : public XAP_Dialog_NonPersistent 00062 { 00063 public: 00064 XAP_Dialog_ListDocuments(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00065 virtual ~XAP_Dialog_ListDocuments(void); 00066 00067 virtual void runModal(XAP_Frame * pFrame) = 0; 00068 00069 typedef enum { a_OK, a_CANCEL } tAnswer; 00070 00071 XAP_Dialog_ListDocuments::tAnswer getAnswer(void) const {return m_answer;} 00072 00073 AD_Document * getDocument(void) const; 00074 00075 void setIncludeActiveDoc(bool b); 00076 00077 protected: 00078 void _setAnswer(XAP_Dialog_ListDocuments::tAnswer a){m_answer=a;} 00079 UT_sint32 _getDocumentCount() {return m_vDocs.getItemCount();} 00080 const char * _getNthDocumentName(UT_sint32 n) const; 00081 00082 void _setSelDocumentIndx(UT_sint32 i); 00083 00084 const char * _getTitle() const; 00085 const char * _getOKButtonText() const; 00086 const char * _getHeading() const; 00087 00088 private: 00089 00090 void _init(); 00091 00092 XAP_Dialog_ListDocuments::tAnswer m_answer; 00093 00094 UT_sint32 m_ndxSelDoc; 00095 UT_Vector m_vDocs; 00096 bool m_bIncludeActiveDoc; 00097 }; 00098 00099 #endif /* XAP_DIALOG_WINDOWMORE_H */