Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSDir_p.h 00003 ------------------- 00004 begin : 20/11/2011 00005 copyright : (C) 2003-2011 by InfoSiAL S.L. 00006 email : mail@infosial.com 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; version 2 of the License. * 00012 ***************************************************************************/ 00013 /*************************************************************************** 00014 Este programa es software libre. Puede redistribuirlo y/o modificarlo 00015 bajo los términos de la Licencia Pública General de GNU en su 00016 versión 2, publicada por la Free Software Foundation. 00017 ***************************************************************************/ 00018 00019 #ifndef AQSDIR_P_H_ 00020 #define AQSDIR_P_H_ 00021 00022 #include "AQSVoidPtr_p.h" 00023 #include <qdir.h> 00024 00025 // @AQ_PTR_INDIRECTION@ 00026 00027 class AQSDir : public AQSVoidPtr 00028 { 00029 Q_OBJECT 00030 00031 AQ_DECLARE_AQS_VOID(Dir, VoidPtr); 00032 00033 protected: 00034 void specializedInternalFinish() { 00035 if (!wrap_) 00036 delete o_; 00037 } 00038 00039 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00040 public slots: 00041 virtual void setPath(const QString &); 00042 virtual QString path() const; 00043 virtual QString absPath() const; 00044 virtual QString canonicalPath() const; 00045 virtual QString dirName() const; 00046 virtual QString filePath(const QString &, bool = TRUE) const; 00047 virtual QString absFilePath(const QString &, bool = TRUE) const; 00048 virtual bool cd(const QString &, bool = TRUE); 00049 virtual bool cdUp(); 00050 QString nameFilter() const; 00051 virtual void setNameFilter(const QString &); 00052 uint filter() const; 00053 virtual void setFilter(int); 00054 uint sorting() const; 00055 virtual void setSorting(int); 00056 bool matchAllDirs() const; 00057 virtual void setMatchAllDirs(bool); 00058 uint count() const; 00059 virtual QStringList entryList(int = QDir::DefaultFilter, int = QDir::DefaultSort) const; 00060 virtual QStringList entryList(const QString &, int = QDir::DefaultFilter, int = QDir::DefaultSort) const; 00061 virtual bool mkdir(const QString &, bool = TRUE) const; 00062 virtual bool rmdir(const QString &, bool = TRUE) const; 00063 virtual bool mkpath(const QString &) const; 00064 virtual bool rmpath(const QString &) const; 00065 virtual bool isReadable() const; 00066 virtual bool exists() const; 00067 virtual bool isRoot() const; 00068 virtual bool isRelative() const; 00069 virtual void convertToAbs(); 00070 virtual bool remove(const QString &, bool = TRUE); 00071 virtual bool rename(const QString &, const QString &, bool = TRUE); 00072 virtual bool exists(const QString &, bool = TRUE); 00073 void refresh() const; 00074 00075 protected: 00076 static void *construct(const QSArgumentList &args) { 00077 QMap<int, QStringList> candidates; 00078 candidates[0].append(QString::null); 00079 candidates[1].append(QString::fromLatin1("QString")); 00080 candidates[2].append(QString::fromLatin1("QString,QString")); 00081 candidates[1].append(QString::fromLatin1("QDir*")); 00082 QString sgt(castArgsSignature(args, candidates)); 00083 if (sgt.isEmpty()) 00084 return new QDir; 00085 if (sgt == QString::fromLatin1("QString")) 00086 return new QDir(*(argValue<QString *>(args[0]))); 00087 if (sgt == QString::fromLatin1("QString,QString")) 00088 return new QDir(*(argValue<QString *>(args[0])), 00089 *(argValue<QString *>(args[1]))); 00090 if (sgt == QString::fromLatin1("QDir*")) 00091 return new QDir(*argValue<QDir *>(args[0])); 00092 return 0; 00093 } 00094 00095 public: 00096 static QMap<int, QStringList> candidateConstructors() { 00097 QMap<int, QStringList> candidates; 00098 candidates[0].append(QString::null); 00099 candidates[1].append(QString::fromLatin1("QString")); 00100 candidates[2].append(QString::fromLatin1("QString,QString")); 00101 candidates[1].append(QString::fromLatin1("QDir*")); 00102 return candidates; 00103 } 00104 //@AQ_END_DEF_PUB_SLOTS@ 00105 }; 00106 00107 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00108 inline void AQSDir::setPath(const QString &arg0) 00109 { 00110 AQ_CALL_VOID(setPath(arg0)); 00111 } 00112 inline QString AQSDir::path() const 00113 { 00114 AQ_CALL_RET_V(path(), QString); 00115 } 00116 inline QString AQSDir::absPath() const 00117 { 00118 AQ_CALL_RET_V(absPath(), QString); 00119 } 00120 inline QString AQSDir::canonicalPath() const 00121 { 00122 AQ_CALL_RET_V(canonicalPath(), QString); 00123 } 00124 inline QString AQSDir::dirName() const 00125 { 00126 AQ_CALL_RET_V(dirName(), QString); 00127 } 00128 inline QString AQSDir::filePath(const QString &arg0, bool arg1) const 00129 { 00130 AQ_CALL_RET_V(filePath(arg0, arg1), QString); 00131 } 00132 inline QString AQSDir::absFilePath(const QString &arg0, bool arg1) const 00133 { 00134 AQ_CALL_RET_V(absFilePath(arg0, arg1), QString); 00135 } 00136 inline bool AQSDir::cd(const QString &arg0, bool arg1) 00137 { 00138 AQ_CALL_RET_V(cd(arg0, arg1), bool); 00139 } 00140 inline bool AQSDir::cdUp() 00141 { 00142 AQ_CALL_RET_V(cdUp(), bool); 00143 } 00144 inline QString AQSDir::nameFilter() const 00145 { 00146 AQ_CALL_RET_V(nameFilter(), QString); 00147 } 00148 inline void AQSDir::setNameFilter(const QString &arg0) 00149 { 00150 AQ_CALL_VOID(setNameFilter(arg0)); 00151 } 00152 inline uint AQSDir::filter() const 00153 { 00154 AQ_CALL_RET_V(filter(), uint); 00155 } 00156 inline void AQSDir::setFilter(int arg0) 00157 { 00158 AQ_CALL_VOID(setFilter(arg0)); 00159 } 00160 inline uint AQSDir::sorting() const 00161 { 00162 AQ_CALL_RET_V(sorting(), uint); 00163 } 00164 inline void AQSDir::setSorting(int arg0) 00165 { 00166 AQ_CALL_VOID(setSorting(arg0)); 00167 } 00168 inline bool AQSDir::matchAllDirs() const 00169 { 00170 AQ_CALL_RET_V(matchAllDirs(), bool); 00171 } 00172 inline void AQSDir::setMatchAllDirs(bool arg0) 00173 { 00174 AQ_CALL_VOID(setMatchAllDirs(arg0)); 00175 } 00176 inline uint AQSDir::count() const 00177 { 00178 AQ_CALL_RET_V(count(), uint); 00179 } 00180 inline QStringList AQSDir::entryList(int arg0, int arg1) const 00181 { 00182 AQ_CALL_RET_V(entryList(arg0, arg1), QStringList); 00183 } 00184 inline QStringList AQSDir::entryList(const QString &arg0, int arg1, int arg2) const 00185 { 00186 AQ_CALL_RET_V(entryList(arg0, arg1, arg2), QStringList); 00187 } 00188 inline bool AQSDir::mkdir(const QString &arg0, bool arg1) const 00189 { 00190 AQ_CALL_RET_V(mkdir(arg0, arg1), bool); 00191 } 00192 inline bool AQSDir::rmdir(const QString &arg0, bool arg1) const 00193 { 00194 AQ_CALL_RET_V(rmdir(arg0, arg1), bool); 00195 } 00196 inline bool AQSDir::mkpath(const QString &arg0) const 00197 { 00198 AQ_CALL_RET_V(mkpath(arg0), bool); 00199 } 00200 inline bool AQSDir::rmpath(const QString &arg0) const 00201 { 00202 AQ_CALL_RET_V(rmpath(arg0), bool); 00203 } 00204 inline bool AQSDir::isReadable() const 00205 { 00206 AQ_CALL_RET_V(isReadable(), bool); 00207 } 00208 inline bool AQSDir::exists() const 00209 { 00210 AQ_CALL_RET_V(exists(), bool); 00211 } 00212 inline bool AQSDir::isRoot() const 00213 { 00214 AQ_CALL_RET_V(isRoot(), bool); 00215 } 00216 inline bool AQSDir::isRelative() const 00217 { 00218 AQ_CALL_RET_V(isRelative(), bool); 00219 } 00220 inline void AQSDir::convertToAbs() 00221 { 00222 AQ_CALL_VOID(convertToAbs()); 00223 } 00224 inline bool AQSDir::remove(const QString &arg0, bool arg1) 00225 { 00226 AQ_CALL_RET_V(remove(arg0, arg1), bool); 00227 } 00228 inline bool AQSDir::rename(const QString &arg0, const QString &arg1, bool arg2) 00229 { 00230 AQ_CALL_RET_V(rename(arg0, arg1, arg2), bool); 00231 } 00232 inline bool AQSDir::exists(const QString &arg0, bool arg1) 00233 { 00234 AQ_CALL_RET_V(exists(arg0, arg1), bool); 00235 } 00236 inline void AQSDir::refresh() const 00237 { 00238 AQ_CALL_VOID(refresh()); 00239 } 00240 //@AQ_END_IMP_PUB_SLOTS@ 00241 00242 #endif /* AQSDIR_P_H_ */ 00243 // @AQSVOIDPTR@