00001 /*************************************************************************** 00002 * Copyright (C) 2005 by David Saxton * 00003 * david@bluehaze.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #include "docmanager.h" 00012 #include "docmanageriface.h" 00013 #include "document.h" 00014 00015 00016 DocManagerIface::DocManagerIface( DocManager * docManager ) 00017 : DCOPObject("DocumentManager") 00018 { 00019 m_pDocManager = docManager; 00020 } 00021 00022 00023 DocManagerIface::~DocManagerIface() 00024 { 00025 } 00026 00027 bool DocManagerIface::closeAll( ) 00028 { 00029 return m_pDocManager->closeAll(); 00030 } 00031 00032 DCOPRef DocManagerIface::openURL( const QString & url ) 00033 { 00034 return docToRef( m_pDocManager->openURL(url) ); 00035 } 00036 00037 void DocManagerIface::gotoTextLine( const QString & url, int line ) 00038 { 00039 m_pDocManager->gotoTextLine( url, line ); 00040 } 00041 00042 DCOPRef DocManagerIface::createTextDocument( ) 00043 { 00044 return docToRef( (Document*)m_pDocManager->createTextDocument() ); 00045 } 00046 00047 DCOPRef DocManagerIface::createCircuitDocument( ) 00048 { 00049 return docToRef( (Document*)m_pDocManager->createCircuitDocument() ); 00050 } 00051 00052 DCOPRef DocManagerIface::createFlowCodeDocument( ) 00053 { 00054 return docToRef( (Document*)m_pDocManager->createFlowCodeDocument() ); 00055 } 00056 00057 DCOPRef DocManagerIface::createMechanicsDocument( ) 00058 { 00059 return docToRef( (Document*)m_pDocManager->createMechanicsDocument() ); 00060 } 00061 00062 DCOPRef DocManagerIface::docToRef( Document * document ) 00063 { 00064 if (document) 00065 return DCOPRef(document->dcopObject()); 00066 return DCOPRef(); 00067 } 00068 00069
1.5.1