kpresenter

KPrObject2DIface.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 "KPrObject2DIface.h"
21#include "KPrObjectIface.h"
22
23#include "KPrObject.h"
24#include <kdebug.h>
25#include <tdeapplication.h>
26#include <dcopclient.h>
27
28KPrObject2DIface::KPrObject2DIface(KPr2DObject *obj_)
29 : KPrObjectIface(obj_)
30{
31 obj = obj_;
32}
33
34TQColor KPrObject2DIface::gradientColor1() const
35{
36 return obj->getGColor1();
37}
38
39TQColor KPrObject2DIface::gradientColor2() const
40{
41 return obj->getGColor2();
42}
43
44void KPrObject2DIface::setGUnbalanced( bool b )
45{
46 obj->setGUnbalanced(b);
47}
48
49void KPrObject2DIface::setGXFactor( int f )
50{
51 obj->setGXFactor(f);
52}
53
54void KPrObject2DIface::setGYFactor( int f )
55{
56 obj->setGYFactor(f);
57}
58
59int KPrObject2DIface::xGradientFactor() const
60{
61 return obj->getGXFactor();
62}
63
64int KPrObject2DIface::yGradientFactor() const
65{
66 return obj->getGYFactor();
67}
68
69TQString KPrObject2DIface::gradientFillType() const
70{
71 switch(obj->getFillType())
72 {
73 case FT_BRUSH:
74 return TQString("BRUSH");
75 case FT_GRADIENT:
76 return TQString("GRADIENT");
77 }
78 return TQString();
79}
80
81void KPrObject2DIface::setGradientType( const TQString & type)
82{
83 if(type=="PLAIN")
84 obj->setGType(BCT_PLAIN);
85 else if(type=="GHORZ")
86 obj->setGType(BCT_GHORZ);
87 else if(type=="GVERT")
88 obj->setGType(BCT_GVERT);
89 else if(type=="GDIAGONAL1")
90 obj->setGType(BCT_GDIAGONAL1);
91 else if(type=="GDIAGONAL2")
92 obj->setGType(BCT_GDIAGONAL2);
93 else if(type=="GCIRCLE")
94 obj->setGType(BCT_GCIRCLE);
95 else if(type=="GRECT")
96 obj->setGType(BCT_GRECT);
97 else if(type=="GPIPECROSS")
98 obj->setGType(BCT_GPIPECROSS);
99 else if(type=="GPYRAMID")
100 obj->setGType(BCT_GPYRAMID);
101 else
102 kdDebug(33001)<<"Error KPrObject2DIface::setGradientType\n";
103}
104
105void KPrObject2DIface::setFillType( const TQString & type)
106{
107 if(type=="BRUSH")
108 obj->setFillType(FT_BRUSH);
109 else if(type=="GRADIENT")
110 obj->setFillType(FT_GRADIENT);
111 else
112 kdDebug(33001)<<"Error KPrObject2DIface::setFillType\n";
113}
114
115void KPrObject2DIface::setGradientColor1( const TQColor &col )
116{
117 obj->setGColor1( col );
118}
119
120void KPrObject2DIface::setGradientColor2( const TQColor &col )
121{
122 obj->setGColor2( col );
123}