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
00027
00028 KateAppDCOPIface::KateAppDCOPIface (KateApp *app) : DCOPObject ("KateApplication")
00029 , m_app (app)
00030 {
00031 }
00032
00033 DCOPRef KateAppDCOPIface::documentManager ()
00034 {
00035 return DCOPRef (m_app->documentManager()->dcopObject ());
00036 }
00037
00038 DCOPRef KateAppDCOPIface::activeMainWindow ()
00039 {
00040 KateMainWindow *win = m_app->activeMainWindow();
00041
00042 if (win)
00043 return DCOPRef (win->dcopObject ());
00044
00045 return DCOPRef ();
00046 }
00047
00048 uint KateAppDCOPIface::activeMainWindowNumber ()
00049 {
00050 KateMainWindow *win = m_app->activeMainWindow();
00051
00052 if (win)
00053 return win->mainWindowNumber ();
00054
00055 return 0;
00056 }
00057
00058
00059 uint KateAppDCOPIface::mainWindows ()
00060 {
00061 return m_app->mainWindows ();
00062 }
00063
00064 DCOPRef KateAppDCOPIface::mainWindow (uint n)
00065 {
00066 KateMainWindow *win = m_app->mainWindow(n);
00067
00068 if (win)
00069 return DCOPRef (win->dcopObject ());
00070
00071 return DCOPRef ();
00072 }
00073
00074 bool KateAppDCOPIface::openURL (KURL url, TQString encoding)
00075 {
00076 return m_app->openURL (url, encoding, false);
00077 }
00078
00079 bool KateAppDCOPIface::openURL (KURL url, TQString encoding, bool isTempFile)
00080 {
00081 return m_app->openURL (url, encoding, isTempFile);
00082 }
00083
00084 bool KateAppDCOPIface::setCursor (int line, int column)
00085 {
00086 return m_app->setCursor (line, column);
00087 }
00088
00089 bool KateAppDCOPIface::openInput (TQString text)
00090 {
00091 return m_app->openInput (text);
00092 }
00093
00094 bool KateAppDCOPIface::activateSession(TQString session)
00095 {
00096 m_app->sessionManager()->activateSession(m_app->sessionManager()->getSessionIdFromName(session));
00097 return true;
00098 }
00099
00100 const TQString& KateAppDCOPIface::session() const
00101 {
00102 return m_app->sessionManager()->getActiveSessionName();
00103 }
00104
00105