summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrObject2DIface.cpp
blob: 729d8587c1f1a38321bee9c351d480dfe916118e (plain)
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
123
124
// -*- 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 <lmontel@mandrakesoft.com>

   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 "KPrObject2DIface.h"
#include "KPrObjectIface.h"

#include "KPrObject.h"
#include <kdebug.h>
#include <kapplication.h>
#include <dcopclient.h>

KPrObject2DIface::KPrObject2DIface(KPr2DObject *obj_)
    : KPrObjectIface(obj_)
{
    obj = obj_;
}

TQColor KPrObject2DIface::gradientColor1() const
{
    return obj->getGColor1();
}

TQColor KPrObject2DIface::gradientColor2() const
{
    return obj->getGColor2();
}

void KPrObject2DIface::setGUnbalanced( bool b )
{
    obj->setGUnbalanced(b);
}

void KPrObject2DIface::setGXFactor( int f )
{
    obj->setGXFactor(f);
}

void KPrObject2DIface::setGYFactor( int f )
{
    obj->setGYFactor(f);
}

int KPrObject2DIface::xGradientFactor() const
{
    return obj->getGXFactor();
}

int KPrObject2DIface::yGradientFactor() const
{
    return obj->getGYFactor();
}

TQString KPrObject2DIface::gradientFillType() const
{
    switch(obj->getFillType())
    {
    case FT_BRUSH:
        return TQString("BRUSH");
    case FT_GRADIENT:
        return TQString("GRADIENT");
    }
    return TQString();
}

void KPrObject2DIface::setGradientType( const TQString & type)
{
    if(type=="PLAIN")
        obj->setGType(BCT_PLAIN);
    else if(type=="GHORZ")
        obj->setGType(BCT_GHORZ);
    else if(type=="GVERT")
        obj->setGType(BCT_GVERT);
    else if(type=="GDIAGONAL1")
        obj->setGType(BCT_GDIAGONAL1);
    else if(type=="GDIAGONAL2")
        obj->setGType(BCT_GDIAGONAL2);
    else if(type=="GCIRCLE")
        obj->setGType(BCT_GCIRCLE);
    else if(type=="GRECT")
        obj->setGType(BCT_GRECT);
    else if(type=="GPIPECROSS")
        obj->setGType(BCT_GPIPECROSS);
    else if(type=="GPYRAMID")
        obj->setGType(BCT_GPYRAMID);
    else
        kdDebug(33001)<<"Error KPrObject2DIface::setGradientType\n";
}

void KPrObject2DIface::setFillType( const TQString & type)
{
    if(type=="BRUSH")
        obj->setFillType(FT_BRUSH);
    else if(type=="GRADIENT")
        obj->setFillType(FT_GRADIENT);
    else
        kdDebug(33001)<<"Error KPrObject2DIface::setFillType\n";
}

void KPrObject2DIface::setGradientColor1( const TQColor &col )
{
    obj->setGColor1( col );
}

void KPrObject2DIface::setGradientColor2( const TQColor &col )
{
    obj->setGColor2( col );
}