00001 #ifndef _Q_IBUS_OBSERVED_PATH_H_ 00002 #define _Q_IBUS_OBSERVED_PATH_H_ 00003 00004 #include <QDir> 00005 #include <QDebug> 00006 #include <QDateTime> 00007 #include <QXmlStreamWriter> 00008 #include <QtXml/QDomNode> 00009 #include "qibusserializable.h" 00010 00011 namespace IBus { 00012 00013 class ObservedPath; 00014 typedef Pointer<ObservedPath> ObservedPathPointer; 00015 00016 class ObservedPath : public Serializable 00017 { 00018 Q_OBJECT; 00019 00020 public: 00021 ObservedPath () {} 00022 ObservedPath (QString path): m_path(path) {} 00023 00024 ~ObservedPath () {} 00025 00026 public: 00027 virtual bool serialize (QDBusArgument &argument); 00028 virtual bool deserialize (const QDBusArgument &argument); 00029 00030 public: 00031 bool parseXmlNode (const QDomNode & node); 00032 const QString & path() const { return m_path; } 00033 int mtime() const { return m_mtime; } 00034 00035 #if 0 00036 bool isObservedPathModified () const; 00037 void setObservedPathStat (); 00038 void traverseObservedPath (QVector<ObservedPathPointer> & observedPathVec) const; 00039 00040 00041 bool isRegularFile() const 00042 { 00043 QFileInfo fi(m_path); 00044 return fi.isFile(); 00045 } 00046 00047 bool isDirFile() const 00048 { 00049 QFileInfo fi(m_path); 00050 return fi.isDir(); 00051 } 00052 #endif 00053 00054 private: 00055 QString m_path; 00056 uint m_mtime; 00057 bool m_isDir; 00058 bool m_isExist; 00059 00060 IBUS_SERIALIZABLE 00061 }; 00062 00063 }; 00064 00065 #endif