[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klfdbus.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klfdbus.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klfdbus.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFDBUS_H
25 #define KLFDBUS_H
26 
27 #if defined(KLF_USE_DBUS)
28 
29 #include <QDBusConnection>
30 #include <QDBusAbstractAdaptor>
31 #include <QDBusAbstractInterface>
32 #include <QDBusReply>
33 #include <QApplication>
34 
35 #include <klfdefs.h>
36 
37 class KLFMainWin;
38 
39 
40 class KLF_EXPORT KLFDBusAppAdaptor : public QDBusAbstractAdaptor
41 {
42  Q_OBJECT
43  Q_CLASSINFO("D-Bus Interface", "org.klatexformula.KLatexFormula")
44 
45 private:
46  QApplication *app;
47  KLFMainWin *_mainwin;
48 
49 public:
50  KLFDBusAppAdaptor(QApplication *application, KLFMainWin *mainWin);
51  virtual ~KLFDBusAppAdaptor();
52 
53 public slots:
54  Q_NOREPLY void quit();
55 
56  void raiseWindow();
57 
58  void setInputData(const QString& key, const QString& svalue, int ivalue);
59  void setAlterSetting_i(int setting, int value);
60  void setAlterSetting_s(int setting, const QString& value);
61  void evaluateAndSave(const QString& output, const QString& fmt);
62 
63  void openFile(const QString& fileName);
64  void openFiles(const QStringList& fileNameList);
65  void openData(const QByteArray& data);
66 
67  void importCmdlKLFFiles(const QStringList& fnames);
68 };
69 
70 
72 {
73  Q_OBJECT
74 public:
75  static inline const char *staticInterfaceName()
76  {
77  return "org.klatexformula.KLatexFormula";
78  }
79 
80 public:
81  KLFDBusAppInterface(const QString &service, const QString &path, const QDBusConnection &connection,
82  QObject *parent = 0);
84 
85 public slots: // METHODS
86 
87  QDBusReply<void> quit();
88  QDBusReply<void> raiseWindow();
89  QDBusReply<void> setInputData(const QString& key, const QString& svalue, int ivalue = -1);
90  QDBusReply<void> setAlterSetting_i(int setting, int value);
91  QDBusReply<void> setAlterSetting_s(int setting, const QString& value);
92  QDBusReply<void> evaluateAndSave(const QString& output, const QString& fmt);
93  QDBusReply<void> openFile(const QString& fileName);
94  QDBusReply<void> openFiles(const QStringList& fileNameList);
95  QDBusReply<void> openData(const QByteArray& data);
96  QDBusReply<void> importCmdlKLFFiles(const QStringList& fnames);
97 
98 };
99 
100 
101 #endif
102 
103 #endif
static const char * staticInterfaceName()
Definition: klfdbus.h:75

Generated by doxygen 1.8.8