00001 /* Copyright (C) 2006 Marc Maurer <uwog@uwog.net> 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., 51 Franklin Street, Fifth Floor, Boston, MA 00016 * 02110-1301 USA. 00017 */ 00018 00019 #ifndef AP_DIALOG_COLLABORATIONJOIN_H 00020 #define AP_DIALOG_COLLABORATIONJOIN_H 00021 00022 #include "ut_types.h" 00023 #include "xap_Frame.h" 00024 #include "xap_Dialog.h" 00025 #include "xav_View.h" 00026 #include "ut_vector.h" 00027 #include <account/xp/AccountHandler.h> 00028 #include <account/xp/Buddy.h> 00029 #include <account/xp/EventListener.h> 00030 00031 extern pt2Constructor ap_Dialog_CollaborationJoin_Constructor; 00032 00033 class AP_Dialog_CollaborationJoin : public XAP_Dialog_NonPersistent, EventListener 00034 { 00035 public: 00036 AP_Dialog_CollaborationJoin(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00037 virtual ~AP_Dialog_CollaborationJoin(void); 00038 00039 virtual void runModal(XAP_Frame * pFrame) = 0; 00040 00041 void signal(const Event& event, BuddyPtr pSource); 00042 00043 typedef enum { a_CANCEL, a_OPEN } tAnswer; 00044 00045 AP_Dialog_CollaborationJoin::tAnswer getAnswer(void) const 00046 { return m_answer; } 00047 00048 BuddyPtr getBuddy() 00049 { return m_pBuddy; }; 00050 00051 DocHandle* getDocHandle() 00052 { return m_pDocHandle; }; 00053 00054 protected: 00055 AP_Dialog_CollaborationJoin::tAnswer m_answer; 00056 BuddyPtr m_pBuddy; 00057 DocHandle* m_pDocHandle; 00058 00059 void _eventAddBuddy(); 00060 void _refreshAllDocHandlesAsync(); 00061 00062 void _refreshAccounts(); 00063 00064 virtual void _refreshWindow() = 0; 00065 virtual void _enableBuddyAddition(bool bEnabled) = 0; 00066 virtual void _addDocument(BuddyPtr pBuddy, DocHandle* pDocHandle) = 0; 00067 }; 00068 00069 #endif /* AP_DIALOG_COLLABORATIONJOIN_H */