NCBI C++ Toolkit Cross Reference


/* $Id: gui_object_info_default.cpp 26400 2012-09-12 13:24:18Z wuliangs $ * =========================================================================== * * 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: Roman Katargin * * File Description: * */ #include <ncbi_pch.hpp> #include <gui/objutils/interface_registry.hpp> #include <gui/objutils/gui_object_info.hpp> #include <gui/objutils/label.hpp> BEGIN_NCBI_SCOPE class CGuiObjectInfoDefault : public CObject, public IGuiObjectInfo { public: static CGuiObjectInfoDefault* CreateObject(SConstScopedObject& object, ICreateParams* params); virtual string GetType() const { return "Unknown"; } virtual string GetSubtype() const { return ""; } virtual string GetLabel() const; virtual void GetToolTip(string& t_text, string& t_title, TSeqPos at_p = (TSeqPos)-1) const; virtual void GetLinks(string& /*links*/, bool /*no_ncbi_base*/) const {}; virtual string GetIcon() const { return ""; } virtual string GetViewCategory() const { return "Generic"; } private: CConstRef<CObject> m_Object; mutable CRef<objects::CScope> m_Scope; }; void initCGuiObjectInfoDefault() { CInterfaceRegistry::RegisterFactory( typeid(IGuiObjectInfo).name(), new CObjectInterfaceFactory<CGuiObjectInfoDefault>()); } CGuiObjectInfoDefault* CGuiObjectInfoDefault::CreateObject( SConstScopedObject& object, ICreateParams* /*params*/) { CGuiObjectInfoDefault* gui_info = new CGuiObjectInfoDefault(); gui_info->m_Object = object.object; gui_info->m_Scope = object.scope; return gui_info; } string CGuiObjectInfoDefault::GetLabel() const { string label; CLabel::GetLabel(*m_Object, &label, CLabel::eDescriptionBrief, m_Scope); return label; } void CGuiObjectInfoDefault::GetToolTip(string& t_text, string& /*t_title*/, TSeqPos /*at_p*/) const { CLabel::GetLabel(*m_Object, &t_text, CLabel::eDescriptionBrief, m_Scope); } END_NCBI_SCOPE

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.