kpresenter

KPrObjectIface.cpp
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include "KPrObjectIface.h"
22
23#include "KPrObject.h"
24#include <kdebug.h>
25#include <tdeapplication.h>
26#include <dcopclient.h>
27
28KPrObjectIface::KPrObjectIface( KPrObject *obj_ )
29 : DCOPObject()
30{
31 obj = obj_;
32}
33
34int KPrObjectIface::getType() const
35{
36 return (int)obj->getType();
37}
38
39bool KPrObjectIface::isSelected() const
40{
41 return obj->isSelected();
42}
43
44float KPrObjectIface::angle() const
45{
46 return obj->getAngle();
47}
48
49int KPrObjectIface::shadowDistance() const
50{
51 return obj->getShadowDistance();
52}
53
54int KPrObjectIface::shadowDirection() const
55{
56 return (int)obj->getShadowDirection();
57}
58
59TQColor KPrObjectIface::shadowColor() const
60{
61 return obj->getShadowColor();
62}
63
64int KPrObjectIface::effect() const
65{
66 return (int)obj->getEffect();
67}
68
69int KPrObjectIface::effect2() const
70{
71 return (int)obj->getEffect2();
72}
73
74int KPrObjectIface::appearStep() const
75{
76 return obj->getAppearStep();
77}
78
79int KPrObjectIface::subPresSteps() const
80{
81 return obj->getSubPresSteps();
82}
83
84bool KPrObjectIface::disappear() const
85{
86 return obj->getDisappear();
87}
88
89int KPrObjectIface::disappearStep() const
90{
91 return obj->getDisappearStep();
92}
93
94int KPrObjectIface::effect3() const
95{
96 return (int)obj->getEffect3();
97}
98
99void KPrObjectIface::setSelected( bool _selected )
100{
101 obj->setSelected(_selected);
102}
103
104void KPrObjectIface::rotate( float _angle )
105{
106 obj->rotate(_angle);
107}
108
109void KPrObjectIface::setShadowDistance( int _distance )
110{
111 obj->setShadowDistance(_distance);
112}
113
114void KPrObjectIface::shadowColor( const TQColor & _color )
115{
116 obj->setShadowColor(_color);
117}
118
119void KPrObjectIface::setAppearTimer( int _appearTimer )
120{
121 obj->setAppearTimer(_appearTimer);
122}
123
124void KPrObjectIface::setDisappearTimer( int _disappearTimer )
125{
126 obj->setDisappearTimer(_disappearTimer);
127}
128
129void KPrObjectIface::setAppearSoundEffect( bool b )
130{
131 obj->setAppearSoundEffect(b);
132}
133
134void KPrObjectIface::setDisappearSoundEffect( bool b )
135{
136 obj->setDisappearSoundEffect(b);
137}
138void KPrObjectIface::setAppearSoundEffectFileName( const TQString & _a_fileName )
139{
140 obj->setAppearSoundEffectFileName(_a_fileName);
141}
142void KPrObjectIface::setDisappearSoundEffectFileName( const TQString &_d_fileName )
143{
144 obj->setDisappearSoundEffectFileName(_d_fileName);
145}
146
147void KPrObjectIface::setObjectName( const TQString &_objectName )
148{
149 obj->setObjectName(_objectName);
150}
151
152void KPrObjectIface::setAppearStep( int _appearStep )
153{
154 obj->setAppearStep(_appearStep);
155}
156
157void KPrObjectIface::setDisappear( bool b )
158{
159 obj->setDisappear(b);
160}
161
162int KPrObjectIface::appearTimer() const
163{
164 return obj->getAppearTimer();
165}
166
167int KPrObjectIface::disappearTimer() const
168{
169 return obj->getDisappearTimer();
170}
171
172bool KPrObjectIface::appearSoundEffect() const
173{
174 return obj->getAppearSoundEffect();
175}
176
177bool KPrObjectIface::disappearSoundEffect() const
178{
179 return obj->getDisappearSoundEffect();
180}
181
182TQString KPrObjectIface::appearSoundEffectFileName() const
183{
184 return obj->getAppearSoundEffectFileName();
185}
186
187TQString KPrObjectIface::disappearSoundEffectFileName() const
188{
189 return obj->getDisappearSoundEffectFileName();
190}
191
192TQString KPrObjectIface::typeString() const
193{
194 return obj->getTypeString();
195}
196
197void KPrObjectIface::setEffect(const TQString & effect)
198{
199 if(effect=="NONE")
200 obj->setEffect(EF_NONE);
201 else if(effect=="COME_RIGHT")
202 obj->setEffect(EF_COME_RIGHT);
203 else if(effect=="COME_LEFT")
204 obj->setEffect(EF_COME_LEFT);
205 else if(effect=="COME_TOP")
206 obj->setEffect(EF_COME_TOP);
207 else if(effect=="COME_BOTTOM")
208 obj->setEffect(EF_COME_BOTTOM);
209 else if(effect=="COME_RIGHT_TOP")
210 obj->setEffect(EF_COME_RIGHT_TOP);
211 else if(effect=="COME_RIGHT_BOTTOM")
212 obj->setEffect(EF_COME_RIGHT_BOTTOM);
213 else if(effect=="COME_LEFT_TOP")
214 obj->setEffect(EF_COME_LEFT_TOP);
215 else if(effect=="COME_LEFT_BOTTOM")
216 obj->setEffect(EF_COME_LEFT_BOTTOM);
217 else if(effect=="WIPE_LEFT")
218 obj->setEffect(EF_WIPE_LEFT);
219 else if(effect=="WIPE_RIGHT")
220 obj->setEffect(EF_WIPE_RIGHT);
221 else if(effect=="WIPE_TOP")
222 obj->setEffect(EF_WIPE_TOP);
223 else if(effect=="WIPE_BOTTOM")
224 obj->setEffect(EF_WIPE_BOTTOM);
225 else
226 kdDebug(33001)<<"Error : setEffect()\n";
227}
228
229void KPrObjectIface::setEffect3(const TQString & effect)
230{
231 if(effect=="NONE")
232 obj->setEffect3(EF3_NONE);
233 else if(effect=="GO_RIGHT")
234 obj->setEffect3(EF3_GO_RIGHT);
235 else if(effect=="GO_LEFT")
236 obj->setEffect3(EF3_GO_LEFT);
237 else if(effect=="GO_TOP")
238 obj->setEffect3(EF3_GO_TOP);
239 else if(effect=="GO_BOTTOM")
240 obj->setEffect3(EF3_GO_BOTTOM);
241 else if(effect=="GO_RIGHT_TOP")
242 obj->setEffect3(EF3_GO_RIGHT_TOP);
243 else if(effect=="GO_RIGHT_BOTTOM")
244 obj->setEffect3(EF3_GO_RIGHT_BOTTOM);
245 else if(effect=="GO_LEFT_TOP")
246 obj->setEffect3(EF3_GO_LEFT_TOP);
247 else if(effect=="GO_LEFT_BOTTOM")
248 obj->setEffect3(EF3_GO_LEFT_BOTTOM);
249 else if(effect=="WIPE_LEFT")
250 obj->setEffect3(EF3_WIPE_LEFT);
251 else if(effect=="WIPE_RIGHT")
252 obj->setEffect3(EF3_WIPE_RIGHT);
253 else if(effect=="WIPE_TOP")
254 obj->setEffect3(EF3_WIPE_TOP);
255 else if(effect=="WIPE_BOTTOM")
256 obj->setEffect3(EF3_WIPE_BOTTOM);
257}
258
259void KPrObjectIface::setProtected( bool b )
260{
261 obj->setProtect(b);
262}
263
264bool KPrObjectIface::isProtected() const
265{
266 return obj->isProtect();
267}
268
269void KPrObjectIface::setKeepRatio( bool b )
270{
271 obj->setKeepRatio(b);
272}
273
274bool KPrObjectIface::isKeepRatio() const
275{
276 return obj->isKeepRatio();
277}
278
279void KPrObjectIface::move( double x, double y )
280{
281 obj->setOrig( x, y );
282}
283
284void KPrObjectIface::resize( double width, double height )
285{
286 obj->setSize( width, height );
287}