kivio
KIvioPageIface.cc
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "KIvioPageIface.h" 00021 00022 #include "kivio_page.h" 00023 #include "kivio_layer.h" 00024 #include <kapplication.h> 00025 #include <dcopclient.h> 00026 00027 KIvioPageIface::KIvioPageIface( KivioPage *page_ ) 00028 : DCOPObject( page_) 00029 { 00030 m_page = page_; 00031 } 00032 00033 bool KIvioPageIface::isHidden()const 00034 { 00035 return m_page->isHidden(); 00036 } 00037 00038 void KIvioPageIface::deleteSelectedStencils() 00039 { 00040 m_page->deleteSelectedStencils(); 00041 } 00042 00043 void KIvioPageIface::groupSelectedStencils() 00044 { 00045 m_page->groupSelectedStencils(); 00046 } 00047 00048 void KIvioPageIface::ungroupSelectedStencils() 00049 { 00050 m_page->ungroupSelectedStencils(); 00051 } 00052 00053 00054 QString KIvioPageIface::pageName()const 00055 { 00056 return m_page->pageName(); 00057 } 00058 00059 void KIvioPageIface::copy() 00060 { 00061 m_page->copy(); 00062 } 00063 00064 void KIvioPageIface::cut() 00065 { 00066 m_page->cut(); 00067 } 00068 00069 void KIvioPageIface::paste() 00070 { 00071 // m_page->paste(); 00072 } 00073 00074 void KIvioPageIface::selectAllStencils() 00075 { 00076 m_page->selectAllStencils(); 00077 } 00078 00079 void KIvioPageIface::unselectAllStencils() 00080 { 00081 m_page->unselectAllStencils(); 00082 } 00083 00084 00085 int KIvioPageIface::nbLayer() const 00086 { 00087 return (int)(m_page->layers())->count(); 00088 } 00089 00090 DCOPRef KIvioPageIface::firstLayer() 00091 { 00092 if ( m_page->firstLayer()) 00093 return DCOPRef( kapp->dcopClient()->appId(), 00094 m_page->firstLayer()->dcopObject()->objId() ); 00095 else 00096 return DCOPRef(); 00097 } 00098 00099 DCOPRef KIvioPageIface::layerAt( int pos) 00100 { 00101 if ( pos >= nbLayer() ) 00102 return DCOPRef(); 00103 return DCOPRef( kapp->dcopClient()->appId(), 00104 m_page->layerAt(pos)->dcopObject()->objId() ); 00105 } 00106 00107 void KIvioPageIface::setHidePage(bool _hide) 00108 { 00109 m_page->setHidePage(_hide); 00110 }