Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef AP_WIN32APP_H
00027 #define AP_WIN32APP_H
00028
00029 #include "ap_App.h"
00030 #include "ap_Win32Prefs.h"
00031 #include "ap_Win32Clipboard.h"
00032 #include "ie_types.h"
00033 #include "ut_string_class.h"
00034 #include "ut_Win32LocaleString.h"
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 class PD_DocumentRange;
00057
00060
00061 class ABI_EXPORT AP_Win32App : public AP_App
00062 {
00063 public:
00064 AP_Win32App(HINSTANCE hInstance, const char * szAppName);
00065 virtual ~AP_Win32App(void);
00066
00067 virtual bool initialize(void);
00068 virtual XAP_Frame * newFrame(void);
00069 virtual bool shutdown(void);
00070 virtual bool getPrefsValueDirectory(bool bAppSpecific,
00071 const gchar * szKey, const gchar ** pszValue) const;
00072 virtual const XAP_StringSet * getStringSet(void) const;
00073 virtual const char * getAbiSuiteAppDir(void) const;
00074 virtual void copyToClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard = true);
00075 virtual GR_Graphics * newDefaultScreenGraphics() const;
00076
00077
00078 #ifdef COPY_ON_DEMAND
00079
00080 bool copyFmtToClipboardOnDemand(UINT iFmt);
00081 bool copyAllFmtsToClipboardOnDemand();
00082 #endif
00083
00084 virtual void pasteFromClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard, bool bHonorFormatting);
00085 virtual bool canPasteFromClipboard(void);
00086 virtual void cacheCurrentSelection(AV_View *) {};
00087
00088 virtual void errorMsgBadArg(const char *msg);
00089 virtual void errorMsgBadFile(XAP_Frame * pFrame, const char * file, UT_Error error);
00090 virtual bool doWindowlessArgs (const AP_Args *, bool & bSuccess);
00091
00092 static int WinMain (const char * szAppName, HINSTANCE hInstance,
00093 HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow);
00094
00095 virtual HICON getIcon(void);
00096 virtual HICON getSmallIcon(void);
00097
00098 virtual UT_Error fileOpen(XAP_Frame * pFrame, const char * pNewFile);
00099 UT_Vector* getInstalledUILanguages(void);
00100 bool doesStringSetExist(const char* pLocale);
00101
00102
00103
00104
00105
00106
00107 static UT_Win32LocaleString s_fromUCS4ToWinLocale(const UT_UCS4Char * szIn);
00108 static UT_UCS4String s_fromWinLocaleToUCS4(const char* szIn);
00109 static UT_Win32LocaleString s_fromUTF8ToWinLocale(const char* szIn);
00110 static UT_UTF8String s_fromWinLocaleToUTF8(const char* szIn);
00111
00112
00113
00114 bool handleModelessDialogMessage( MSG * msg );
00115
00116 virtual void catchSignals(int signum) ABI_NORETURN;
00117
00118 private:
00119 bool _copyFmtToClipboard(PD_DocumentRange * pDocRange, UINT iFmt);
00120 bool _copyFmtToClipboard(PD_DocumentRange * pDocRange, const char *pszFmt);
00121 #ifdef COPY_ON_DEMAND
00122 bool _cacheClipboardDoc(PD_DocumentRange *pDocRange);
00123 void _indicateFmtToClipboard(const char * pszFmt) const;
00124 #endif
00125 protected:
00126
00127 bool _pasteFormatFromClipboard(PD_DocumentRange * pDocRange, const char * szFormat,
00128 const char * szType, bool bWide);
00129
00130 IEFileType _getFileTypeFromDesc(const char *desc);
00131
00132 XAP_StringSet * m_pStringSet;
00133 AP_Win32Clipboard * m_pClipboard;
00134 static const bool m_bForceAnsi = false;
00135 };
00136
00137 #endif