00001 /* Copyright (C) 2010 AbiSource Corporation B.V. 00002 * 00003 * This program is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU General Public License 00005 * as published by the Free Software Foundation; either version 2 00006 * of the License, or (at your option) any later version. 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program; if not, write to the Free Software 00015 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00016 * 02111-1307, USA. 00017 */ 00018 00019 #ifndef __SIPSIMPLEACCOUNTHANDLER__ 00020 #define __SIPSIMPLEACCOUNTHANDLER__ 00021 00022 #include <string> 00023 #include <vector> 00024 #include <map> 00025 00026 using std::string; 00027 using std::map; 00028 00029 #include <account/xp/AccountHandler.h> 00030 #include "ut_string_class.h" 00031 #include "ut_types.h" 00032 #include "SIPSimpleBuddy.h" 00033 00034 extern AccountHandlerConstructor SIPSimpleAccountHandlerConstructor; 00035 00036 class SIPSimpleAccountHandler : public AccountHandler 00037 { 00038 public: 00039 SIPSimpleAccountHandler(); 00040 virtual ~SIPSimpleAccountHandler(void); 00041 00042 // housekeeping 00043 static UT_UTF8String getStaticStorageType(); 00044 virtual UT_UTF8String getStorageType() 00045 { return getStaticStorageType(); } 00046 virtual UT_UTF8String getDescription(); 00047 virtual UT_UTF8String getDisplayType(); 00048 00049 // connection management 00050 virtual ConnectResult connect(); 00051 virtual bool disconnect(void); 00052 virtual bool isOnline(); 00053 00054 // dialog management 00055 virtual void embedDialogWidgets(void* pEmbeddingParent) = 0; 00056 virtual void removeDialogWidgets(void* pEmbeddingParent) = 0; 00057 virtual void storeProperties() = 0; 00058 00059 // user management 00060 virtual BuddyPtr constructBuddy(const PropertyMap& vProps); 00061 virtual BuddyPtr constructBuddy(const std::string& descriptor, BuddyPtr pBuddy); 00062 virtual bool recognizeBuddyIdentifier(const std::string& identifier); 00063 virtual bool allowsManualBuddies() 00064 { return true; } 00065 00066 virtual void forceDisconnectBuddy(BuddyPtr) { /* TODO: implement me? */ } 00067 virtual bool hasPersistentAccessControl() 00068 { return true; } 00069 00070 // session management 00071 virtual bool allowsSessionTakeover() 00072 { return false; } // no technical reason not to allow this; we just didn't implement session takeover for this backend yet 00073 00074 // packet management 00075 virtual bool send(const Packet* pPacket); 00076 virtual bool send(const Packet* pPacket, BuddyPtr pBuddy); 00077 00078 private: 00079 }; 00080 00081 #endif /* __SIPSIMPLEACCOUNTHANDLER__ */
1.7.1