kate
kateappIface.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kateappIface.h"
00020
00021 #include "kateapp.h"
00022 #include "katesession.h"
00023 #include "katedocmanager.h"
00024 #include "katemainwindow.h"
00025
00026 KateAppDCOPIface::KateAppDCOPIface (KateApp *app) : DCOPObject ("KateApplication")
00027 , m_app (app)
00028 {
00029 }
00030
00031 DCOPRef KateAppDCOPIface::documentManager ()
00032 {
00033 return DCOPRef (m_app->documentManager()->dcopObject ());
00034 }
00035
00036 DCOPRef KateAppDCOPIface::activeMainWindow ()
00037 {
00038 KateMainWindow *win = m_app->activeMainWindow();
00039
00040 if (win)
00041 return DCOPRef (win->dcopObject ());
00042
00043 return DCOPRef ();
00044 }
00045
00046 uint KateAppDCOPIface::activeMainWindowNumber ()
00047 {
00048 KateMainWindow *win = m_app->activeMainWindow();
00049
00050 if (win)
00051 return win->mainWindowNumber ();
00052
00053 return 0;
00054 }
00055
00056
00057 uint KateAppDCOPIface::mainWindows ()
00058 {
00059 return m_app->mainWindows ();
00060 }
00061
00062 DCOPRef KateAppDCOPIface::mainWindow (uint n)
00063 {
00064 KateMainWindow *win = m_app->mainWindow(n);
00065
00066 if (win)
00067 return DCOPRef (win->dcopObject ());
00068
00069 return DCOPRef ();
00070 }
00071
00072 bool KateAppDCOPIface::openURL (KURL url, QString encoding)
00073 {
00074 return m_app->openURL (url, encoding, false);
00075 }
00076
00077 bool KateAppDCOPIface::openURL (KURL url, QString encoding, bool isTempFile)
00078 {
00079 return m_app->openURL (url, encoding, isTempFile);
00080 }
00081
00082 bool KateAppDCOPIface::setCursor (int line, int column)
00083 {
00084 return m_app->setCursor (line, column);
00085 }
00086
00087 bool KateAppDCOPIface::openInput (QString text)
00088 {
00089 return m_app->openInput (text);
00090 }
00091
00092 bool KateAppDCOPIface::activateSession (QString session)
00093 {
00094 m_app->sessionManager()->activateSession (m_app->sessionManager()->giveSession (session));
00095
00096 return true;
00097 }
00098
00099 const QString & KateAppDCOPIface::session() const
00100 {
00101 return m_app->sessionManager()->activeSession()->sessionName();
00102 }
00103
00104