00001 /* 00002 * AbiCommand - Abiword plugin for a command line interface 00003 * Copyright (C) 2002 by Martin Sevior 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 #ifndef PLUGIN_ABICOMMAND_H 00022 #define PLUGIN_ABICOMMAND_H 00023 #include "ut_string_class.h" 00024 class PD_Document; 00025 class AP_UnixFrame; 00026 class AV_View; 00027 class CairoNull_Graphics; 00028 class FL_DocLayout; 00029 class XAP_App; 00030 class UT_UTF8String; 00031 class PD_DocumentRDF; 00032 00033 class AbiCommand 00034 { 00035 public: 00036 AbiCommand(void); 00037 AbiCommand(bool bAbiCollab); 00038 ~AbiCommand(void); 00039 void doCommands(void); 00040 UT_sint32 parseTokens(UT_GenericVector<const UT_UTF8String*> * pToks); 00041 bool printFiles(const UT_GenericVector<const UT_UTF8String*> * pToks); 00042 bool replaceAll(const UT_GenericVector<const UT_UTF8String*> * pToks); 00043 bool replaceNext(const UT_GenericVector<const UT_UTF8String*> * pToks); 00044 bool movePoint(const UT_GenericVector<const UT_UTF8String*> * pToks); 00045 bool deleteText(const UT_GenericVector<const UT_UTF8String*> * pToks); 00046 bool insertText(const UT_GenericVector<const UT_UTF8String*> * pToks); 00047 bool replaceDocument(PD_Document * pDoc); 00048 bool loadDocument(UT_UTF8String & sPathToDoc); 00049 bool newDocument(void); 00050 PD_Document * getCurrentDocument(); 00051 void clearTokenVector(UT_GenericVector<const UT_UTF8String*> & Toks); 00052 bool invoke(const char * pszCommand); 00053 bool tokenizeString(UT_GenericVector<const UT_UTF8String*> & tok, char * pStr); 00054 void nullUpdate(); 00055 bool removeGraphicalView(void); 00056 void deleteCurrentDoc(void); 00057 bool viewDoc(void); 00058 private: 00059 PD_Document * m_pCurDoc; 00060 UT_UTF8String * m_pCurFile; 00061 AP_UnixFrame * m_pCurFrame; 00062 AV_View * m_pCurView; 00063 CairoNull_Graphics * m_pG; 00064 FL_DocLayout * m_pLayout; 00065 XAP_App * m_pApp; 00066 bool m_bViewDoc; 00067 bool m_bRunAsServer; 00068 UT_uint32 m_iPID; 00069 bool m_bRunAsAbiCollab; 00070 UT_UTF8String m_sErrorFile; 00071 00072 PD_RDFModelHandle m_rdf_context_model; 00073 PD_DocumentRDFMutationHandle m_rdf_mutation; 00074 std::set< std::string > m_rdf_xmlids; 00075 00076 PD_RDFModelHandle getRDFModel() const; 00077 PD_DocumentRDFHandle getRDF() const; 00078 FV_View* getView() const; 00079 }; 00080 00081 #endif /* PLUGIN_ABICOMMAND_H */ 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093