kword

KWordTextFrameSetEditIface.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 "KWordTextFrameSetEditIface.h"
21
22#include "KWTextFrameSet.h"
23#include <dcopclient.h>
24#include "defs.h"
25
26KWordTextFrameSetEditIface::KWordTextFrameSetEditIface( KWTextFrameSetEdit *_framesetedit )
27 :KoTextViewIface(_framesetedit)
28{
29 m_framesetedit = _framesetedit;
30}
31
32void KWordTextFrameSetEditIface::insertExpression(const TQString &_c)
33{
34 m_framesetedit->insertExpression(_c);
35}
36
37void KWordTextFrameSetEditIface::insertFrameBreak()
38{
39 m_framesetedit->insertFrameBreak();
40}
41
42void KWordTextFrameSetEditIface::insertVariable( int type, int subtype )
43{
44 m_framesetedit->insertVariable(type,subtype);
45}
46
47void KWordTextFrameSetEditIface::insertCustomVariable( const TQString &name)
48{
49 m_framesetedit->insertCustomVariable(name);
50}
51
52void KWordTextFrameSetEditIface::insertLink(const TQString &_linkName, const TQString & hrefName)
53{
54 m_framesetedit->insertLink(_linkName,hrefName);
55}
56
57void KWordTextFrameSetEditIface::insertTOC()
58{
59 m_framesetedit->insertTOC();
60}
61
62void KWordTextFrameSetEditIface::cut()
63{
64 m_framesetedit->cut();
65}
66
67void KWordTextFrameSetEditIface::copy()
68{
69 m_framesetedit->copy();
70}
71
72void KWordTextFrameSetEditIface::paste()
73{
74 m_framesetedit->paste();
75}
76
77void KWordTextFrameSetEditIface::insertNonbreakingSpace()
78{
79 m_framesetedit->insertNonbreakingSpace();
80}
81
82void KWordTextFrameSetEditIface::insertVariable( const TQString & var)
83{
84 if( var=="DATE")
85 m_framesetedit->insertVariable(0,1);
86 else if (var=="FIXED-DATE")
87 m_framesetedit->insertVariable(0,0);
88 else if (var=="TIME")
89 m_framesetedit->insertVariable(2,1);
90 else if (var=="FIXED-TIME")
91 m_framesetedit->insertVariable(2,0);
92 else if (var=="FILENAME")
93 m_framesetedit->insertVariable(8,0);
94 else if (var=="AUTHORNAME")
95 m_framesetedit->insertVariable(8,2);
96 else if (var=="EMAIL")
97 m_framesetedit->insertVariable(8,3);
98 else if (var=="TITLE")
99 m_framesetedit->insertVariable(8,10);
100 else if (var=="ABSTRACT")
101 m_framesetedit->insertVariable(8,11);
102 else if (var=="DIRECTORYNAME")
103 m_framesetedit->insertVariable(8,1);
104 else if (var=="COMPANYNAME")
105 m_framesetedit->insertVariable(8,4);
106 else if (var=="PATHFILENAME")
107 m_framesetedit->insertVariable(8,5);
108 else if (var=="FILENAMEWITHOUTEXTENSION")
109 m_framesetedit->insertVariable(8,6);
110 else if (var=="CURRENTPAGE")
111 m_framesetedit->insertVariable(4,0);
112 else if (var=="TOTALPAGE")
113 m_framesetedit->insertVariable(8,1);
114 else if (var=="TELEPHONE")
115 m_framesetedit->insertVariable(8,7);
116 else if (var=="FAX")
117 m_framesetedit->insertVariable(8,8);
118 else if (var=="COUNTRY")
119 m_framesetedit->insertVariable(8,9);
120 else if (var=="POSTAL_CODE")
121 m_framesetedit->insertVariable(8,12);
122 else if (var=="CITY")
123 m_framesetedit->insertVariable(8,13);
124 else if (var=="STREET")
125 m_framesetedit->insertVariable(8,14);
126}
127
128void KWordTextFrameSetEditIface::insertComment(const TQString &_comment)
129{
130 m_framesetedit->insertComment(_comment);
131}
132
133
134void KWordTextFrameSetEditIface::insertAutoFootNote( const TQString & type )
135{
136 if ( type.lower() =="footnote")
137 {
138 m_framesetedit->insertFootNote( FootNote, KWFootNoteVariable::Auto, TQString());
139 }
140 else if ( type.lower()=="endnote")
141 {
142 m_framesetedit->insertFootNote( EndNote, KWFootNoteVariable::Auto, TQString());
143 }
144}
145
146void KWordTextFrameSetEditIface::insertManualFootNote( const TQString & type, const TQString & noteText )
147{
148 if ( type.lower() =="footnote")
149 {
150 m_framesetedit->insertFootNote( FootNote, KWFootNoteVariable::Manual, noteText);
151 }
152 else if ( type.lower()=="endnote")
153 {
154 m_framesetedit->insertFootNote( EndNote, KWFootNoteVariable::Manual, noteText);
155 }
156}
157
158void KWordTextFrameSetEditIface::selectAll()
159{
160 m_framesetedit->selectAll();
161}
Object that is created to edit a Text frame set (KWTextFrameSet).