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

ap_CocoaApp.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiWord
00004  * Copyright (C) 1998 AbiSource, Inc.
00005  * Copyright (C) 2004 Francis James Franklin
00006  * Copyright (C) 2001-2004, 2009 Hubert Figuiere
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00021  * 02110-1301 USA.
00022  */
00023 
00024 /*****************************************************************
00025 ******************************************************************
00026 ** Only one of these is created by the application.
00027 ******************************************************************
00028 *****************************************************************/
00029 
00030 #ifndef AP_COCOAAPP_H
00031 #define AP_COCOAAPP_H
00032 
00033 #include "ut_types.h"
00034 #include "ap_App.h"
00035 #include "ut_bytebuf.h"
00036 #include "xap_CocoaApp.h"
00037 #include "pt_Types.h"
00038 
00039 
00040 class AP_Args;
00041 class XAP_StringSet;
00042 class AV_View;
00043 class GR_Image;
00044 class AP_CocoaClipboard;
00045 
00046 class AP_CocoaApp : public AP_App
00047 {
00048 public:
00049     AP_CocoaApp(const char * szAppName);
00050 
00051     virtual ~AP_CocoaApp();
00052 
00053     virtual bool                    initialize(void);
00054     virtual void                    rebuildMenus(void);
00055     virtual XAP_Frame *             newFrame(void);
00056     virtual bool                    forgetFrame(XAP_Frame * pFrame);
00057     virtual bool                    shutdown(void);
00058     virtual bool                    getPrefsValueDirectory(bool bAppSpecific, const gchar * szKey, const gchar ** pszValue) const;
00059     virtual const XAP_StringSet *   getStringSet(void) const;
00060     virtual const char *            getAbiSuiteAppDir(void) const;
00061     virtual void                    copyToClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard = true);
00062     virtual void                    pasteFromClipboard(PD_DocumentRange * pDocRange, bool bUseClipboard, bool bHonorFormatting = true);
00063     virtual bool                    canPasteFromClipboard(void);
00064 
00065     virtual void                    setSelectionStatus(AV_View * pView);
00066 
00071     inline virtual void                             setViewSelection( AV_View * pView)
00072     { m_pViewSelection = pView; }
00073 
00078     inline virtual AV_View *                        getViewSelection(void)
00079     { return m_pViewSelection; }
00080     virtual void                    clearSelection(void);
00081     virtual bool                    getCurrentSelection(const char** formatList,
00082                                                         void ** ppData, UT_uint32 * pLen,
00083                                                         const char **pszFormatFound);
00084     virtual void                    cacheCurrentSelection(AV_View *);
00085 
00086     static int main (const char * szAppName, int argc, char ** argv);
00087 
00088     void                            catchSignals(int sig_num) ABI_NORETURN;
00089 
00090     void loadAllPlugins ();
00091 
00092     virtual void errorMsgBadArg(const char*);
00093     virtual void errorMsgBadFile(XAP_Frame * pFrame, const char * file,
00094                                  UT_Error error);
00095     virtual bool doWindowlessArgs (const AP_Args *, bool & bSuccess);
00096     virtual GR_Graphics * newDefaultScreenGraphics() const
00097         { UT_ASSERT(UT_NOT_IMPLEMENTED); return NULL; };
00098 
00099 private:    // JCA: Why in the hell we have so many (any) protected variables?
00100     XAP_StringSet *         m_pStringSet;
00101     AP_CocoaClipboard *     m_pClipboard;
00102 
00103     bool                    m_bHasSelection;
00104     bool                    m_bSelectionInFlux;
00105     bool                    m_cacheDeferClear;
00106     AV_View *               m_pViewSelection;
00107     AV_View *               m_cacheSelectionView;
00108     XAP_Frame *             m_pFrameSelection;
00109     UT_ByteBuf              m_selectionByteBuf;
00110     PD_DocumentRange        m_cacheDocumentRangeOfSelection;
00111 };
00112 
00113 // HACK What follows is an ugly hack. It is neccessitated by the
00114 // C/C++ conflict over pointers to member functions. It is,
00115 // however, what the C++ FAQ reccommends.
00116 
00117 void signalWrapper(int) ABI_NORETURN;
00118 
00119 #endif /* AP_COCOAAPP_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1