Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSHostAddress_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSHostAddress_p.h
00003  -------------------
00004  begin                : 28/04/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 AQSHOSTADDRESS_P_H_
00020 #define AQSHOSTADDRESS_P_H_
00021 
00022 #include "AQSVoidPtr_p.h"
00023 #include <qhostaddress.h>
00024 
00025 // @AQ_PTR_INDIRECTION@
00026 
00027 class AQSHostAddress : public AQSVoidPtr
00028 {
00029   Q_OBJECT
00030 
00031   AQ_DECLARE_AQS_VOID(HostAddress, VoidPtr);
00032 
00033   //@AQ_BEGIN_DEF_PUB_SLOTS@
00034 public slots:
00035   void setAddress(Q_UINT32);
00036   void setAddress(Q_UINT8 *);
00037   bool setAddress(const QString &);
00038   bool isIPv4Address() const;
00039   bool isIPv6Address() const;
00040   QString toString() const;
00041   bool isNull() const;
00042 
00043 protected:
00044   static void *construct(const QSArgumentList &args) {
00045     QMap<int, QStringList> candidates;
00046     candidates[0].append(QString::null);
00047     candidates[1].append(QString::fromLatin1("Q_UINT32"));
00048     candidates[1].append(QString::fromLatin1("Q_UINT8*"));
00049     candidates[1].append(QString::fromLatin1("Q_IPV6ADDR"));
00050     candidates[1].append(QString::fromLatin1("QHostAddress*"));
00051     candidates[0].append(QString::null);
00052     candidates[0].append(QString::null);
00053     QString sgt(castArgsSignature(args, candidates));
00054     if (sgt.isEmpty())
00055       return new QHostAddress;
00056     if (sgt == QString::fromLatin1("Q_UINT32"))
00057       return new QHostAddress(*(argValue<Q_UINT32 *>(args[0])));
00058     if (sgt == QString::fromLatin1("Q_UINT8*"))
00059       return new QHostAddress(argValue<Q_UINT8 *>(args[0]));
00060     if (sgt == QString::fromLatin1("Q_IPV6ADDR"))
00061       return new QHostAddress(*(argValue<Q_IPV6ADDR *>(args[0])));
00062     if (sgt == QString::fromLatin1("QHostAddress*"))
00063       return new QHostAddress(*argValue<QHostAddress *>(args[0]));
00064     if (sgt.isEmpty())
00065       return new QHostAddress;
00066     if (sgt.isEmpty())
00067       return new QHostAddress;
00068     return 0;
00069   }
00070 
00071 public:
00072   static QMap<int, QStringList> candidateConstructors() {
00073     QMap<int, QStringList> candidates;
00074     candidates[0].append(QString::null);
00075     candidates[1].append(QString::fromLatin1("Q_UINT32"));
00076     candidates[1].append(QString::fromLatin1("Q_UINT8*"));
00077     candidates[1].append(QString::fromLatin1("Q_IPV6ADDR"));
00078     candidates[1].append(QString::fromLatin1("QHostAddress*"));
00079     candidates[0].append(QString::null);
00080     candidates[0].append(QString::null);
00081     return candidates;
00082   }
00083   //@AQ_END_DEF_PUB_SLOTS@
00084 };
00085 
00086 //@AQ_BEGIN_IMP_PUB_SLOTS@
00087 inline void AQSHostAddress::setAddress(Q_UINT32 arg0)
00088 {
00089   AQ_CALL_VOID(setAddress(arg0));
00090 }
00091 inline void AQSHostAddress::setAddress(Q_UINT8 *arg0)
00092 {
00093   AQ_CALL_VOID(setAddress(arg0));
00094 }
00095 inline bool AQSHostAddress::setAddress(const QString &arg0)
00096 {
00097   AQ_CALL_RET_V(setAddress(arg0), bool);
00098 }
00099 inline bool AQSHostAddress::isIPv4Address() const
00100 {
00101   AQ_CALL_RET_V(isIPv4Address(), bool);
00102 }
00103 inline bool AQSHostAddress::isIPv6Address() const
00104 {
00105   AQ_CALL_RET_V(isIPv6Address(), bool);
00106 }
00107 inline QString AQSHostAddress::toString() const
00108 {
00109   AQ_CALL_RET_V(toString(), QString);
00110 }
00111 inline bool AQSHostAddress::isNull() const
00112 {
00113   AQ_CALL_RET_V(isNull(), bool);
00114 }
00115 //@AQ_END_IMP_PUB_SLOTS@
00116 
00117 #endif /* AQSHOSTADDRESS_P_H_ */
00118 // @AQSVOIDPTR@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'