#include <ap_Win32App.h>
Public Member Functions | |
AP_Win32App (HINSTANCE hInstance, const char *szAppName) | |
virtual | ~AP_Win32App (void) |
virtual bool | initialize (void) |
virtual XAP_Frame * | newFrame (void) |
virtual bool | shutdown (void) |
virtual bool | getPrefsValueDirectory (bool bAppSpecific, const gchar *szKey, const gchar **pszValue) const |
virtual const XAP_StringSet * | getStringSet (void) const |
virtual const char * | getAbiSuiteAppDir (void) const |
virtual void | copyToClipboard (PD_DocumentRange *pDocRange, bool bUseClipboard=true) |
virtual GR_Graphics * | newDefaultScreenGraphics () const |
virtual void | pasteFromClipboard (PD_DocumentRange *pDocRange, bool bUseClipboard, bool bHonorFormatting) |
virtual bool | canPasteFromClipboard (void) |
virtual void | cacheCurrentSelection (AV_View *) |
virtual void | errorMsgBadArg (const char *msg) |
virtual void | errorMsgBadFile (XAP_Frame *pFrame, const char *file, UT_Error error) |
virtual bool | doWindowlessArgs (const AP_Args *, bool &bSuccess) |
virtual HICON | getIcon (void) |
virtual HICON | getSmallIcon (void) |
virtual UT_Error | fileOpen (XAP_Frame *pFrame, const char *pNewFile) |
UT_Vector * | getInstalledUILanguages (void) |
bool | doesStringSetExist (const char *pLocale) |
bool | handleModelessDialogMessage (MSG *msg) |
virtual void | catchSignals (int signum) ABI_NORETURN |
Static Public Member Functions | |
static int | WinMain (const char *szAppName, HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) |
static UT_Win32LocaleString | s_fromUCS4ToWinLocale (const UT_UCS4Char *szIn) |
static UT_UCS4String | s_fromWinLocaleToUCS4 (const char *szIn) |
static UT_Win32LocaleString | s_fromUTF8ToWinLocale (const char *szIn) |
static UT_UTF8String | s_fromWinLocaleToUTF8 (const char *szIn) |
Protected Member Functions | |
bool | _pasteFormatFromClipboard (PD_DocumentRange *pDocRange, const char *szFormat, const char *szType, bool bWide) |
IEFileType | _getFileTypeFromDesc (const char *desc) |
Protected Attributes | |
XAP_StringSet * | m_pStringSet |
AP_Win32Clipboard * | m_pClipboard |
Static Protected Attributes | |
static const bool | m_bForceAnsi = false |
Private Member Functions | |
bool | _copyFmtToClipboard (PD_DocumentRange *pDocRange, UINT iFmt) |
bool | _copyFmtToClipboard (PD_DocumentRange *pDocRange, const char *pszFmt) |
AP_Win32App::AP_Win32App | ( | HINSTANCE | hInstance, | |
const char * | szAppName | |||
) |
References m_pClipboard, and m_pStringSet.
Referenced by WinMain().
AP_Win32App::~AP_Win32App | ( | void | ) | [virtual] |
References DELETEP, IE_ImpExp_UnRegisterXP(), m_pClipboard, and m_pStringSet.
bool AP_Win32App::_copyFmtToClipboard | ( | PD_DocumentRange * | pDocRange, | |
UINT | iFmt | |||
) | [private] |
copy data in required format to the clipboard
References XAP_Win32Clipboard::convertToFormatString(), m_pClipboard, and UT_return_val_if_fail.
Referenced by copyToClipboard().
bool AP_Win32App::_copyFmtToClipboard | ( | PD_DocumentRange * | pDocRange, | |
const char * | pszFmt | |||
) | [private] |
copy data in required format to the clipboard
References XAP_Win32Clipboard::addData(), AP_CLIPBOARD_RTF, AP_CLIPBOARD_TEXTPLAIN_8BIT, AP_CLIPBOARD_TEXTPLAIN_UCS2, UT_ByteBuf::append(), IE_Exp::copyToBuffer(), DELETEP, XAP_EncodingManager::get_instance(), UT_ByteBuf::getLength(), XAP_EncodingManager::getNativeUnicodeEncodingName(), UT_ByteBuf::getPointer(), m_pClipboard, PD_DocumentRange::m_pDoc, UT_DEBUGMSG, UT_OK, and UT_return_val_if_fail.
IEFileType AP_Win32App::_getFileTypeFromDesc | ( | const char * | desc | ) | [protected] |
References IE_Imp::enumerateDlgLabels().
bool AP_Win32App::_pasteFormatFromClipboard | ( | PD_DocumentRange * | pDocRange, | |
const char * | szFormat, | |||
const char * | szType, | |||
bool | bWide | |||
) | [protected] |
References AP_CLIPBOARD_BMP, FV_View::cmdInsertGraphic(), IE_Imp::constructImporter(), IE_ImpGraphic::constructImporter(), CreateBitmapInfoStruct(), CreateBMP(), DELETEP, IE_Imp::fileTypeForSuffix(), XAP_EncodingManager::get_instance(), XAP_Frame::getFrameData(), XAP_Win32Clipboard::getHandleInFormat(), XAP_EncodingManager::getUCS2LEName(), FL_DocLayout::getView(), IE_ImpGraphic::importGraphic(), m_pClipboard, PD_DocumentRange::m_pDoc, AP_FrameData::m_pDocLayout, IE_Imp::pasteFromBuffer(), UT_DEBUGMSG, UT_MIN, and UT_OK.
Referenced by pasteFromClipboard().
virtual void AP_Win32App::cacheCurrentSelection | ( | AV_View * | ) | [inline, virtual] |
bool AP_Win32App::canPasteFromClipboard | ( | void | ) | [virtual] |
void AP_Win32App::catchSignals | ( | int | signum | ) | [virtual] |
References UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.
void AP_Win32App::copyToClipboard | ( | PD_DocumentRange * | pDocRange, | |
bool | bUseClipboard = true | |||
) | [virtual] |
copy data to the clipboard; this is what gets called when the user presses Ctrl+C
References _copyFmtToClipboard(), AP_CLIPBOARD_RTF, AP_CLIPBOARD_TEXTPLAIN_8BIT, AP_CLIPBOARD_TEXTPLAIN_UCS2, XAP_Win32Clipboard::clearClipboard(), XAP_Win32Clipboard::closeClipboard(), AP_Win32FrameImpl::getHwndDocument(), m_pClipboard, XAP_Win32Clipboard::openClipboard(), UT_IsWinNT(), and UT_return_if_fail.
bool AP_Win32App::doesStringSetExist | ( | const char * | pLocale | ) |
bool AP_Win32App::doWindowlessArgs | ( | const AP_Args * | Args, | |
bool & | bSuccess | |||
) | [virtual] |
A callback for AP_Args's doWindowlessArgs call which handles platform-specific windowless args. return false if we should exit normally but Window should not be displayed
Reimplemented from AP_App.
References UT_Win32LocaleString::c_str(), UT_String::c_str(), ev_EditMethod_invoke(), EV_EditMethodContainer::findEditMethodByName(), UT_Win32LocaleString::fromASCII(), AP_Args::getApp(), UT_GenericVector< T >::getItemCount(), XAP_Module::getModuleInfo(), UT_GenericVector< T >::getNthItem(), GR_Win32Graphics::getPrinterGraphics(), instance, AP_Args::m_expProps, AP_Args::m_impProps, AP_Args::m_iVerbose, AP_Args::m_sFileExtension, AP_Args::m_sFiles, AP_Args::m_sGeometry, AP_Args::m_sMerge, AP_Args::m_sPluginArgs, AP_Args::m_sPrintTo, XAP_ModuleInfo::name, AP_Convert::print(), s, AP_Convert::setExpProps(), AP_Convert::setImpProps(), AP_Convert::setMergeSource(), AP_Convert::setVerbose(), UT_GenericVector< T >::size(), szName, XAP_ModuleInfo::usage, and UT_DEBUGMSG.
void AP_Win32App::errorMsgBadArg | ( | const char * | msg | ) | [virtual] |
References UT_Win32LocaleString::c_str(), and UT_Win32LocaleString::fromUTF8().
void AP_Win32App::errorMsgBadFile | ( | XAP_Frame * | pFrame, | |
const char * | file, | |||
UT_Error | error | |||
) | [virtual] |
Reimplemented from AP_App.
References s_CouldNotLoadFileMessage().
References IEFT_Unknown.
const char * AP_Win32App::getAbiSuiteAppDir | ( | void | ) | const [virtual] |
Referenced by getPrefsValueDirectory().
HICON AP_Win32App::getIcon | ( | void | ) | [virtual] |
References UT_DEBUGMSG.
UT_Vector * AP_Win32App::getInstalledUILanguages | ( | void | ) |
References UT_GenericVector< T >::addItem(), doesStringSetExist(), UT_Language::getCount(), and UT_Language::getNthLangCode().
Referenced by AP_Win32Dialog_Options_General::_onInitDialog().
bool AP_Win32App::getPrefsValueDirectory | ( | bool | bAppSpecific, | |
const gchar * | szKey, | |||
const gchar ** | pszValue | |||
) | const [virtual] |
References gchar, getAbiSuiteAppDir(), and UT_return_val_if_fail.
Referenced by doesStringSetExist(), and initialize().
HICON AP_Win32App::getSmallIcon | ( | void | ) | [virtual] |
References UT_DEBUGMSG.
const XAP_StringSet * AP_Win32App::getStringSet | ( | void | ) | const [virtual] |
References m_pStringSet.
bool AP_Win32App::handleModelessDialogMessage | ( | MSG * | msg | ) |
Referenced by WinMain().
bool AP_Win32App::initialize | ( | void | ) | [virtual] |
Build a labelset so the plugins can add themselves to something ///
Reimplemented from AP_App.
References abi_register_builtin_plugins(), ABI_WIDE_STRING, AP_CreateMenuActionSet(), AP_CreateToolbarActionSet(), AP_GetEditMethods(), AP_PREF_DEFAULT_StringSet, AP_PREF_KEY_StringSet, AP_PREF_KEY_StringSetDirectory, UT_Win32LocaleString::c_str(), UT_String::c_str(), DELETEP, fp_FieldFmts, fp_FieldTypes, UT_Win32LocaleString::fromUTF8(), gchar, getPrefsValueDirectory(), XAP_StringSet::getValue(), IE_ImpExp_RegisterXP(), AP_App::initialize(), instance, AP_DiskStringSet::loadStringsFromDisk(), fp_FieldData::m_DescId, fp_FieldTypeData::m_DescId, m_pClipboard, m_pStringSet, fp_FieldData::m_Tag, fp_FieldTypeData::m_Type, AP_Win32Frame::RegisterClass(), s_createDirectoryIfNecessary(), XAP_DiskStringSet::setFallbackStringSet(), UT_calloc(), UT_DEBUGMSG, UT_Language_updateLanguageNames(), UT_return_val_if_fail, and XAP_PREF_KEY_AutoLoadPlugins.
GR_Graphics * AP_Win32App::newDefaultScreenGraphics | ( | ) | const [virtual] |
XAP_Frame * AP_Win32App::newFrame | ( | void | ) | [virtual] |
References AP_Win32Frame::initialize().
void AP_Win32App::pasteFromClipboard | ( | PD_DocumentRange * | pDocRange, | |
bool | bUseClipboard, | |||
bool | bHonorFormatting | |||
) | [virtual] |
UT_Win32LocaleString AP_Win32App::s_fromUCS4ToWinLocale | ( | const UT_UCS4Char * | szIn | ) | [static] |
References UT_Win32LocaleString::fromUCS4(), and sRslt.
Referenced by s_fromUTF8ToWinLocale().
UT_Win32LocaleString AP_Win32App::s_fromUTF8ToWinLocale | ( | const char * | szIn | ) | [static] |
References s_fromUCS4ToWinLocale(), and UT_UTF8String::ucs4_str().
Referenced by AP_Win32Dialog_CollaborationJoin::_addBuddyToTree(), AP_Win32Dialog_CollaborationJoin::_addDocumentToBuddy(), AP_Win32Dialog_FormatTOC_General::_fillGUI(), AP_Win32Dialog_Styles::_onInitDialog(), AP_Win32Dialog_CollaborationShare::_populateBuddyModel(), AP_Win32Dialog_CollaborationShare::_populateWindowData(), AP_Win32Dialog_CollaborationAddAccount::_populateWindowData(), AP_Win32Dialog_CollaborationAccounts::_populateWindowData(), fromUTF8toWinLocale(), AP_Win32Dialog_FormatTOC_Layout::loadCtrlsValuesForDetailsLevel(), AP_Win32Dialog_FormatTOC::setMainLevel(), and AP_Win32Dialog_FormatTOC::setStyle().
UT_UCS4String AP_Win32App::s_fromWinLocaleToUCS4 | ( | const char * | szIn | ) | [static] |
References sRslt, and UT_UCS4_strcpy_char().
Referenced by s_fromWinLocaleToUTF8().
UT_UTF8String AP_Win32App::s_fromWinLocaleToUTF8 | ( | const char * | szIn | ) | [static] |
bool AP_Win32App::shutdown | ( | void | ) | [virtual] |
Referenced by WinMain().
int AP_Win32App::WinMain | ( | const char * | szAppName, | |
HINSTANCE | hInstance, | |||
HINSTANCE | hPrevInstance, | |||
PSTR | szCmdLine, | |||
int | iCmdShow | |||
) | [static] |
References UT_Win32Idle::_fireall(), UT_Win32Idle::_isEmpty(), XAP_Dialog_MessageBox::a_OK, AP_Win32App(), XAP_Dialog_MessageBox::b_O, BOOL(), AP_Args::doWindowlessArgs(), UT_Win32LocaleString::fromLocale(), XAP_App::getApp(), XAP_App::getDefaultGeometry(), AP_Win32Frame::getTopLevelWindow(), handleModelessDialogMessage(), instance, AP_Args::parseOptions(), PREF_FLAG_GEOMETRY_MAXIMIZED, AP_App::saveRecoveryFiles(), SET_CRT_DEBUG_FIELD, XAP_Frame::showMessageBox(), shutdown(), UT_continue_if_fail, UT_DispatchMessage(), UT_GetMessage(), UT_return_val_if_fail, UT_UTF8String::utf8_str(), and UT_Win32LocaleString::utf8_str().
Referenced by WinMain(), and wWinMain().
const bool AP_Win32App::m_bForceAnsi = false [static, protected] |
AP_Win32Clipboard* AP_Win32App::m_pClipboard [protected] |
XAP_StringSet* AP_Win32App::m_pStringSet [protected] |
Referenced by AP_Win32App(), getStringSet(), initialize(), and ~AP_Win32App().