obj_clipboard.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
- /*
- * ===========================================================================
- * PRODUCTION $Log: obj_clipboard.hpp,v $
- * PRODUCTION Revision 1000.0 2004/06/01 19:55:37 gouriano
- * PRODUCTION PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.1
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_OBJUTILS___CLIPBOARD__HPP
- #define GUI_OBJUTILS___CLIPBOARD__HPP
- /* $Id: obj_clipboard.hpp,v 1000.0 2004/06/01 19:55:37 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:
- *
- */
- #include <corelib/ncbiobj.hpp>
- #include <objmgr/scope.hpp>
- #include <gui/gui.hpp>
- #include <gui/utils/clipboard.hpp>
- #include <gui/objutils/objects.hpp>
- /** @addtogroup GUI_OBJUTILS
- *
- * @{
- */
- BEGIN_NCBI_SCOPE
- class NCBI_GUIOBJUTILS_EXPORT CObjClipboard : public CClipboard
- {
- public:
- // modes for text copy
- enum ECopyMode {
- eCopy_Label,
- eCopy_ASN,
- eCopy_XML
- };
- // clear the contents of the current clipboard
- static void Clear(void);
- // Copy an object to the clipboard. This version will use a best-fit
- // to try and find the text to be copied.
- static void Add(objects::CScope& scope, const CObject& object);
- // Copy an object to the clipboard. This version will use a supplied
- // text parameter for its copied text; the text parameter overrides
- // the current text copy mode.
- static void Add(objects::CScope& scope, const CObject& object,
- const string& text);
- // Copy just a piece of text to the clipboard.
- static void Add(const string& text);
- // force the copy to be made
- static void Copy();
- // Retrieve the current objects from the clipboard. Only non-NULL
- // parameters are retrieved.
- static void Paste(TConstScopedObjects* objs, string* text);
- private:
- // our current objects
- static TConstScopedObjects sm_Objects;
- // the current text
- static string sm_Text;
- // the mode of text copy
- static ECopyMode sm_Mode;
- // append an appropriate piece of text onto the passed string
- static void x_GetText(objects::CScope& scope,
- const CObject& object,
- string* text);
- // forbidden
- CObjClipboard();
- CObjClipboard(const CClipboard&);
- CObjClipboard& operator=(const CClipboard&);
- };
- END_NCBI_SCOPE
- /* @} */
- /*
- * ===========================================================================
- * $Log: obj_clipboard.hpp,v $
- * Revision 1000.0 2004/06/01 19:55:37 gouriano
- * PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.1
- *
- * Revision 1.1 2004/05/07 15:45:38 dicuccio
- * Renamed class as CObjClipboard
- *
- * Revision 1.3 2004/05/03 13:34:54 dicuccio
- * FIxed include guards, doxygen groups
- *
- * Revision 1.2 2004/05/03 12:41:35 dicuccio
- * Fixed #includes and export specifiers
- *
- * Revision 1.1 2004/04/30 11:52:52 dicuccio
- * Split out from gui/utils
- *
- * Revision 1.3 2004/04/16 14:27:17 dicuccio
- * Added doxygen module tag
- *
- * Revision 1.2 2004/04/07 12:38:45 dicuccio
- * Rewored to use structs and defines in objects.hpp
- *
- * Revision 1.1 2004/01/30 17:12:11 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_OBJUTILS___CLIPBOARD__HPP