karbon
karbon_part_iface.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <dcopclient.h>
00022
00023 #include <kapplication.h>
00024
00025 #include "karbon_part.h"
00026 #include "karbon_part_iface.h"
00027 #include "vselection.h"
00028 #include "vlayer.h"
00029
00030
00031 KarbonPartIface::KarbonPartIface( KarbonPart* part )
00032 : KoDocumentIface( part )
00033 {
00034 m_part = part;
00035 }
00036
00037 void KarbonPartIface::selectAllObjects()
00038 {
00039 m_part->document().selection()->append();
00040 }
00041
00042 void KarbonPartIface::deselectAllObjects()
00043 {
00044 m_part->document().selection()->clear();
00045 }
00046
00047 bool KarbonPartIface::showStatusBar () const
00048 {
00049 return m_part->showStatusBar();
00050 }
00051
00052 void KarbonPartIface::setShowStatusBar ( bool b )
00053 {
00054 m_part->setShowStatusBar( b );
00055 m_part->reorganizeGUI();
00056 }
00057
00058 void KarbonPartIface::setUndoRedoLimit( int undo )
00059 {
00060 m_part->setUndoRedoLimit( undo );
00061 }
00062
00063 void KarbonPartIface::initConfig()
00064 {
00065 m_part->initConfig();
00066 }
00067
00068
00069 void KarbonPartIface::clearHistory()
00070 {
00071 m_part->clearHistory();
00072 }
00073
00074
00075 QString KarbonPartIface::unitName() const
00076 {
00077 return m_part->unitName();
00078 }
00079
00080 QString
00081 KarbonPartIface::widthInUnits()
00082 {
00083 QString val = KoUnit::toUserStringValue( m_part->document().width(), m_part->unit() );
00084 return QString( "%1%2" ).arg( val ).arg( m_part->unitName() );
00085 }
00086
00087 QString
00088 KarbonPartIface::heightInUnits()
00089 {
00090 QString val = KoUnit::toUserStringValue( m_part->document().height(), m_part->unit() );
00091 return QString( "%1%2" ).arg( val ).arg( m_part->unitName() );
00092 }
00093
00094 double
00095 KarbonPartIface::width()
00096 {
00097 return m_part->document().width();
00098 }
00099
00100 double
00101 KarbonPartIface::height()
00102 {
00103 return m_part->document().height();
00104 }
00105
00106 int KarbonPartIface::nbLayer() const
00107 {
00108 return m_part->document().layers().count();
00109 }
00110
00111 DCOPRef KarbonPartIface::activeLayer()
00112 {
00113 if( !m_part->document().activeLayer() )
00114 return DCOPRef();
00115
00116 return DCOPRef( kapp->dcopClient()->appId(),
00117 m_part->document().activeLayer()->dcopObject()->objId() );
00118 }
00119
|