kpresenter

KPrTextViewIface.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include "KPrTextViewIface.h"
00022 
00023 #include "KPrTextObject.h"
00024 #include <kapplication.h>
00025 #include <dcopclient.h>
00026 
00027 KPrTextViewIface::KPrTextViewIface( KPrTextView *_textview )
00028     :KoTextViewIface(_textview)
00029 {
00030     m_textview = _textview;
00031 }
00032 
00033 void KPrTextViewIface::insertVariable( int type, int subtype )
00034 {
00035     m_textview->insertVariable(type,subtype);
00036 }
00037 
00038 void KPrTextViewIface::insertCustomVariable( const QString &name)
00039 {
00040     m_textview->insertCustomVariable(name);
00041 }
00042 
00043 void KPrTextViewIface::insertLink(const QString &_linkName, const QString & hrefName)
00044 {
00045     m_textview->insertLink(_linkName,hrefName);
00046 }
00047 
00048 void KPrTextViewIface::clearSelection()
00049 {
00050     m_textview->clearSelection();
00051 }
00052 
00053 void KPrTextViewIface::selectAll()
00054 {
00055     m_textview->selectAll();
00056 }
00057 
00058 void KPrTextViewIface::cut()
00059 {
00060     m_textview->cut();
00061 }
00062 
00063 void KPrTextViewIface::copy()
00064 {
00065     m_textview->copy();
00066 }
00067 
00068 void KPrTextViewIface::paste()
00069 {
00070     m_textview->paste();
00071 }
00072 
00073 void KPrTextViewIface::insertVariable( const QString & var)
00074 {
00075     if( var=="DATE")
00076         m_textview->insertVariable(0,1);
00077     else if (var=="FIXED-DATE")
00078         m_textview->insertVariable(0,0);
00079     else if (var=="TIME")
00080         m_textview->insertVariable(2,1);
00081     else if (var=="FIXED-TIME")
00082         m_textview->insertVariable(2,0);
00083     else if (var=="FILENAME")
00084         m_textview->insertVariable(8,0);
00085     else if (var=="AUTHORNAME")
00086         m_textview->insertVariable(8,2);
00087     else if (var=="EMAIL")
00088         m_textview->insertVariable(8,3);
00089     else if (var=="TITLE")
00090         m_textview->insertVariable(8,10);
00091     else if (var=="ABSTRACT")
00092         m_textview->insertVariable(8,11);
00093     else if (var=="DIRECTORYNAME")
00094         m_textview->insertVariable(8,1);
00095     else if (var=="COMPANYNAME")
00096         m_textview->insertVariable(8,4);
00097     else if (var=="PATHFILENAME")
00098         m_textview->insertVariable(8,5);
00099     else if (var=="FILENAMEWITHOUTEXTENSION")
00100         m_textview->insertVariable(8,6);
00101     else if (var=="CURRENTPAGE")
00102         m_textview->insertVariable(4,0);
00103     else if (var=="TOTALPAGE")
00104         m_textview->insertVariable(4,1);
00105     else if (var=="TELEPHONE")
00106         m_textview->insertVariable(8,7);
00107     else if (var=="FAX")
00108         m_textview->insertVariable(8,8);
00109     else if (var=="COUNTRY")
00110         m_textview->insertVariable(8,9);
00111     else if (var=="POSTAL_CODE")
00112         m_textview->insertVariable(8,12);
00113     else if (var=="CITY")
00114         m_textview->insertVariable(8,13);
00115     else if (var=="STREET")
00116         m_textview->insertVariable(8,14);
00117 }
00118 
00119 void KPrTextViewIface::insertNote(const QString &_note)
00120 {
00121     m_textview->insertComment(_note);
00122 }
KDE Home | KDE Accessibility Home | Description of Access Keys