iview.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:7k
- /*
- * ===========================================================================
- * PRODUCTION $Log: iview.hpp,v $
- * PRODUCTION Revision 1000.4 2004/06/01 19:46:50 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.13
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_CORE___IVIEW__HPP
- #define GUI_CORE___IVIEW__HPP
- /* $Id: iview.hpp,v 1000.4 2004/06/01 19:46:50 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software / database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software / database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- * IView -- abstract base class for GBENCH views
- */
- #include <corelib/ncbiobj.hpp>
- #include <gui/types.hpp>
- #include <gui/plugin/PluginArgSet.hpp>
- #include <gui/widgets/workspace/wm_client.hpp>
- #include <gui/print/print_options.hpp>
- #include <memory>
- BEGIN_NCBI_SCOPE
- class IDocument;
- class CSelectionBuffer;
- class IEventTransmitter;
- class IEventReceiver;
- //
- // class IView defines the abstract interface for views.
- //
- class IView : public CObject,
- public IWMClient
- {
- friend class CDocWorkspace;
- public:
- // virtual dtor
- virtual ~IView(void) {}
- // Show the current window
- virtual void Show(void) = 0;
- // Hide the current window
- virtual void Hide(void) = 0;
- // callback for removing the current window
- virtual void OnExit(void) = 0;
- // Print the contents of the current window. This is made virtual to allow
- // overrides by derived classes.
- virtual void OnPrint(void) = 0;
- // set the size of the window for this view. Derived classes can ignore
- // this if they choose.
- virtual void SetSize(int width, int height) = 0;
- // retrieve the size of this view
- virtual void GetSize(int& width, int& height) const = 0;
- // set the position of the window for this view. Derived classes can
- // ignore this if they choose.
- virtual void SetPosition(int pos_x, int pos_y) = 0;
- // set the position of the window for this view. Derived classes can
- // ignore this if they choose.
- virtual void GetPosition(int& pos_x, int& pos_y) const = 0;
- // resize this window. This is equivalent to calling both SetSize()
- // and SetPosition().
- virtual void Resize(int pos_x, int pos_y, int width, int height) = 0;
- // Pure virtual requirement: Retrieve a title for this view. Derived
- // classes should provide something succint but descriptive for this; the
- // string returned by this function will appear in menus that list the
- // views available for a given record.
- virtual const string& GetTitle(void) const = 0;
- // Access the document associated with this view
- virtual IDocument* GetDocument(void) = 0;
- // Access the event mask. The event mask is a bitmap of flags, each bit of
- // which corresponds to a distinct event. These events define the scope of
- // communication between views and from document to view.
- virtual void SetEventMask(TUpdateFlags flags) = 0;
- virtual TUpdateFlags GetEventMask(void) const = 0;
- // Access the selection buffer. The selection buffer is a hierarchical
- // data structure holding lists of items for a number of documents.
- virtual const CSelectionBuffer& GetSelBuffer(void) const = 0;
- virtual CSelectionBuffer& SetSelBuffer(void) = 0;
- // Access the visible range. This is provided as a global mechanism to
- // permit other views to maneuver the visible range of their sibling views.
- // This is provided as a virtual function such that sibling views can
- // choose to ignore this message.
- virtual void SetVisibleRange(const objects::CSeq_loc& range) = 0;
- // Access the current visible range
- virtual const objects::CSeq_loc& GetVisibleRange(void) const = 0;
- // Message even handler for inter-view messaging
- virtual void MessageEventHandler(TUpdateFlags flags, const void *user_data) = 0;
- // Message events callbacks
- virtual void OnSelectionChanged(const CSelectionBuffer& sels) = 0;
- virtual void OnDocumentChanged(void) = 0;
- virtual void OnViewReleased(IView& view) = 0;
- virtual void OnViewCreated(IView& view) = 0;
- virtual void OnVisibleRangeChanged(const objects::CSeq_loc& loc) = 0;
-
- // Transmitter/reciever QI
- virtual IEventTransmitter * QueryInterfaceTransmitter(void) = 0;
- virtual IEventReceiver * QueryInterfaceReceiver(void) = 0;
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: iview.hpp,v $
- * Revision 1000.4 2004/06/01 19:46:50 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.13
- *
- * Revision 1.13 2004/05/20 12:23:08 dicuccio
- * Removed include for child.hpp
- *
- * Revision 1.12 2004/05/17 13:18:51 dicuccio
- * Removed old document workspace. Inherit views from IWMClient to support new
- * workspace integration. Removed references to CChild.
- *
- * Revision 1.11 2004/04/07 12:33:40 dicuccio
- * Removed dead code
- *
- * Revision 1.10 2004/03/30 17:09:56 tereshko
- * Added support for events broadcasting
- *
- * Revision 1.9 2004/03/22 14:17:15 dicuccio
- * Replace gui/gui with gui/types - relieves FLTK dependency
- *
- * Revision 1.8 2004/03/11 17:16:04 dicuccio
- * Use gui/gui instead of gui/types
- *
- * Revision 1.7 2003/12/22 19:12:10 dicuccio
- * Modified mechanism for view-view messaging: provide more explicit function
- * signatures; added helper functions to make posting messages easier.
- *
- * Revision 1.6 2003/11/06 19:53:27 dicuccio
- * Removed USING_SCOPE(objects)
- *
- * Revision 1.5 2003/11/04 17:10:43 dicuccio
- * Added pure virtual functions for querying GUI position/size
- *
- * Revision 1.4 2003/11/04 12:36:50 friedman
- * Added event message handling and callback for the document message pool.
- *
- * Revision 1.3 2003/10/10 17:10:57 dicuccio
- * Added callback for OnExit() - called at view release time
- *
- * Revision 1.2 2003/09/29 15:20:06 dicuccio
- * Deprecated gui/scope.hpp. Merged gui/core/types.hpp into gui/types.hpp
- *
- * Revision 1.1 2003/09/04 13:56:53 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_CORE___IVIEW__HPP