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

FakeBuddy.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 __FAKEBUDDY_H__
00021 #define __FAKEBUDDY_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 FakeBuddy : public Buddy
00031 {
00032 public:
00033     FakeBuddy(AccountHandler* handler, const UT_UTF8String& descriptor)
00034         : Buddy(handler),
00035         m_sDescriptor(descriptor)
00036     {
00037     }
00038 
00039     virtual UT_UTF8String getDescriptor(bool /*include_session_info = false*/) const
00040     {
00041         return UT_UTF8String("fake://") + m_sDescriptor;
00042     }
00043 
00044     virtual UT_UTF8String       getDescription() const
00045         { return m_sDescriptor; }
00046 
00047     virtual const DocTreeItem* getDocTreeItems() const
00048     {
00049         UT_ASSERT_HARMLESS(UT_NOT_REACHED);
00050         return NULL;
00051     }
00052 
00053 private:
00054     UT_UTF8String m_sDescriptor;
00055 };
00056 
00057 typedef boost::shared_ptr<FakeBuddy> FakeBuddyPtr;
00058 
00059 #endif /* __FAKEBUDDY_H__ */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1