LastActivity::Query Class Reference

`#include <lastactivity.h>`

Inheritance diagram for LastActivity::Query:
[legend]

## Public Member Functions

| Query (const Tag *tag=0)
| Query (const std::string &status, long seconds)
virtual | ~Query ()
long | seconds () const
const std::string & | status () const
virtual const std::string & | filterString () const
virtual StanzaExtension * | newInstance (const Tag *tag) const
virtual Tag * | tag () const
virtual StanzaExtension * | clone () const
Public Member Functions inherited from StanzaExtension
| StanzaExtension (int type)
virtual | ~StanzaExtension ()
virtual Stanza * | embeddedStanza () const
virtual Tag * | embeddedTag () const
int | extensionType () const

## Detailed Description

This is an abstraction of a LastActivity Query that can be used in XEP-0012 as well as XEP-0256.

XEP-Version: 2.0 (XEP-0012) XEP-Version: 0.1 (XEP-0256)

Author
  Jakob Schröter js@ca.nosp@m.maya.nosp@m..net

Since
  1.0

Definition at line 52 of file lastactivity.h.

## Constructor & Destructor Documentation

## Query() [1/2]

Query | ( | const Tag * | tag = 0 | ) |

Constructs a new Query object from the given Tag.

Parameters

  tag | The Tag to parse.

Definition at line 28 of file lastactivity.cpp.

## Query() [2/2]

Query | ( | const std::string & | status,
|  | long | seconds )

Constructs a new Query object from the given long.

Parameters

  status | A status message.
  seconds | The number of seconds since last activity.

Definition at line 40 of file lastactivity.cpp.

## ~Query()

~Query | ( |  | ) |

virtual

Virtual destructor.

Definition at line 46 of file lastactivity.cpp.

## Member Function Documentation

## clone()

virtual StanzaExtension * clone | ( |  | ) | const

inline virtual

Returns an identical copy of the current StanzaExtension.

Returns
  An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 100 of file lastactivity.h.

## filterString()

const std::string & filterString | ( |  | ) | const

virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
  The extension's filter string.

Implements StanzaExtension.

Definition at line 50 of file lastactivity.cpp.

## newInstance()

virtual StanzaExtension * newInstance | ( | const Tag * | tag | ) | const

inline virtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
gloox::LastActivity::Query::tag
virtual Tag * tag() const
Definition lastactivity.cpp:57
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47

Returns
  The derived extension's new instance.

Implements StanzaExtension.

Definition at line 91 of file lastactivity.h.

## seconds()

long seconds | ( |  | ) | const

inline

Returns the number of seconds since last activity.

Returns
  The number of seconds since last activity. -1 if last activity is unknown.

Definition at line 78 of file lastactivity.h.

## status()

const std::string & status | ( |  | ) | const

inline

Returns the last status message if the user is offline and specified a status message when logging off.

Returns
  The last status message, if any.

Definition at line 85 of file lastactivity.h.

## tag()

Tag * tag | ( |  | ) | const

virtual

Returns a Tag representation of the extension.

Returns
  A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 57 of file lastactivity.cpp.

The documentation for this class was generated from the following files:

- lastactivity.h
- lastactivity.cpp