#include <xap_Win32Dlg_FileOpenSaveAs.h>
Classes | |
struct | OPENFILENAME_WIN50 |
Public Member Functions | |
XAP_Win32Dialog_FileOpenSaveAs (XAP_DialogFactory *pDlgFactory, XAP_Dialog_Id id) | |
virtual | ~XAP_Win32Dialog_FileOpenSaveAs (void) |
virtual void | runModal (XAP_Frame *pFrame) |
Static Public Member Functions | |
static XAP_Dialog * | static_constructor (XAP_DialogFactory *, XAP_Dialog_Id id) |
static UINT CALLBACK | s_hookSaveAsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
static UINT CALLBACK | s_hookInsertPicProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
Protected Member Functions | |
UINT | _previewPicture (HWND hwnd) |
UINT | _initPreviewDlg (HWND hwnd) |
void | _buildFilterList (UT_String &sFilter) |
Private Member Functions | |
const wchar_t * | _getDefaultExtension (UT_uint32 indx) |
BOOL | GetSaveFileName_Hooked (OPENFILENAME_WIN50 *lpofn, BOOL bSave) |
Private Attributes | |
wchar_t | m_szDefaultExtension [DEFAULT_EXT_SIZE+1] |
XAP_Win32Dialog_FileOpenSaveAs::XAP_Win32Dialog_FileOpenSaveAs | ( | XAP_DialogFactory * | pDlgFactory, | |
XAP_Dialog_Id | id | |||
) |
References m_szDefaultExtension.
Referenced by static_constructor().
XAP_Win32Dialog_FileOpenSaveAs::~XAP_Win32Dialog_FileOpenSaveAs | ( | void | ) | [virtual] |
void XAP_Win32Dialog_FileOpenSaveAs::_buildFilterList | ( | UT_String & | sFilter | ) | [protected] |
Build a Windows filter list from Abi's filetypes
sFilter | Build the list in this string |
References UT_String::c_str(), UT_String::empty(), gchar, XAP_Dialog::getApp(), XAP_App::getStringSet(), XAP_StringSet::getValue(), XAP_Dialog::m_id, XAP_Dialog_FileOpenSaveAs::m_szDescriptions, XAP_Dialog_FileOpenSaveAs::m_szSuffixes, SuffixInList(), UT_ASSERT, and XAP_DIALOG_ID_INSERT_PICTURE.
Referenced by runModal().
const wchar_t * XAP_Win32Dialog_FileOpenSaveAs::_getDefaultExtension | ( | UT_uint32 | indx | ) | [private] |
Retrieve the default extension to use if user does not provide one
indx | -- index into the filter list |
References UT_Win32LocaleString::c_str(), DEFAULT_EXT_SIZE, UT_Win32LocaleString::fromASCII(), gchar, XAP_Dialog::m_id, m_szDefaultExtension, XAP_Dialog_FileOpenSaveAs::m_szDescriptions, XAP_Dialog_FileOpenSaveAs::m_szSuffixes, UT_DEBUGMSG, and XAP_DIALOG_ID_FILE_SAVE_IMAGE.
Referenced by runModal(), and s_hookSaveAsProc().
UINT XAP_Win32Dialog_FileOpenSaveAs::_initPreviewDlg | ( | HWND | hwnd | ) | [protected] |
UINT XAP_Win32Dialog_FileOpenSaveAs::_previewPicture | ( | HWND | hwnd | ) | [protected] |
References UT_Win32LocaleString::c_str(), GR_Win32Image::convertFromBuffer(), DELETEP, GR_Win32Graphics::drawImage(), UT_Win32LocaleString::fromLocale(), UT_Win32LocaleString::fromUTF8(), XAP_App::getApp(), XAP_Dialog::getApp(), XAP_App::getStringSet(), XAP_StringSet::getValue(), IEGFT_Unknown, IE_ImpGraphic::loadGraphic(), XAP_App::newGraphics(), GR_Graphics::tlu(), UT_DEBUGMSG, UT_go_filename_to_uri(), UT_MIN, UT_return_val_if_fail, UT_UTF8String::utf8_str(), and UT_Win32LocaleString::utf8_str().
Referenced by s_hookInsertPicProc().
BOOL XAP_Win32Dialog_FileOpenSaveAs::GetSaveFileName_Hooked | ( | OPENFILENAME_WIN50 * | lpofn, | |
BOOL | bSave | |||
) | [private] |
Gets the Windows File/Save common dialog box. To be able to get the places bar containing icons for commonly-used folders when we use hooking we need to use the new OPENFILENAME structure as defined in WINNT5 or better. To keep backward compability, first try with the new size of the structure, if it does not work it means the the common dialog box DLL installed in the system does not support the new features, and then we use the old one. In this situation, we user does not have a places bar capable common dialog box DLL anyway.
References BOOL(), XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::dwReserved, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::FlagsEx, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lStructSize, and XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::pvReserved.
Referenced by runModal().
void XAP_Win32Dialog_FileOpenSaveAs::runModal | ( | XAP_Frame * | pFrame | ) | [virtual] |
References _buildFilterList(), _getDefaultExtension(), BOOL(), UT_Win32LocaleString::c_str(), UT_String::c_str(), XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::Flags, FREEP, UT_Win32LocaleString::fromLocale(), UT_Win32LocaleString::fromUTF8(), gchar, XAP_Dialog::getApp(), XAP_Frame::getFrameImpl(), GetSaveFileName_Hooked(), XAP_App::getStringSet(), XAP_StringSet::getValue(), XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::hwndOwner, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lCustData, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrDefExt, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrFile, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrFileTitle, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrFilter, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrInitialDir, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lpstrTitle, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::lStructSize, XAP_Dialog_FileOpenSaveAs::m_answer, XAP_Dialog_FileOpenSaveAs::m_bSuggestName, XAP_Dialog_FileOpenSaveAs::m_finalPathname, XAP_Dialog::m_id, XAP_Dialog_FileOpenSaveAs::m_initialPathname, XAP_Dialog_FileOpenSaveAs::m_nDefaultFileType, XAP_Dialog_FileOpenSaveAs::m_nFileType, XAP_Dialog_FileOpenSaveAs::m_nTypeList, XAP_Dialog_FileOpenSaveAs::m_persistPathname, XAP_Dialog_FileOpenSaveAs::m_szDescriptions, XAP_Dialog_FileOpenSaveAs::m_szSuffixes, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::nFilterIndex, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::nMaxFile, XAP_Win32Dialog_FileOpenSaveAs::OPENFILENAME_WIN50::nMaxFileTitle, s_hookInsertPicProc(), s_hookSaveAsProc(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_go_filename_to_uri(), UT_pathSuffix(), UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, UT_UTF8String::utf8_str(), UT_Win32LocaleString::utf8_str(), XAP_DIALOG_FILEOPENSAVEAS_FILE_TYPE_AUTO, XAP_DIALOG_ID_FILE_EXPORT, XAP_DIALOG_ID_FILE_IMPORT, XAP_DIALOG_ID_FILE_OPEN, XAP_DIALOG_ID_FILE_SAVE_IMAGE, XAP_DIALOG_ID_FILE_SAVEAS, XAP_DIALOG_ID_INSERT_FILE, XAP_DIALOG_ID_INSERT_PICTURE, XAP_DIALOG_ID_INSERTMATHML, and XAP_DIALOG_ID_PRINTTOFILE.
UINT CALLBACK XAP_Win32Dialog_FileOpenSaveAs::s_hookInsertPicProc | ( | HWND | hDlg, | |
UINT | msg, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [static] |
Used for Insert Picture case of FileOpenSaveAs dialog
hDlg | ||
msg | ||
wParam | ||
lParam | Static routine |
References _initPreviewDlg(), _previewPicture(), UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by runModal().
UINT CALLBACK XAP_Win32Dialog_FileOpenSaveAs::s_hookSaveAsProc | ( | HWND | hDlg, | |
UINT | msg, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [static] |
Used for SaveAs case of FileOpenSaveAs dialog
hDlg | ||
msg | ||
wParam | ||
lParam | Static routine |
References _getDefaultExtension(), MAX_DLG_INS_PICT_STRING, UT_ASSERT, and UT_DEBUGMSG.
Referenced by runModal().
XAP_Dialog * XAP_Win32Dialog_FileOpenSaveAs::static_constructor | ( | XAP_DialogFactory * | pFactory, | |
XAP_Dialog_Id | id | |||
) | [static] |
References XAP_Win32Dialog_FileOpenSaveAs().
wchar_t XAP_Win32Dialog_FileOpenSaveAs::m_szDefaultExtension[DEFAULT_EXT_SIZE+1] [private] |
Referenced by _getDefaultExtension(), and XAP_Win32Dialog_FileOpenSaveAs().