ibus-qt  1.3.3
qibusobservedpath.h
1 #ifndef _Q_IBUS_OBSERVED_PATH_H_
2 #define _Q_IBUS_OBSERVED_PATH_H_
3 
4 #include <QDir>
5 #include <QDebug>
6 #include <QDateTime>
7 #include <QXmlStreamWriter>
8 #include <QtXml/QDomNode>
9 #include "qibusserializable.h"
10 
11 namespace IBus {
12 
13 class ObservedPath;
14 typedef Pointer<ObservedPath> ObservedPathPointer;
15 
16 class ObservedPath : public Serializable
17 {
18  Q_OBJECT;
19 
20 public:
21  ObservedPath () {}
22  ObservedPath (QString path): m_path(path) {}
23 
24  ~ObservedPath () {}
25 
26 public:
27  virtual bool serialize (QDBusArgument &argument);
28  virtual bool deserialize (const QDBusArgument &argument);
29 
30 public:
31  bool parseXmlNode (const QDomNode & node);
32  const QString & path() const { return m_path; }
33  int mtime() const { return m_mtime; }
34 
35 #if 0
36  bool isObservedPathModified () const;
37  void setObservedPathStat ();
38  void traverseObservedPath (QVector<ObservedPathPointer> & observedPathVec) const;
39 
40 
41  bool isRegularFile() const
42  {
43  QFileInfo fi(m_path);
44  return fi.isFile();
45  }
46 
47  bool isDirFile() const
48  {
49  QFileInfo fi(m_path);
50  return fi.isDir();
51  }
52 #endif
53 
54 private:
55  QString m_path;
56  uint m_mtime;
57  bool m_isDir;
58  bool m_isExist;
59 
60  IBUS_SERIALIZABLE
61 };
62 
63 };
64 
65 #endif
Definition: qibusobservedpath.h:16
Definition: qibusattribute.cpp:3
Definition: qibusserializable.h:40