• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/StatusShow.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <Swiften/Base/API.h>
00010 #include <Swiften/Elements/Payload.h>
00011 
00012 namespace Swift {
00013   class SWIFTEN_API StatusShow : public Payload {
00014     public:
00015       enum Type { Online, Away, FFC, XA, DND, None };
00016 
00017       StatusShow(const Type& type = Online);
00018 
00019       void setType(const Type& type) {
00020         type_ = type;
00021       }
00022 
00023       const Type& getType() const {
00024         return type_;
00025       }
00026 
00031       static int typeToAvailabilityOrdering(Type type) {
00032         switch (type) {
00033           case Online: return 4;
00034           case FFC: return 5;
00035           case Away: return 2;
00036           case XA: return 1;
00037           case DND: return 3;
00038           case None: return 0;
00039         }
00040         return 0;
00041       }
00042 
00043     private:
00044       Type type_;
00045   };
00046 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1