Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

vos/applibs/chatgui/privmsg.hh

Go to the documentation of this file.
00001 /*  $Id: privmsg.hh,v 1.12 2003/07/24 05:18:42 tetron Exp $
00002 
00003     Copyright (C) 2003 Reed Hedges <reed@interreality.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00018 */
00019 
00020 #ifndef _VOSCHATGUI_PRIVMSG_H_
00021 #define _VOSCHATGUI_PRIVMSG_H_
00022 
00023 #include <vos/corelibs/vos/vos.hh>
00024 #include <vos/metaobjects/property/property.hh>
00025 #include <vos/metaobjects/misc/talkative.hh>
00026 #include <vos/metaobjects/misc/avatar.hh>
00027 #include <vos/gui/gui/gui.hh>
00028 
00029 #if defined(_WIN32) && defined(_MSC_VER)
00030 # ifdef CHATGUI_EXPORTS
00031 #  define CHATGUI_API __declspec(dllexport)
00032 # else
00033 #  define CHATGUI_API __declspec(dllimport)
00034 # endif
00035 #else
00036 # define CHATGUI_API
00037 #endif
00038 
00039 namespace VOSChatGUI {
00040 
00041 /** A "Private message" session between you and another object
00042     @todo support multiple targets.
00043     @ingroup chatgui
00044     @ingroup applibs
00045 */
00046 
00047 class CHATGUI_API PrivMsg : public virtual ObjectExciseListener,
00048     public virtual TalkListener,
00049     public virtual VOSGUI::LocalContainer,
00050     public virtual ChildChangeListener
00051 {
00052     private:
00053         int newMessagePos;
00054 
00055     protected:
00056         vRef<VOSGUI::Container> preferences;
00057         vRef<Talkative> target;
00058         vRef<LocalTalkative> sender;
00059         vRef<VOSGUI::SelectList> messages;
00060         vRef<Property> replyInfo;
00061         vRef<Property> messageText;
00062         vRef<Property> priority;
00063 
00064         VOSGUI_DEFINE_BUTTON(SendButton, PrivMsg, "Send")
00065 
00066     public:
00067         friend void SendButton::push(const string& userid);
00068 
00069 
00070     public:
00071 
00072         /** Register extenders with VOS */
00073         static void registerExtenders();
00074 
00075         /** Create widgets, set target. */
00076         void setup(LocalTalkative* newSender, Talkative* newTarget = 0);
00077 
00078         /** set target */
00079         void setTarget(Talkative* newTarget);
00080 
00081         /** Whether new messages appear at top of list (true) or bottom (false) */
00082         void setMessagesAtTop(bool v = true);
00083 
00084         /** Whether new messages appear at bottom of list (true) or top (false) */
00085         void setMessagesAtBottom(bool v = true);
00086 
00087         /** Add a message to the messages list */
00088         void notifyTalkMessage(TalkMessage& m);
00089 
00090         PrivMsg(MetaObject* s);
00091         virtual ~PrivMsg();
00092         static MetaObject* new_PrivMsg(MetaObject* s, const string& type);
00093 
00094         void notifyObjectExcise(RefCounted* obj);
00095 
00096         void notifyChildInserted(VobjectEvent& e);
00097         void notifyChildRemoved(VobjectEvent& e);
00098         void notifyChildReplaced(VobjectEvent& e);
00099 
00100 };
00101 
00102 
00103 }
00104 
00105 #endif // _VOSCHATGUI_PRIVMSG_H_
00106 

Generated on Tue Aug 12 03:55:37 2003 for Interreality Project - VOS by doxygen 1.3.2