kword

KWordTextFrameSetEditIface.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library 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 GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include "KWordTextFrameSetEditIface.h"
00021 
00022 #include "KWTextFrameSet.h"
00023 #include <dcopclient.h>
00024 #include "defs.h"
00025 
00026 KWordTextFrameSetEditIface::KWordTextFrameSetEditIface( KWTextFrameSetEdit *_framesetedit )
00027     :KoTextViewIface(_framesetedit)
00028 {
00029    m_framesetedit = _framesetedit;
00030 }
00031 
00032 void KWordTextFrameSetEditIface::insertExpression(const QString &_c)
00033 {
00034     m_framesetedit->insertExpression(_c);
00035 }
00036 
00037 void KWordTextFrameSetEditIface::insertFrameBreak()
00038 {
00039     m_framesetedit->insertFrameBreak();
00040 }
00041 
00042 void KWordTextFrameSetEditIface::insertVariable( int type, int subtype )
00043 {
00044     m_framesetedit->insertVariable(type,subtype);
00045 }
00046 
00047 void KWordTextFrameSetEditIface::insertCustomVariable( const QString &name)
00048 {
00049     m_framesetedit->insertCustomVariable(name);
00050 }
00051 
00052 void KWordTextFrameSetEditIface::insertLink(const QString &_linkName, const QString & hrefName)
00053 {
00054     m_framesetedit->insertLink(_linkName,hrefName);
00055 }
00056 
00057 void KWordTextFrameSetEditIface::insertTOC()
00058 {
00059     m_framesetedit->insertTOC();
00060 }
00061 
00062 void KWordTextFrameSetEditIface::cut()
00063 {
00064     m_framesetedit->cut();
00065 }
00066 
00067 void KWordTextFrameSetEditIface::copy()
00068 {
00069     m_framesetedit->copy();
00070 }
00071 
00072 void KWordTextFrameSetEditIface::paste()
00073 {
00074     m_framesetedit->paste();
00075 }
00076 
00077 void KWordTextFrameSetEditIface::insertNonbreakingSpace()
00078 {
00079     m_framesetedit->insertNonbreakingSpace();
00080 }
00081 
00082 void KWordTextFrameSetEditIface::insertVariable( const QString & var)
00083 {
00084   if( var=="DATE")
00085     m_framesetedit->insertVariable(0,1);
00086   else if (var=="FIXED-DATE")
00087     m_framesetedit->insertVariable(0,0);
00088   else if (var=="TIME")
00089     m_framesetedit->insertVariable(2,1);
00090   else if (var=="FIXED-TIME")
00091     m_framesetedit->insertVariable(2,0);
00092   else if (var=="FILENAME")
00093     m_framesetedit->insertVariable(8,0);
00094   else if (var=="AUTHORNAME")
00095     m_framesetedit->insertVariable(8,2);
00096   else if (var=="EMAIL")
00097     m_framesetedit->insertVariable(8,3);
00098   else if (var=="TITLE")
00099     m_framesetedit->insertVariable(8,10);
00100   else if (var=="ABSTRACT")
00101     m_framesetedit->insertVariable(8,11);
00102   else if (var=="DIRECTORYNAME")
00103     m_framesetedit->insertVariable(8,1);
00104   else if (var=="COMPANYNAME")
00105     m_framesetedit->insertVariable(8,4);
00106   else if (var=="PATHFILENAME")
00107     m_framesetedit->insertVariable(8,5);
00108   else if (var=="FILENAMEWITHOUTEXTENSION")
00109     m_framesetedit->insertVariable(8,6);
00110   else if (var=="CURRENTPAGE")
00111     m_framesetedit->insertVariable(4,0);
00112   else if (var=="TOTALPAGE")
00113     m_framesetedit->insertVariable(8,1);
00114   else if (var=="TELEPHONE")
00115     m_framesetedit->insertVariable(8,7);
00116   else if (var=="FAX")
00117     m_framesetedit->insertVariable(8,8);
00118   else if (var=="COUNTRY")
00119     m_framesetedit->insertVariable(8,9);
00120   else if (var=="POSTAL_CODE")
00121     m_framesetedit->insertVariable(8,12);
00122   else if (var=="CITY")
00123     m_framesetedit->insertVariable(8,13);
00124   else if (var=="STREET")
00125     m_framesetedit->insertVariable(8,14);
00126 }
00127 
00128 void KWordTextFrameSetEditIface::insertComment(const QString &_comment)
00129 {
00130     m_framesetedit->insertComment(_comment);
00131 }
00132 
00133 
00134 void KWordTextFrameSetEditIface::insertAutoFootNote( const QString & type )
00135 {
00136     if ( type.lower() =="footnote")
00137     {
00138         m_framesetedit->insertFootNote( FootNote, KWFootNoteVariable::Auto, QString::null);
00139     }
00140     else if ( type.lower()=="endnote")
00141     {
00142         m_framesetedit->insertFootNote( EndNote, KWFootNoteVariable::Auto, QString::null);
00143     }
00144 }
00145 
00146 void KWordTextFrameSetEditIface::insertManualFootNote( const QString & type, const QString & noteText )
00147 {
00148     if ( type.lower() =="footnote")
00149     {
00150         m_framesetedit->insertFootNote( FootNote, KWFootNoteVariable::Manual, noteText);
00151     }
00152     else if ( type.lower()=="endnote")
00153     {
00154         m_framesetedit->insertFootNote( EndNote, KWFootNoteVariable::Manual, noteText);
00155     }
00156 }
00157 
00158 void KWordTextFrameSetEditIface::selectAll()
00159 {
00160     m_framesetedit->selectAll();
00161 }
KDE Home | KDE Accessibility Home | Description of Access Keys