Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XAP_Win32Dialog_FileOpenSaveAs Class Reference

#include <xap_Win32Dlg_FileOpenSaveAs.h>

Inheritance diagram for XAP_Win32Dialog_FileOpenSaveAs:
XAP_Dialog_FileOpenSaveAs XAP_Win32DialogBase XAP_Dialog_AppPersistent XAP_Dialog_Persistent XAP_Dialog

List of all members.

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_Dialogstatic_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]

Constructor & Destructor Documentation

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]

Member Function Documentation

void XAP_Win32Dialog_FileOpenSaveAs::_buildFilterList ( UT_String sFilter  )  [protected]
const wchar_t * XAP_Win32Dialog_FileOpenSaveAs::_getDefaultExtension ( UT_uint32  indx  )  [private]
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::m_id, XAP_Dialog_FileOpenSaveAs::m_nDefaultFileType, XAP_Dialog_FileOpenSaveAs::m_nFileType, XAP_Dialog_FileOpenSaveAs::m_nTypeList, XAP_Dialog_FileOpenSaveAs::m_szDescriptions, XAP_Dialog_FileOpenSaveAs::m_szFinalPathname, XAP_Dialog_FileOpenSaveAs::m_szInitialPathname, XAP_Dialog_FileOpenSaveAs::m_szPersistPathname, 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_calloc(), 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

Parameters:
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

Parameters:
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]

Member Data Documentation


The documentation for this class was generated from the following files: