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