• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

xap_Win32App.h

Go to the documentation of this file.
00001 /* AbiSource Application Framework
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  * BIDI Copyright (c) 2001,2002 Tomas Frydrych
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 
00022 #ifndef XAP_WIN32APP_H
00023 #define XAP_WIN32APP_H
00024 
00025 #include <windows.h>
00026 #include <tchar.h>
00027 #include "xap_App.h"
00028 #include "xap_Win32DialogFactory.h"
00029 #include "xap_Win32_TB_CFactory.h"
00030 #include "xap_Strings.h"
00031 
00032 #define MAX_CONVBUFFER 256
00033 
00034 class XAP_Win32Slurp;
00035 class XAP_Win32Toolbar_Icons;
00036 
00037 /*****************************************************************
00038 ******************************************************************
00039 ** Only one of these is created by the application.
00040 ******************************************************************
00041 *****************************************************************/
00042 
00043 class ABI_EXPORT XAP_Win32App : public XAP_App
00044 {
00045 public:
00046     XAP_Win32App(HINSTANCE hInstance, const char * szAppName);
00047     virtual ~XAP_Win32App(void);
00048 
00049     virtual const char * getDefaultEncoding () const;
00050 
00051     static const WCHAR * getWideString (const char * p_str);
00052     static const char * getUTF8String (const WCHAR * p_str);
00053 
00054     virtual bool                            initialize(const char * szKeyBindingsKey, const char * szKeyBindingsDefaultValue);
00055     virtual XAP_Frame *                     newFrame(void) = 0;
00056     virtual void                            reallyExit(void);
00057 
00058     virtual HINSTANCE                       getInstance() const;
00059 
00060     virtual XAP_DialogFactory *             getDialogFactory(void);
00061     virtual XAP_Toolbar_ControlFactory *    getControlFactory(void);
00062     virtual const XAP_StringSet *           getStringSet(void) const = 0;
00063     virtual const char *                    getAbiSuiteAppDir(void) const = 0;
00064     virtual void                            copyToClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard = true) = 0;
00065     virtual void                            pasteFromClipboard(PD_DocumentRange * pDocRange, bool, bool) = 0;
00066     virtual bool                            canPasteFromClipboard(void) = 0;
00067     virtual void                            cacheCurrentSelection(AV_View *) = 0;
00068     virtual const char *                    getUserPrivateDirectory(void) const;
00069 
00070     virtual HICON                           getIcon(void) = 0;
00071     virtual HICON                           getSmallIcon(void) = 0;
00072 
00073     virtual UT_Error                        fileOpen(XAP_Frame * pFrame, const char * pNewFile) = 0;
00074 
00075     void                                    enableAllTopLevelWindows(bool);
00076     virtual UT_sint32               setupWindowFromPrefs(UT_sint32 iCmdShow, HWND hwndFrame);
00077     virtual XAP_App::BidiSupportType        theOSHasBidiSupport() const {return m_eBidiOS;}
00078 
00079     void                                    getDefaultGeometry(UT_uint32& width,
00080                                                                UT_uint32& height,
00081                                                                UT_uint32& flags);
00082 
00083     void                                    setHKL(HKL hkl) {m_hkl = hkl;}
00084     HKL                                     getHKL()const {return m_hkl;}
00085     void                                    setKbdLanguage(HKL hkl);
00086 
00087 protected:
00088     UT_uint32                               _getExeDir(LPWSTR pDirBuf, UT_uint32 iBufLen);
00089     void                                    _setAbiSuiteLibDir(void);
00090     void                                    _setBidiOS(void);
00091     virtual const char *                    _getKbdLanguage();
00092 
00093     HINSTANCE                               m_hInstance;
00094     AP_Win32DialogFactory                   m_dialogFactory;
00095     AP_Win32Toolbar_ControlFactory          m_controlFactory;
00096 
00097     XAP_Win32Slurp *                        m_pSlurp;
00098     static char m_buffer[MAX_CONVBUFFER*6];
00099     static WCHAR m_wbuffer[MAX_CONVBUFFER];
00100 
00101 private:
00102     XAP_App::BidiSupportType                m_eBidiOS;
00103     HKL                                     m_hkl; // kbd layout
00104                                                    // handle
00105 };
00106 
00107 #endif /* XAP_WIN32APP_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1