~ubuntu-branches/ubuntu/edgy/koffice/edgy-updates

« back to all changes in this revision

Viewing changes to kpresenter/KPresenterObject2DIface.cc

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040509113300-xi5t1z4yxe7n03x7
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
 
2
/* This file is part of the KDE project
 
3
   Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
 
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., 59 Temple Place - Suite 330,
 
18
   Boston, MA 02111-1307, USA.
 
19
*/
 
20
 
 
21
#include "KPresenterObject2DIface.h"
 
22
#include "KPresenterObjectIface.h"
 
23
 
 
24
#include "kpobject.h"
 
25
#include <kdebug.h>
 
26
#include <kapplication.h>
 
27
#include <dcopclient.h>
 
28
 
 
29
KPresenterObject2DIface::KPresenterObject2DIface(KP2DObject *obj_)
 
30
    : KPresenterObjectIface(obj_)
 
31
{
 
32
    obj = obj_;
 
33
}
 
34
 
 
35
QColor KPresenterObject2DIface::gradientColor1() const
 
36
{
 
37
    return obj->getGColor1();
 
38
}
 
39
 
 
40
QColor KPresenterObject2DIface::gradientColor2() const
 
41
{
 
42
    return obj->getGColor2();
 
43
}
 
44
 
 
45
void KPresenterObject2DIface::setGUnbalanced( bool b )
 
46
{
 
47
    obj->setGUnbalanced(b);
 
48
}
 
49
 
 
50
void KPresenterObject2DIface::setGXFactor( int f )
 
51
{
 
52
    obj->setGXFactor(f);
 
53
}
 
54
 
 
55
void KPresenterObject2DIface::setGYFactor( int f )
 
56
{
 
57
    obj->setGYFactor(f);
 
58
}
 
59
 
 
60
int KPresenterObject2DIface::xGradientFactor() const
 
61
{
 
62
    return obj->getGXFactor();
 
63
}
 
64
 
 
65
int KPresenterObject2DIface::yGradientFactor() const
 
66
{
 
67
    return obj->getGYFactor();
 
68
}
 
69
 
 
70
QString KPresenterObject2DIface::gradientFillType() const
 
71
{
 
72
    switch(obj->getFillType())
 
73
    {
 
74
    case FT_BRUSH:
 
75
        return QString("BRUSH");
 
76
    case FT_GRADIENT:
 
77
        return QString("GRADIENT");
 
78
    }
 
79
    return QString::null;
 
80
}
 
81
 
 
82
void KPresenterObject2DIface::setGradientType( const QString & type)
 
83
{
 
84
    if(type=="PLAIN")
 
85
        obj->setGType(BCT_PLAIN);
 
86
    else if(type=="GHORZ")
 
87
        obj->setGType(BCT_GHORZ);
 
88
    else if(type=="GVERT")
 
89
        obj->setGType(BCT_GVERT);
 
90
    else if(type=="GDIAGONAL1")
 
91
        obj->setGType(BCT_GDIAGONAL1);
 
92
    else if(type=="GDIAGONAL2")
 
93
        obj->setGType(BCT_GDIAGONAL2);
 
94
    else if(type=="GCIRCLE")
 
95
        obj->setGType(BCT_GCIRCLE);
 
96
    else if(type=="GRECT")
 
97
        obj->setGType(BCT_GRECT);
 
98
    else if(type=="GPIPECROSS")
 
99
        obj->setGType(BCT_GPIPECROSS);
 
100
    else if(type=="GPYRAMID")
 
101
        obj->setGType(BCT_GPYRAMID);
 
102
    else
 
103
        kdDebug(33001)<<"Error KPresenterObject2DIface::setGradientType\n";
 
104
}
 
105
 
 
106
void KPresenterObject2DIface::setFillType( const QString & type)
 
107
{
 
108
    if(type=="BRUSH")
 
109
        obj->setFillType(FT_BRUSH);
 
110
    else if(type=="GRADIENT")
 
111
        obj->setFillType(FT_GRADIENT);
 
112
    else
 
113
        kdDebug(33001)<<"Error KPresenterObject2DIface::setFillType\n";
 
114
}
 
115
 
 
116
void KPresenterObject2DIface::setGradientColor1( const QColor &col )
 
117
{
 
118
    obj->setGColor1( col );
 
119
}
 
120
 
 
121
void KPresenterObject2DIface::setGradientColor2( const QColor &col )
 
122
{
 
123
    obj->setGColor2( col );
 
124
}