kpresenter

KPrTextViewIface.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KPrTextViewIface.h"
21
22#include "KPrTextObject.h"
23#include <tdeapplication.h>
24#include <dcopclient.h>
25
26KPrTextViewIface::KPrTextViewIface( KPrTextView *_textview )
27 :KoTextViewIface(_textview)
28{
29 m_textview = _textview;
30}
31
32void KPrTextViewIface::insertVariable( int type, int subtype )
33{
34 m_textview->insertVariable(type,subtype);
35}
36
37void KPrTextViewIface::insertCustomVariable( const TQString &name)
38{
39 m_textview->insertCustomVariable(name);
40}
41
42void KPrTextViewIface::insertLink(const TQString &_linkName, const TQString & hrefName)
43{
44 m_textview->insertLink(_linkName,hrefName);
45}
46
47void KPrTextViewIface::clearSelection()
48{
49 m_textview->clearSelection();
50}
51
52void KPrTextViewIface::selectAll()
53{
54 m_textview->selectAll();
55}
56
57void KPrTextViewIface::cut()
58{
59 m_textview->cut();
60}
61
62void KPrTextViewIface::copy()
63{
64 m_textview->copy();
65}
66
67void KPrTextViewIface::paste()
68{
69 m_textview->paste();
70}
71
72void KPrTextViewIface::insertVariable( const TQString & var)
73{
74 if( var=="DATE")
75 m_textview->insertVariable(0,1);
76 else if (var=="FIXED-DATE")
77 m_textview->insertVariable(0,0);
78 else if (var=="TIME")
79 m_textview->insertVariable(2,1);
80 else if (var=="FIXED-TIME")
81 m_textview->insertVariable(2,0);
82 else if (var=="FILENAME")
83 m_textview->insertVariable(8,0);
84 else if (var=="AUTHORNAME")
85 m_textview->insertVariable(8,2);
86 else if (var=="EMAIL")
87 m_textview->insertVariable(8,3);
88 else if (var=="TITLE")
89 m_textview->insertVariable(8,10);
90 else if (var=="ABSTRACT")
91 m_textview->insertVariable(8,11);
92 else if (var=="DIRECTORYNAME")
93 m_textview->insertVariable(8,1);
94 else if (var=="COMPANYNAME")
95 m_textview->insertVariable(8,4);
96 else if (var=="PATHFILENAME")
97 m_textview->insertVariable(8,5);
98 else if (var=="FILENAMEWITHOUTEXTENSION")
99 m_textview->insertVariable(8,6);
100 else if (var=="CURRENTPAGE")
101 m_textview->insertVariable(4,0);
102 else if (var=="TOTALPAGE")
103 m_textview->insertVariable(4,1);
104 else if (var=="TELEPHONE")
105 m_textview->insertVariable(8,7);
106 else if (var=="FAX")
107 m_textview->insertVariable(8,8);
108 else if (var=="COUNTRY")
109 m_textview->insertVariable(8,9);
110 else if (var=="POSTAL_CODE")
111 m_textview->insertVariable(8,12);
112 else if (var=="CITY")
113 m_textview->insertVariable(8,13);
114 else if (var=="STREET")
115 m_textview->insertVariable(8,14);
116}
117
118void KPrTextViewIface::insertNote(const TQString &_note)
119{
120 m_textview->insertComment(_note);
121}