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

ap_UnixApp.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 /*****************************************************************
00021 ******************************************************************
00022 ** Only one of these is created by the application.
00023 ******************************************************************
00024 *****************************************************************/
00025 
00026 #ifndef AP_UNIXAPP_H
00027 #define AP_UNIXAPP_H
00028 
00029 #include "ut_types.h"
00030 #include "ut_bytebuf.h"
00031 #include "ap_App.h"
00032 #include "ap_UnixPrefs.h"
00033 #include "ap_UnixClipboard.h"
00034 #include "pt_Types.h"
00035 
00036 //#define LOGFILE
00037 /* Define if your user name is msevior */
00038 /* #undef LOGFILE */
00039 
00040 #ifdef LOGFILE
00041 FILE * getlogfile(void);
00042 #endif
00043 
00044 class XAP_StringSet;
00045 class AV_View;
00046 class GR_Image;
00047 class AP_Args;
00048 class AP_BuiltinStringSet;
00049 class AP_DiskStringSet;
00050 
00051 class ABI_EXPORT AP_UnixApp : public AP_App
00052 {
00053 public:
00054     AP_UnixApp(const char * szAppName);
00055     virtual ~AP_UnixApp();
00056 
00057     virtual bool                    initialize(bool has_display);
00058     virtual XAP_Frame *             newFrame(void);
00059     virtual bool                    forgetFrame(XAP_Frame * pFrame);
00060     virtual GR_Graphics *           newDefaultScreenGraphics() const;
00061 
00062     virtual bool                    shutdown(void);
00063     virtual bool                    getPrefsValueDirectory(bool bAppSpecific,
00064                                            const gchar * szKey, const gchar ** pszValue) const;
00065     virtual const XAP_StringSet *                   getStringSet(void) const;
00066     virtual const char *                    getAbiSuiteAppDir(void) const;
00067     virtual const std::string&          getAbiSuiteAppUIDir(void) const;
00068 
00069     virtual void                    copyToClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard = true);
00070     virtual void                    pasteFromClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard, bool bHonorFormatting = true);
00071     virtual bool                    canPasteFromClipboard(void);
00072     virtual void                    addClipboardFmt (const char * szFormat) {m_pClipboard->addFormat(szFormat);}
00073     virtual void                    deleteClipboardFmt (const char * szFormat) {m_pClipboard->deleteFormat(szFormat);}
00074 
00075     virtual void                    setSelectionStatus(AV_View * pView);
00076 
00081     inline virtual void                             setViewSelection( AV_View * pView)
00082     { m_pViewSelection = pView; }
00083 
00088     inline virtual AV_View *                        getViewSelection(void)
00089     { return m_pViewSelection; }
00090     virtual void                    clearSelection(void);
00091     virtual bool                    getCurrentSelection(const char** formatList,
00092                                                         void ** ppData, UT_uint32 * pLen,
00093                                                         const char **pszFormatFound);
00094     virtual void                    cacheCurrentSelection(AV_View *);
00095 
00096     static int main (const char * szAppName, int argc, char ** argv);
00097 
00098     void                            catchSignals(int sig_num) ABI_NORETURN;
00099     void loadAllPlugins ();
00100 
00101     virtual void errorMsgBadArg(const char *msg);
00102     virtual void errorMsgBadFile(XAP_Frame * pFrame, const char * file,
00103                                  UT_Error error);
00104     virtual bool doWindowlessArgs (const AP_Args *, bool & bSuccess);
00105     bool makePngPreview(const char * pszInFile,const char * pszPNGFile,  UT_sint32 iWidth, UT_sint32 iHeight);
00106     AP_DiskStringSet * loadStringsFromDisk(const char          * szStringSet,
00107                                            AP_BuiltinStringSet * pFallbackStringSet);
00108 
00109     virtual XAP_UnixClipboard * getClipboard () { return m_pClipboard; }
00110 
00111 protected:  // JCA: Why in the hell we have so many (any) protected
00112         // variables?
00113     XAP_StringSet *         m_pStringSet;
00114     AP_UnixClipboard *      m_pClipboard;
00115 
00116     bool                    m_bHasSelection;
00117     bool                    m_bSelectionInFlux;
00118     bool                    m_cacheDeferClear;
00119     AV_View *               m_pViewSelection;
00120     AV_View *               m_cacheSelectionView;
00121     XAP_Frame *             m_pFrameSelection;
00122     UT_ByteBuf              m_selectionByteBuf;
00123     PD_DocumentRange        m_cacheDocumentRangeOfSelection;
00124 };
00125 
00126 // HACK What follows is an ugly hack. It is neccessitated by the
00127 // C/C++ conflict over pointers to member functions. It is,
00128 // however, what the C++ FAQ reccommends.
00129 
00130 void signalWrapper(int);
00131 
00132 #endif /* AP_UNIXAPP_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1