katedocmanageriface.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "katedocmanageriface.h"
00020
00021 #include "katedocmanager.h"
00022
00023 #include <kdebug.h>
00024
00025 KateDocManagerDCOPIface::KateDocManagerDCOPIface (KateDocManager *dm) : DCOPObject ("KateDocumentManager"), m_dm (dm)
00026 {
00027
00028 }
00029
00030
00031 DCOPRef KateDocManagerDCOPIface::document (uint n)
00032 {
00033 Kate::Document *doc = m_dm->document(n);
00034
00035 if (!doc)
00036 return DCOPRef ();
00037
00038 DCOPObject *obj = static_cast<DCOPObject*>(doc->qt_cast("DCOPObject"));
00039
00040 if (!obj)
00041 return DCOPRef ();
00042
00043 return DCOPRef (obj);
00044 }
00045
00046 DCOPRef KateDocManagerDCOPIface::activeDocument ()
00047 {
00048 Kate::Document *doc = m_dm->activeDocument();
00049
00050 if (!doc)
00051 return DCOPRef ();
00052
00053 DCOPObject *obj = static_cast<DCOPObject*>(doc->qt_cast("DCOPObject"));
00054
00055 if (!obj)
00056 return DCOPRef ();
00057
00058 return DCOPRef (obj);
00059 }
00060
00061 uint KateDocManagerDCOPIface::activeDocumentNumber ()
00062 {
00063 Kate::Document *doc = m_dm->activeDocument();
00064
00065 if (doc)
00066 return doc->documentNumber ();
00067
00068 return 0;
00069 }
00070
00071 DCOPRef KateDocManagerDCOPIface::documentWithID (uint id)
00072 {
00073 Kate::Document *doc = m_dm->documentWithID (id);
00074
00075 if (!doc)
00076 return DCOPRef ();
00077
00078 DCOPObject *obj = static_cast<DCOPObject*>(doc->qt_cast("DCOPObject"));
00079
00080 if (!obj)
00081 return DCOPRef ();
00082
00083 return DCOPRef (obj);
00084 }
00085
00086 DCOPRef KateDocManagerDCOPIface::openURL (KURL url, QString encoding)
00087 {
00088 Kate::Document *doc = m_dm->openURL (url, encoding);
00089
00090 if (!doc)
00091 return DCOPRef ();
00092
00093 DCOPObject *obj = static_cast<DCOPObject*>(doc->qt_cast("DCOPObject"));
00094
00095 if (!obj)
00096 return DCOPRef ();
00097
00098 return DCOPRef (obj);
00099 }
00100
00101 bool KateDocManagerDCOPIface::closeDocument(uint n)
00102 {
00103 return m_dm->closeDocument(n);
00104 }
00105
00106 bool KateDocManagerDCOPIface::closeDocumentWithID(uint id)
00107 {
00108 return m_dm->closeDocumentWithID (id);
00109 }
00110
00111 bool KateDocManagerDCOPIface::closeAllDocuments()
00112 {
00113 return m_dm->closeAllDocuments();
00114 }
00115
00116 bool KateDocManagerDCOPIface::isOpen(KURL url)
00117 {
00118 return m_dm->isOpen (url);
00119 }
00120
00121 uint KateDocManagerDCOPIface::documents ()
00122 {
00123 return m_dm->documents();
00124 }
00125
00126 int KateDocManagerDCOPIface::findDocument (KURL url)
00127 {
00128 return m_dm->findDocument (url);
00129 }
00130
00131
This file is part of the documentation for kate Library Version 3.2.3.