[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project

src/klfdbus.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klfdbus.h
00003  *   This file is part of the KLatexFormula Project.
00004  *   Copyright (C) 2009 by Philippe Faist
00005  *   philippe.faist at bluewin.ch
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /* $Id: klfdbus.h 455 2010-08-22 01:42:51Z philippe $ */
00023 
00024 #ifndef KLFDBUS_H
00025 #define KLFDBUS_H
00026 
00027 #if defined(KLF_USE_DBUS)
00028 
00029 #include <QDBusConnection>
00030 #include <QDBusAbstractAdaptor>
00031 #include <QDBusAbstractInterface>
00032 #include <QDBusReply>
00033 #include <QApplication>
00034 
00035 #include <klfdefs.h>
00036 
00037 class KLFMainWin;
00038 
00039 
00040 class KLF_EXPORT KLFDBusAppAdaptor : public QDBusAbstractAdaptor
00041 {
00042   Q_OBJECT
00043   Q_CLASSINFO("D-Bus Interface", "org.klatexformula.KLatexFormula")
00044 
00045 private:
00046   QApplication *app;
00047   KLFMainWin *_mainwin;
00048 
00049 public:
00050   KLFDBusAppAdaptor(QApplication *application, KLFMainWin *mainWin);
00051   virtual ~KLFDBusAppAdaptor();
00052 
00053 public slots:
00054   Q_NOREPLY void quit();
00055 
00056   void raiseWindow();
00057 
00058   void setInputData(const QString& key, const QString& svalue, int ivalue);
00059   void setAlterSetting_i(int setting, int value);
00060   void setAlterSetting_s(int setting, const QString& value);
00061   void evaluateAndSave(const QString& output, const QString& fmt);
00062 
00063   void openFile(const QString& fileName);
00064   void openFiles(const QStringList& fileNameList);
00065   void openData(const QByteArray& data);
00066 
00067   void importCmdlKLFFiles(const QStringList& fnames);
00068 };
00069 
00070 
00071 class KLF_EXPORT KLFDBusAppInterface: public QDBusAbstractInterface
00072 {
00073   Q_OBJECT
00074 public:
00075   static inline const char *staticInterfaceName()
00076   {
00077     return "org.klatexformula.KLatexFormula";
00078   }
00079   
00080 public:
00081   KLFDBusAppInterface(const QString &service, const QString &path, const QDBusConnection &connection,
00082                       QObject *parent = 0);
00083   ~KLFDBusAppInterface();
00084 
00085 public slots: // METHODS
00086 
00087   QDBusReply<void> quit();
00088   QDBusReply<void> raiseWindow();
00089   QDBusReply<void> setInputData(const QString& key, const QString& svalue, int ivalue = -1);
00090   QDBusReply<void> setAlterSetting_i(int setting, int value);
00091   QDBusReply<void> setAlterSetting_s(int setting, const QString& value);
00092   QDBusReply<void> evaluateAndSave(const QString& output, const QString& fmt);
00093   QDBusReply<void> openFile(const QString& fileName);
00094   QDBusReply<void> openFiles(const QStringList& fileNameList);
00095   QDBusReply<void> openData(const QByteArray& data);
00096   QDBusReply<void> importCmdlKLFFiles(const QStringList& fnames);
00097 
00098 };
00099 
00100 
00101 #endif
00102 
00103 #endif

Generated by doxygen 1.7.3