Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

pubsub.h

00001 /*
00002   Copyright (c) 2007-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 #ifndef PUBSUB_H__
00014 #define PUBSUB_H__
00015 
00016 #include <map>
00017 #include <string>
00018 
00019 #include "gloox.h"
00020 #include "jid.h"
00021 
00022 namespace gloox
00023 {
00030   namespace PubSub
00031   {
00032 
00036     enum NodeType
00037     {
00038       NodeLeaf,                     
00040       NodeCollection,               
00043       NodeInvalid                   
00044     };
00045 
00049     enum AffiliationType
00050     {
00051       AffiliationNone,              
00052       AffiliationPublisher,         
00053       AffiliationOwner,             
00054       AffiliationOutcast,           
00055       AffiliationInvalid            
00056     };
00057 
00061     enum SubscriptionType
00062     {
00063       SubscriptionNone,             
00065       SubscriptionSubscribed,       
00068       SubscriptionPending,          
00072       SubscriptionUnconfigured,     
00076       SubscriptionInvalid           
00077     };
00078 
00079     enum EventType
00080     {
00081       EventCollection,         
00082       EventConfigure,          
00083       EventDelete,             
00084       EventItems,              
00085       EventItemsRetract,       
00086       EventPurge,              
00087       EventUnknown             
00088     };
00089 
00093     enum SubscriptionObject
00094     {
00095       SubscriptionNodes,            
00096       SubscriptionItems             
00098     };
00099 
00103     enum AccessModel
00104     {
00105       AccessOpen,                   
00109       AccessPresence,               
00112       AccessRoster,                 
00115       AccessAuthorize,              
00117       AccessWhitelist,              
00124       AccessDefault                 
00126     };
00127 
00131     enum PubSubFeature
00132     {
00133       FeatureCollections           = 1,     
00134       FeatureConfigNode            = 1<<1,  
00135       FeatureCreateAndConfig       = 1<<2,  
00137       FeatureCreateNodes           = 1<<3,  
00138       FeatureDeleteAny             = 1<<4,  
00140       FeatureDeleteNodes           = 1<<5,  
00141       FeatureGetPending            = 1<<6,  
00143       FeatureInstantNodes          = 1<<7,  
00144       FeatureItemIDs               = 1<<8,  
00145       FeatureLeasedSubscription    = 1<<9,  
00146       FeatureManageSubscriptions   = 1<<10, 
00147       FeatureMetaData              = 1<<11, 
00148       FeatureModifyAffiliations    = 1<<12, 
00149       FeatureMultiCollection       = 1<<13, 
00151       FeatureMultiSubscribe        = 1<<14, 
00153       FeaturePutcastAffiliation    = 1<<15, 
00154       FeaturePersistentItems       = 1<<16, 
00155       FeaturePresenceNotifications = 1<<17, 
00157       FeaturePublish               = 1<<18, 
00159       FeaturePublisherAffiliation  = 1<<19, 
00160       FeaturePurgeNodes            = 1<<20, 
00161       FeatureRetractItems          = 1<<21, 
00162       FeatureRetrieveAffiliations  = 1<<22, 
00164       FeatureRetrieveDefault       = 1<<23, 
00166       FeatureRetrieveItems         = 1<<24, 
00167       FeatureRetrieveSubscriptions = 1<<25, 
00169       FeatureSubscribe             = 1<<26, 
00170       FeatureSubscriptionOptions   = 1<<27, 
00172       FeatureSubscriptionNotifs    = 1<<28, 
00173       FeatureUnknown               = 1<<29  
00174     };
00175 
00176 // [Persistent - Notification]
00179 // [Persistent - Payload]
00182 // [Transient - Notification]
00185 // [Transient - Payload]
00191     struct Subscriber
00192     {
00193       Subscriber( const JID& _jid,
00194                   SubscriptionType _type,
00195                   const std::string& _subid = EmptyString)
00196         : jid( _jid ), type( _type ), subid( _subid ) {}
00197       const JID jid;
00198       SubscriptionType type;
00199       const std::string subid;
00200     };
00201 
00205     struct Affiliate
00206     {
00207       Affiliate( const JID& _jid, AffiliationType _type )
00208         : jid( _jid ), type( _type ) {}
00209       const JID jid;
00210       AffiliationType type;
00211     };
00212 
00213     typedef std::list< Subscriber > SubscriberList;
00214     typedef std::list<  Affiliate > AffiliateList;
00215 
00220     struct TrackedInfo
00221     {
00222       JID service;
00223       std::string node;
00224       std::string item;
00225       std::string sid;
00226     };
00227 
00228     typedef std::map< std::string, SubscriptionType > SubscriptionMap;
00229     typedef std::map< std::string, AffiliationType  > AffiliationMap;
00230 
00231   }
00232 
00233 }
00234 
00235 #endif /* PUBSUB_H__ */

Generated on Sun Oct 12 16:25:16 2008 for gloox by  doxygen 1.4.1