include/gui/utils/view_event.hpp

Go to the documentation of this file.
00001 #ifndef GUI_UTILS___VIEW_EVENT__HPP
00002 #define GUI_UTILS___VIEW_EVENT__HPP
00003 
00004 /*  $Id: view_event.hpp 14515 2007-05-04 17:18:18Z kazimird $
00005  * ===========================================================================
00006  *
00007  *                            PUBLIC DOMAIN NOTICE
00008  *               National Center for Biotechnology Information
00009  *
00010  *  This software/database is a "United States Government Work" under the
00011  *  terms of the United States Copyright Act.  It was written as part of
00012  *  the author's official duties as a United States Government employee and
00013  *  thus cannot be copyrighted.  This software/database is freely available
00014  *  to the public for use. The National Library of Medicine and the U.S.
00015  *  Government have not placed CAnyType restriction on its use or reproduction.
00016  *
00017  *  Although all reasonable efforts have been taken to ensure the accuracy
00018  *  and reliability of the software and data, the NLM and the U.S.
00019  *  Government do not and cannot warrant the performance or results that
00020  *  may be obtained by using this software or data. The NLM and the U.S.
00021  *  Government disclaim all warranties, express or implied, including
00022  *  warranties of performance, merchantability or fitness for CAnyType particular
00023  *  purpose.
00024  *
00025  *  Please cite the author in any work or product based on this material.
00026  *
00027  * ===========================================================================
00028  *
00029  * Authors:  Vladimir Tereshkov
00030  *
00031  * File Description:
00032  *    Event object for view communications
00033  */
00034 
00035 #include <gui/utils/event.hpp>
00036 #include <gui/objutils/objects.hpp>
00037 
00038 BEGIN_NCBI_SCOPE
00039 
00040 class CScopedObjectsAttachment : public IEventAttachment
00041 {
00042 public:
00043     CScopedObjectsAttachment(TConstScopedObjects& objs) : m_Objects(objs) {}
00044     TConstScopedObjects m_Objects;
00045 };
00046 
00047 class CViewEvent : public CEvent
00048 {
00049 public:
00050     enum EEventType {
00051         eUnknownEvent,
00052 
00053         /// general notification that selections have changed
00054         /// This is to be packaged in a CSelectionEvent.
00055         eSelectionChanged,
00056         eProjectChanged, /// general data update notification
00057         eViewReleased,    /// a view has been destroyed
00058         eViewCreated,   /// a view has been destroyed
00059         eViewerCreated,
00060         eViewerReleased,
00061 
00062         /// notification from child to parent that a selection has changed
00063         eWidgetSelectionChanged,
00064 
00065         /// notification from child to parent that the visible range has changed
00066         eWidgetRangeChanged,
00067 
00068         /// notification from child to parent that the underlying data has changed
00069         eWidgetDataChanged,
00070 
00071         /// general notification to subscribers that the visible range
00072         /// has changed.  This is to be packaged in a CVisibleRangeEvent.
00073         eVisibleRangeChanged,
00074 
00075         eEditSelectedObjects,
00076         eDeleteSelectedObjects
00077     };
00078     enum EEventBroadcast {
00079         eEventProject, // all views attached to current document
00080         eEventViews,    // all identical views attached to current document
00081         eEventReflect   // reflect event to current view
00082     };
00083 
00084     /// default ctor
00085     CViewEvent()
00086         : CEvent()
00087     {
00088     }
00089 
00090     /// create an event for a given event ID, with event class Unknown
00091     CViewEvent(TEventID eid)
00092         : CEvent(eid)
00093     {
00094     }
00095 
00096     /// create an event for a specific event class and ID
00097     CViewEvent(TEventClass ecl, TEventID eid)
00098         : CEvent(ecl, eid)
00099     {
00100     }
00101 
00102     /// create an event with all the bells and whistles
00103     CViewEvent(TEventClass ecl, TEventID eid,
00104                IEventAttachment* att, EOwnershipPolicy policy, TEventSender* tr)
00105         : CEvent(ecl, eid, att, policy, tr)
00106     {
00107     }
00108 
00109 };
00110 
00111 END_NCBI_SCOPE
00112 
00113 #endif  // GUI_UTILS___VIEW_EVENT__HPP
00114 
00115 

Generated on Sun Mar 15 19:08:15 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Mar 16 12:49:52 2009 by modify_doxy.py rev. 117643