• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

SugarBuddy.h

Go to the documentation of this file.
00001 /* Copyright (C) 2007 One Laptop Per Child
00002  * Author: Marc Maurer <uwog@uwog.net>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef __SUGARBUDDY_H__
00021 #define __SUGARBUDDY_H__
00022 
00023 #include <map>
00024 #include <account/xp/Buddy.h>
00025 #include <account/xp/DocTreeItem.h>
00026 #include <account/xp/AccountHandler.h>
00027 
00028 class DocHandle;
00029 
00030 class SugarBuddy : public Buddy
00031 {
00032 public:
00033     SugarBuddy(AccountHandler* handler, const UT_UTF8String dbusAddress)
00034         : Buddy(handler),
00035         m_sDBusAddress(dbusAddress)
00036     {
00037     }
00038 
00039     virtual UT_UTF8String getDescriptor(bool /*include_session_info = false*/) const
00040     {
00041         return UT_UTF8String("sugar://") + m_sDBusAddress;
00042     }
00043 
00044     virtual UT_UTF8String       getDescription() const
00045         { return m_sDBusAddress; }
00046 
00047     virtual const DocTreeItem* getDocTreeItems() const
00048     {
00049         UT_ASSERT_HARMLESS(UT_NOT_REACHED);
00050         return NULL;
00051     }
00052 
00053     const UT_UTF8String& getDBusAddress()
00054     {
00055         return m_sDBusAddress;
00056     }
00057 
00058 private:
00059 
00060     UT_UTF8String       m_sDBusAddress;
00061 };
00062 
00063 typedef boost::shared_ptr<SugarBuddy> SugarBuddyPtr;
00064 
00065 #endif /* SUGARBUDDY_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1