kpresenter

KPrObject2DIface.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include "KPrObject2DIface.h"
00022 #include "KPrObjectIface.h"
00023 
00024 #include "KPrObject.h"
00025 #include <kdebug.h>
00026 #include <kapplication.h>
00027 #include <dcopclient.h>
00028 
00029 KPrObject2DIface::KPrObject2DIface(KPr2DObject *obj_)
00030     : KPrObjectIface(obj_)
00031 {
00032     obj = obj_;
00033 }
00034 
00035 QColor KPrObject2DIface::gradientColor1() const
00036 {
00037     return obj->getGColor1();
00038 }
00039 
00040 QColor KPrObject2DIface::gradientColor2() const
00041 {
00042     return obj->getGColor2();
00043 }
00044 
00045 void KPrObject2DIface::setGUnbalanced( bool b )
00046 {
00047     obj->setGUnbalanced(b);
00048 }
00049 
00050 void KPrObject2DIface::setGXFactor( int f )
00051 {
00052     obj->setGXFactor(f);
00053 }
00054 
00055 void KPrObject2DIface::setGYFactor( int f )
00056 {
00057     obj->setGYFactor(f);
00058 }
00059 
00060 int KPrObject2DIface::xGradientFactor() const
00061 {
00062     return obj->getGXFactor();
00063 }
00064 
00065 int KPrObject2DIface::yGradientFactor() const
00066 {
00067     return obj->getGYFactor();
00068 }
00069 
00070 QString KPrObject2DIface::gradientFillType() const
00071 {
00072     switch(obj->getFillType())
00073     {
00074     case FT_BRUSH:
00075         return QString("BRUSH");
00076     case FT_GRADIENT:
00077         return QString("GRADIENT");
00078     }
00079     return QString::null;
00080 }
00081 
00082 void KPrObject2DIface::setGradientType( const QString & type)
00083 {
00084     if(type=="PLAIN")
00085         obj->setGType(BCT_PLAIN);
00086     else if(type=="GHORZ")
00087         obj->setGType(BCT_GHORZ);
00088     else if(type=="GVERT")
00089         obj->setGType(BCT_GVERT);
00090     else if(type=="GDIAGONAL1")
00091         obj->setGType(BCT_GDIAGONAL1);
00092     else if(type=="GDIAGONAL2")
00093         obj->setGType(BCT_GDIAGONAL2);
00094     else if(type=="GCIRCLE")
00095         obj->setGType(BCT_GCIRCLE);
00096     else if(type=="GRECT")
00097         obj->setGType(BCT_GRECT);
00098     else if(type=="GPIPECROSS")
00099         obj->setGType(BCT_GPIPECROSS);
00100     else if(type=="GPYRAMID")
00101         obj->setGType(BCT_GPYRAMID);
00102     else
00103         kdDebug(33001)<<"Error KPrObject2DIface::setGradientType\n";
00104 }
00105 
00106 void KPrObject2DIface::setFillType( const QString & type)
00107 {
00108     if(type=="BRUSH")
00109         obj->setFillType(FT_BRUSH);
00110     else if(type=="GRADIENT")
00111         obj->setFillType(FT_GRADIENT);
00112     else
00113         kdDebug(33001)<<"Error KPrObject2DIface::setFillType\n";
00114 }
00115 
00116 void KPrObject2DIface::setGradientColor1( const QColor &col )
00117 {
00118     obj->setGColor1( col );
00119 }
00120 
00121 void KPrObject2DIface::setGradientColor2( const QColor &col )
00122 {
00123     obj->setGColor2( col );
00124 }
KDE Home | KDE Accessibility Home | Description of Access Keys