32 #ifndef ARNDISCOVER_HPP 33 #define ARNDISCOVER_HPP 37 #include <QHostAddress> 38 #include <QVariantMap> 40 class ArnDiscoverInfoPrivate;
41 class ArnDiscoverBrowserBPrivate;
42 class ArnDiscoverResolverPrivate;
43 class ArnDiscoverAdvertisePrivate;
142 QStringList
groups()
const;
171 QHostAddress
hostIp()
const;
216 ArnDiscoverInfoPrivate*
const d_ptr;
364 bool isBrowsing()
const;
381 void setFilter(
const QString& group);
389 void browse(
bool enable =
true);
408 int resolve(
const QString& serviceName,
bool forceUpdate =
true);
411 ArnDiscoverBrowserBPrivate*
const d_ptr;
415 void onBrowseError(
int code);
416 void onServiceAdded(
int id,
const QString& name,
const QString& domain);
417 void onServiceRemoved(
int id,
const QString& name,
const QString& domain);
419 void onResolveError(
int id,
int code);
420 void onResolved(
int id,
const QByteArray& escFullDomain);
422 void onLookupError(
int id,
int code);
423 void onLookuped(
int id);
427 int newServiceInfo(
int id,
const QString& name,
const QString& domain);
428 void removeServiceInfo(
int index);
488 {
return ArnDiscoverBrowserB::isBrowsing();}
497 {ArnDiscoverBrowserB::setFilter( typeFilter);}
507 {ArnDiscoverBrowserB::setFilter( group);}
517 {ArnDiscoverBrowserB::browse( enable);}
523 {ArnDiscoverBrowserB::stopBrowse();}
595 int resolve(
const QString& serviceName,
bool forceUpdate =
true);
658 QStringList
groups()
const;
675 void addGroup(
const QString& group);
718 int port = -1,
const QString& hostName = QString());
788 bool hasSetupAdvertise()
const;
789 void setHostIpList(
const QStringList& hostIpList);
792 ArnDiscoverAdvertisePrivate*
const d_ptr;
800 virtual void postSetupThis();
807 virtual void serviceRegistered(
const QString& serviceName);
814 virtual void serviceRegistrationError(
int code);
823 #endif // ARNDISCOVER_HPP void setGroups(const QStringList &groups)
Set service discover groups used for filter browsing.
QStringList groups() const
Return service discover groups used for filter browsing.
bool goTowardState(int index, ArnDiscoverInfo::State state)
Command a service to go towards a stop state.
Registering a ZeroConfig service.
ArnDiscoverInfo::State defaultStopState() const
Return the default stop state for this service discover browser.
QString hostName() const
Return the host name for this service.
ArnDiscoverResolver(QObject *parent=arnNullptr)
State of Arn discover browse data. Can be tested by relative order.
QStringList groups() const
Return the groups for this service.
QString hostIpString() const
Return the printable host ip-address for this service.
void advertiseService(ArnDiscover::Type discoverType, const QString &serviceName, int port=-1, const QString &hostName=QString())
Start advertising the service.
State state() const
Return the state for this service.
void serviceRemoved(int index)
Indicate service has been removed.
State stopState() const
Return the stop state for this service.
void serviceChangeError(int code)
Indicate unsuccessfull advertise of service.
Container class with string representation for serialized data.
int resolvCode() const
Return the latest resolv error code for this service.
Advertise an Arn service.
Browsing for ZeroConfig services.
const ArnDiscoverInfo & infoByIndex(int index)
Return the discover service info by its index.
#define MQ_DECLARE_FLAGS(FEStruct)
Flags.
ArnDiscoverInfo & operator=(const ArnDiscoverInfo &other)
void setFilter(ArnDiscover::Type typeFilter)
Set service discover filter using predefined types.
void addGroup(const QString &group)
Add a service discover group.
Got service name and domain (from browsing)
void serviceAdded(int index, const QString &name)
Indicate service has been added (discovered)
int indexToId(int index)
Return the discover service id by its index.
int resolve(const QString &serviceName, bool forceUpdate=true)
Resolve a specific service name.
Got error during resolving HostName, HostPort, type and properties.
QString service() const
Returns the requested service name for this Advertise.
ArnDiscoverBrowserB(QObject *parent=arnNullptr)
QHostAddress hostIp() const
Return the host ip-address for this service.
void setFilter(const QString &group)
Set service discover filter using group name.
bool inProgress() const
Is discover in progress for this service.
Types of Arn discover advertise.
QString hostWithInfo() const
Get the the HostWithInfo string.
Is now advertising. Startup has finished sucessfully.
Arn::XStringMap customProperties() const
Return service custom properties.
QString currentService() const
Returns the current service name for this Advertise.
QString hostPortString() const
Return the printable host port for this service.
#define MQ_DECLARE_OPERATORS_FOR_FLAGS(FEStruct)
QString serviceName() const
Return the service name for this service.
int IdToIndex(int id)
Return the discover service index by its id.
void stopBrowse()
Stop browsing.
int serviceNameToId(const QString &name)
Return the discover service id by its name.
void addCustomProperty(const QString &key, const QString &val)
Add service custom property.
States of DiscoverAdvertise / These values must be synced with: ArnZeroConf::State.
Arn::XStringMap properties() const
Return the properties for this service.
Got error during DNS lookup HostIp.
void setDefaultService(const QString &defaultService)
Set the default service name.
void setCustomProperties(const Arn::XStringMap &customProperties)
Set service custom properties.
ArnDiscoverBrowser(QObject *parent=arnNullptr)
void setDefaultStopState(ArnDiscoverInfo::State defaultStopState)
Set the default stop state for this service discover browser.
Also got HostName, HostPort, type and properties (from resolving)
Browse() and resolve() together, may never be used to the same instance.
QString typeString() const
Return the printable type for this service.
void serviceChanged(const QString &serviceName)
Indicate successfull advertise of service.
void browse(bool enable=true)
Change state of browsing.
bool isError() const
Is in an error state for this service.
Browsing for Arn services.
Class for holding current discover info of one service.
QString defaultService() const
Return the default service name.
void infoUpdated(int index, ArnDiscoverInfo::State state)
Indicate service has been updated.
State state() const
Returns the state for this Advertise.
const ArnDiscoverInfo & infoByName(const QString &serviceName)
Return the discover service info by its name.
quint16 hostPort() const
Return the port for this service.
bool isBrowsing() const
Return the status of the browsing.
int serviceCount() const
Return the number of active discover services.
isAny(): Startup advertising in progress or has finished sucessfully.
QString domain() const
Return the domain for this service.
#define MQ_DECLARE_ENUM(EStruct)
Enums.
ArnDiscover::Type type() const
Return the discover type for this service.
Startup advertising in progress.
const ArnDiscoverInfo & infoById(int id)
Return the discover service info by its id.
ArnDiscoverAdvertise(QObject *parent=arnNullptr)
virtual void setService(const QString &service)
Set the service name.