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

xap_UnixApp.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiSource Application Framework
00004  * Copyright (C) 1998 AbiSource, Inc.
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 /*
00023  * Port to Maemo Development Platform
00024  * Author: INdT - Renato Araujo <renato.filho@indt.org.br>
00025  */
00026 
00027 
00028 #ifndef XAP_UNIXAPP_H
00029 #define XAP_UNIXAPP_H
00030 
00031 #ifdef HAVE_CONFIG_H
00032 #include "config.h"
00033 #endif
00034 
00035 #include <unistd.h>
00036 #include <sys/stat.h>
00037 #include "xap_App.h"
00038 #include "xap_UnixDialogFactory.h"
00039 #include "xap_Unix_TB_CFactory.h"
00040 
00041 class AP_UnixToolbar_Icons;
00042 class AV_View;
00043 class XAP_UnixClipboard;
00044 
00045 /*****************************************************************
00046 ******************************************************************
00047 ** Only one of these is created by the application.
00048 ******************************************************************
00049 *****************************************************************/
00050 
00051 class ABI_EXPORT XAP_UnixApp : public XAP_App
00052 {
00053 public:
00054     XAP_UnixApp(const char* szAppName);
00055     virtual ~XAP_UnixApp();
00056 
00057     virtual const char * getDefaultEncoding () const
00058       {
00059         return "UTF-8" ;
00060       }
00061 
00062     virtual bool                    initialize(const char * szKeyBindingsKey, const char * szKeyBindingsDefaultValue);
00063     void                            shutdown();
00064     virtual XAP_Frame *                     newFrame() = 0;
00065     virtual void                            reallyExit();
00066 
00067     virtual XAP_DialogFactory *             getDialogFactory();
00068     virtual XAP_Toolbar_ControlFactory *    getControlFactory();
00069     virtual const XAP_StringSet *           getStringSet() const = 0;
00070     virtual const char *                    getAbiSuiteAppDir() const = 0;
00071     virtual const std::string&                  getAbiSuiteAppUIDir() const = 0;
00072     virtual void                            copyToClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard = true) = 0;
00073     virtual void                            pasteFromClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard, bool bHonorFormatting = true) = 0;
00074     virtual bool                            canPasteFromClipboard() = 0;
00075     void                                    migrate(const char *oldName, const char *newName, const char *path) const;
00076     virtual const char *                    getUserPrivateDirectory() const;
00077 
00078     virtual void                            setSelectionStatus(AV_View * pView) = 0;
00079     virtual void                            clearSelection() = 0;
00080     virtual bool                            getCurrentSelection(const char** formatList,
00081                                                                 void ** ppData, UT_uint32 * pLen,
00082                                                                 const char **pszFormatFound) = 0;
00083     virtual void                            cacheCurrentSelection(AV_View *) = 0;
00084 
00085     virtual XAP_UnixClipboard * getClipboard () = 0;
00086 
00087     enum
00088     {
00089         GEOMETRY_FLAG_POS =     1 << 0,
00090         GEOMETRY_FLAG_SIZE =    1 << 1
00091     };
00092 
00093     struct windowGeometry
00094     {
00095         int x, y;
00096         UT_uint32 width, height;
00097         UT_uint32 flags;
00098     };
00099 
00100     virtual void                    setWinGeometry(int x, int y, UT_uint32 width, UT_uint32 height,
00101                                                 UT_uint32 flags);
00102     virtual void                    getWinGeometry(int * x, int * y, UT_uint32 * width, UT_uint32 * height,
00103                                                 UT_uint32* flags);
00104 
00105     void                            setTimeOfLastEvent(UT_uint32 eventTime);
00106     UT_uint32                       getTimeOfLastEvent() const { return m_eventTime; };
00107     virtual XAP_App::BidiSupportType  theOSHasBidiSupport() const {return BIDI_SUPPORT_GUI;}
00108     char **                          getTmpFile(void)
00109     { return &m_szTmpFile;}
00110     void                            removeTmpFile(void);
00111 protected:
00112     void                            _setAbiSuiteLibDir();
00113 
00114     AP_UnixDialogFactory            m_dialogFactory;
00115     AP_UnixToolbar_ControlFactory   m_controlFactory;
00116 
00117     windowGeometry          m_geometry;
00118     UT_uint32                   m_eventTime; // e->time field of a recent X event
00119                                          // (we use this to sync clipboard
00120                                          // operations with the server).
00121 
00122     char *                     m_szTmpFile;
00123 };
00124 
00125 #endif /* XAP_UNIXAPP_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1