#include <xap_Dlg_ListDocuments.h>
Public Types | |
enum | tAnswer { a_OK, a_CANCEL } |
Public Member Functions | |
XAP_Dialog_ListDocuments (XAP_DialogFactory *pDlgFactory, XAP_Dialog_Id id) | |
virtual | ~XAP_Dialog_ListDocuments (void) |
virtual void | runModal (XAP_Frame *pFrame)=0 |
XAP_Dialog_ListDocuments::tAnswer | getAnswer (void) const |
AD_Document * | getDocument (void) const |
void | setIncludeActiveDoc (bool b) |
Protected Member Functions | |
void | _setAnswer (XAP_Dialog_ListDocuments::tAnswer a) |
UT_sint32 | _getDocumentCount () |
const char * | _getNthDocumentName (UT_sint32 n) const |
void | _setSelDocumentIndx (UT_sint32 i) |
const char * | _getTitle () const |
const char * | _getOKButtonText () const |
const char * | _getHeading () const |
Private Member Functions | |
void | _init () |
Private Attributes | |
XAP_Dialog_ListDocuments::tAnswer | m_answer |
UT_sint32 | m_ndxSelDoc |
UT_Vector | m_vDocs |
bool | m_bIncludeActiveDoc |
This dialogue lists documents that are open; by default the current document is excluded from the list. This can be changed by calling setIncludeActiveDocument(true) before the dialogue is displayed.
PLATFORM NOTES -------------- Platform subclasses need to provide the usual static_constructor() and runModal() methods.
The dialogue contains a single column list which is filled by document names using _getDocumentCount() and _getNthDocumentName(). There is a heading text for the list, obtained through _getHeading();
When the user selects a particular entry on the list, _setSelDocumentIndx() should be called to store the index of the selection (if the subclass sorts the list, it needs to ensure that the index stored is the original index of that entry).
There should be two buttons: OK and Cancel; the text for the OK button needs to be obtained using _getOKButtonText().
Title for the dialogue window is obtained through _getTitle().
(this dialogue is very much like ListRevisions, except the list has only one column and the OK button label is not static)
XAP_Dialog_ListDocuments::XAP_Dialog_ListDocuments | ( | XAP_DialogFactory * | pDlgFactory, | |
XAP_Dialog_Id | id | |||
) |
References _init().
XAP_Dialog_ListDocuments::~XAP_Dialog_ListDocuments | ( | void | ) | [virtual] |
UT_sint32 XAP_Dialog_ListDocuments::_getDocumentCount | ( | ) | [inline, protected] |
const char * XAP_Dialog_ListDocuments::_getHeading | ( | ) | const [protected] |
const char * XAP_Dialog_ListDocuments::_getNthDocumentName | ( | UT_sint32 | n | ) | const [protected] |
const char * XAP_Dialog_ListDocuments::_getOKButtonText | ( | ) | const [protected] |
const char * XAP_Dialog_ListDocuments::_getTitle | ( | ) | const [protected] |
void XAP_Dialog_ListDocuments::_init | ( | ) | [private] |
void XAP_Dialog_ListDocuments::_setAnswer | ( | XAP_Dialog_ListDocuments::tAnswer | a | ) | [inline, protected] |
Referenced by XAP_Win32Dialog_ListDocuments::_onCommand().
void XAP_Dialog_ListDocuments::_setSelDocumentIndx | ( | UT_sint32 | i | ) | [protected] |
References UT_GenericVector< T >::getItemCount(), m_ndxSelDoc, m_vDocs, and UT_return_if_fail.
Referenced by XAP_Win32Dialog_ListDocuments::_onCommand(), and XAP_UnixDialog_ListDocuments::event_View().
XAP_Dialog_ListDocuments::tAnswer XAP_Dialog_ListDocuments::getAnswer | ( | void | ) | const [inline] |
Referenced by s_doListDocuments().
AD_Document * XAP_Dialog_ListDocuments::getDocument | ( | void | ) | const |
References a_OK, UT_GenericVector< T >::getNthItem(), m_answer, m_ndxSelDoc, XAP_Dialog::m_pApp, m_vDocs, UT_ASSERT, and UT_ASSERT_HARMLESS.
Referenced by s_doListDocuments().
virtual void XAP_Dialog_ListDocuments::runModal | ( | XAP_Frame * | pFrame | ) | [pure virtual] |
Implements XAP_Dialog_NonPersistent.
Implemented in XAP_UnixDialog_ListDocuments.
Referenced by s_doListDocuments().
void XAP_Dialog_ListDocuments::setIncludeActiveDoc | ( | bool | b | ) |
References _init(), and m_bIncludeActiveDoc.
Referenced by s_doListDocuments().
Referenced by getDocument().
bool XAP_Dialog_ListDocuments::m_bIncludeActiveDoc [private] |
Referenced by _init(), and setIncludeActiveDoc().
Referenced by _setSelDocumentIndx(), and getDocument().
UT_Vector XAP_Dialog_ListDocuments::m_vDocs [private] |
Referenced by _getNthDocumentName(), _init(), _setSelDocumentIndx(), and getDocument().