/* Copyright (C) 2006,2007 Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #ifndef __SERVICEACCOUNTHANDLER__ #define __SERVICEACCOUNTHANDLER__ #include #include "ut_string_class.h" #include #define XMPP_SERVICE_RESOURCE "ServiceAccountHandler" #define CAC_SERVER "collaborate.abisource.com" class PD_Document; /*enum DocTreeItemType { DOCTREEITEM_TYPE_ROOT = 0, DOCTREEITEM_TYPE_DOCUMENT, DOCTREEITEM_TYPE_FOLDER, DOCTREEITEM_TYPE_PERSON, DOCTREEITEM_TYPE_GROUP, DOCTREEITEM_TYPE_NILL }; enum DocTreeItemAcl { DOCTREEITEM_ACL_PRIVATE = 0, DOCTREEITEM_ACL_PUBLIC, DOCTREEITEM_ALC_FRIEND, DOCTREEITEM_ALC_GROUP, DOCTREEITEM_ALC_NILL }; class DocTreeItem { public: DocTreeItem(); DocTreeItem(UT_sint64 id, const char* name, DocTreeItemType type, DocTreeItemAcl acl); UT_sint64 m_id; UT_UTF8String m_name; DocTreeItemType m_type; DocTreeItemAcl m_acl; void* m_data; std::vector m_vecChildren; };*/ class ServiceAccountHandler : public AccountHandler { public: ServiceAccountHandler(); virtual ~ServiceAccountHandler(); // we only support 1 service connection for every given AbiWord instance static ServiceAccountHandler* getService(); // housekeeping virtual UT_UTF8String getDescription(); virtual UT_UTF8String getDisplayType(); virtual UT_UTF8String getStorageType(); // dialog management virtual void storeProperties(); // connection management virtual UT_sint32 connect(); virtual bool disconnect(); virtual bool isOnline(); // user management virtual Buddy* constructBuddy(const PropertyMap& props); // packet management virtual bool _send(const UT_UTF8String& packet); virtual bool _send(const UT_UTF8String& packet, const Buddy& buddy); // service specific functions void updateDocumentsAsync(); void saveDocumentAsync(UT_sint64 docId, PD_Document * pDoc); void populateDocuments(const UT_UTF8String& packet); void openDocumentAsync(UT_sint64 docId); void closeDocument(UT_sint64 docId, PD_Document * pDoc); const char* getCACServer(void); const char* getXMPPResource(void); const char* getAbiterString(void); private: static ServiceAccountHandler* m_pService; //std::vector m_vecDocTreeItems; }; #endif /* __SERVICEACCOUNTHANDLER__ */