ibus-qt  1.3.2
 All Classes Namespaces Functions Enumerations Enumerator
qibuscomponent.h
1 #ifndef __Q_IBUS_COMPONENT_H_
2 #define __Q_IBUS_COMPONENT_H_
3 
4 #include <QFile>
5 #include <QDebug>
6 #include <QVector>
7 #include <QProcess>
8 #include <QXmlStreamWriter>
9 #include <QtXml/QDomNode>
10 #include "qibusserializable.h"
11 #include "qibusenginedesc.h"
12 #include "qibusobservedpath.h"
13 
14 namespace IBus {
15 
16 class Component;
17 typedef Pointer<Component> ComponentPointer;
18 
19 class Component : public Serializable
20 {
21  Q_OBJECT;
22 
23 public:
24  Component () {}
25  Component (const QString & name,
26  const QString & desc,
27  const QString & vers,
28  const QString & lics,
29  const QString & auth,
30  const QString & hmpg,
31  const QString & exec,
32  const QString & textdomain):
33  m_name(name),
34  m_description(desc),
35  m_version(vers),
36  m_license(lics),
37  m_author(auth),
38  m_homepage(hmpg),
39  m_exec(exec),
40  m_textdomain(textdomain) {}
41 
42  virtual ~Component () {}
43 
44 public:
45  virtual bool serialize (QDBusArgument &argument);
46  virtual bool deserialize (const QDBusArgument &argument);
47 
48  void output (QString &output) const;
49  bool parseXmlNode (const QDomNode &node);
50  // bool parseEnginesNode (QDomNode &node);
51  // bool parseObservedPaths (const QDomNode &node);
52 
53  void addObservedPath (const ObservedPathPointer &obsPath);
54  void addEngine (const EngineDescPointer &edp);
55 
56  QVector<ObservedPathPointer> observedPaths () const;
57  const QVector<EngineDescPointer> & engines () const;
58 
59 #if 0
60 
61  bool start (bool verbose) const;
62  bool stop () const;
63  bool isRunning () const;
64  bool isComponentModified () const;
65  const ComponentPointer getComponentFromEngine (EngineDescPointer edp) const;
66 
67 
68  friend bool newComponentFromFile (Component &obj, const QString & filename);
69 
70 private:
71  const QDomDocument * parseXmlFile (const QString & filename) const;
72  const QDomDocument * parseXmlBuffer (const QByteArray & buf);
73 
74 #endif
75 
76 private:
77  QString m_name;
78  QString m_description;
79  QString m_version;
80  QString m_license;
81  QString m_author;
82  QString m_homepage;
83  QString m_exec;
84  QString m_textdomain;
85 
86  QVector<ObservedPathPointer> m_observedPaths;
87  QVector<EngineDescPointer> m_engines;
88 
89  IBUS_SERIALIZABLE
90 };
91 
92 };
93 
94 #endif
Definition: qibuscomponent.h:19
Definition: qibusserializable.h:40
Definition: qibuspointer.h:10