NCBI C++ ToolKit
desktop_typed_items.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_DESKTOP___DESKTOP_TYPED_ITEMS__HPP
2 #define GUI_WIDGETS_SEQ_DESKTOP___DESKTOP_TYPED_ITEMS__HPP
3 
4 /* $Id: desktop_typed_items.hpp 37477 2017-01-13 18:20:22Z asztalos $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Authors: Andrea Asztalos
30 *
31 * File Description:
32 *
33 */
34 
35 #include <corelib/ncbistd.hpp>
36 #include <gui/gui_export.h>
41 #include <objmgr/scope.hpp>
42 #include <objmgr/bioseq_handle.hpp>
49 
50 #include <wx/colour.h>
51 #include <wx/gdicmn.h>
52 #include <wx/brush.h>
53 
55 
56 class IDesktopDataItem : public CObject
57 {
58 public:
59  typedef vector<string> TLines;
60 
61  virtual ~IDesktopDataItem() {}
62  virtual TLines GetDescription(bool root = false) const = 0;
63  virtual wxColour GetTextColor() const = 0;
64  virtual wxColour GetFrameColor() const = 0;
65  virtual const wxBrush& GetBackgroundBrush() const = 0;
66  virtual const string& GetType() const { return kEmptyStr; }
67  virtual bool ShouldBeReduced() const { return false; }
68 
69  virtual const CObject* GetObject(void) const = 0;
70  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const = 0;
71 
72 };
73 
75 {
76 public:
77  CDesktopBioseqItem(const objects::CBioseq_Handle& bsh);
79 
80  virtual TLines GetDescription(bool root = false) const;
81  virtual wxColour GetTextColor() const { return m_Color; }
82  virtual wxColour GetFrameColor() const { return m_Color; }
83  virtual const wxBrush& GetBackgroundBrush() const { return *wxWHITE_BRUSH; }
84  virtual const string& GetType() const;
85 
86  virtual const CObject* GetObject(void) const;
87  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
88 
89  objects::CBioseq_Handle GetBioseqHandle() const { return m_Bsh; }
90 private:
91  objects::CBioseq_Handle m_Bsh;
92  wxColour m_Color;
93 };
94 
96 {
97 public:
98  CDesktopBioseqsetItem(const objects::CBioseq_set_Handle& bssh);
100 
101  virtual TLines GetDescription(bool root = false) const;
102  virtual wxColour GetTextColor() const { return *wxBLUE; }
103  virtual wxColour GetFrameColor() const { return m_BkgdBrush.GetColour(); }
104  virtual const wxBrush& GetBackgroundBrush() const { return m_BkgdBrush; }
105  virtual const string& GetType() const;
106 
107  virtual const CObject* GetObject(void) const;
108  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
109 
110  objects::CBioseq_set_Handle GetBioseqsetHandle() const { return m_Bssh; }
111 private:
112  void x_SetBrush();
113 
114  objects::CBioseq_set_Handle m_Bssh;
115  wxBrush m_BkgdBrush;
116 };
117 
119 {
120 public:
121  CDesktopSeqSubmitItem(const objects::CSeq_submit& submit, objects::CScope& scope)
122  : m_Submit(ConstRef(&submit)), m_Scope(&scope) {}
124 
125  virtual TLines GetDescription(bool root = false) const;
126  virtual wxColour GetTextColor() const { return *wxBLUE; }
127  virtual wxColour GetFrameColor() const { return *wxBLUE; }
128  virtual const wxBrush& GetBackgroundBrush() const { return *wxWHITE_BRUSH; }
129  virtual const string& GetType() const;
130 
131  virtual const CObject* GetObject(void) const;
132  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
133 
134  const objects::CSeq_submit& GetSeqSubmit() const { return m_Submit.GetObject(); }
135 private:
138 };
139 
141 {
142 public:
143  CDesktopContactInfoItem(const objects::CSeq_submit& submit, const objects::CContact_info& contact, objects::CScope& scope)
144  : m_Submit(ConstRef(&submit)), m_Contact(ConstRef(&contact)), m_Scope(&scope) {}
146 
147  virtual TLines GetDescription(bool root = false) const;
148  virtual wxColour GetTextColor() const { return *wxBLACK; }
149  virtual wxColour GetFrameColor() const { return *wxWHITE; }
150  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
151  virtual const string& GetType() const;
152 
153  virtual const CObject* GetObject(void) const;
154  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
155 
156  const objects::CSubmit_block& GetSubmitBlock() const;
157  const objects::CContact_info& GetContactInfo() const { return m_Contact.GetObject(); }
158 
159 private:
163 };
164 
166 {
167 public:
168  CDesktopCitSubItem(const objects::CSeq_submit& submit, const objects::CCit_sub& sub, objects::CScope& scope)
169  : m_Submit(ConstRef(&submit)), m_CitSub(ConstRef(&sub)), m_Scope(&scope) {}
171 
172  virtual TLines GetDescription(bool root = false) const;
173  virtual wxColour GetTextColor() const { return *wxBLACK; }
174  virtual wxColour GetFrameColor() const { return *wxWHITE; }
175  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
176  virtual const string& GetType() const;
177 
178  virtual const CObject* GetObject(void) const;
179  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
180 
181  const objects::CSubmit_block& GetSubmitBlock() const;
182  const objects::CCit_sub& GetCitSub() const { return m_CitSub.GetObject(); }
183 
184 private:
188 };
189 
191 {
192 public:
193  CDesktopSeqdescItem(const objects::CSeqdesc& desc, const objects::CSeq_entry_Handle& seh)
194  : m_Seqdesc(ConstRef(&desc)), m_Seh(seh) {}
196 
197  virtual TLines GetDescription(bool root = false) const;
198  virtual wxColour GetTextColor() const { return *wxBLACK; }
199  virtual wxColour GetFrameColor() const { return *wxWHITE; }
200  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
201  virtual const string& GetType() const;
202  virtual bool ShouldBeReduced() const { return true; }
203  virtual const CObject* GetObject(void) const;
204  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const { return m_Seh; }
205 
206  const objects::CSeqdesc& GetSeqdesc() const { return m_Seqdesc.GetObject(); }
207 
208  static TLines s_GetDescription(const objects::CUser_object& user_obj);
209  static TLines s_GetDescription(const objects::COrg_ref& org);
210  static TLines s_GetDescription(const objects::CSeqdesc::TModif& modif);
211 private:
213  objects::CSeq_entry_Handle m_Seh;
214 };
215 
217 {
218 public:
219  CDesktopAnnotItem(const objects::CSeq_annot_Handle& annoth);
221 
222  virtual TLines GetDescription(bool root = false) const;
223  virtual wxColour GetTextColor() const { return m_Colour; }
224  virtual wxColour GetFrameColor() const { return m_Colour; }
225  virtual const wxBrush& GetBackgroundBrush() const { return *wxWHITE_BRUSH; }
226  virtual const string& GetType() const;
227  virtual const CObject* GetObject(void) const;
228  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
229 
230  objects::CSeq_annot_Handle GetAnnotHandle() const { return m_Annoth; }
231 private:
232  objects::CSeq_annot_Handle m_Annoth;
233  wxColour m_Colour;
234 };
235 
237 {
238 public:
239  CDesktopFeatItem(const objects::CSeq_feat_Handle& fh)
240  : m_Feath(fh) {}
242 
243  virtual TLines GetDescription(bool root = false) const;
244  virtual wxColour GetTextColor() const { return *wxBLUE; }
245  virtual wxColour GetFrameColor() const { return *wxBLUE; }
246  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
247  virtual const string& GetType() const;
248  virtual bool ShouldBeReduced() const { return true; }
249 
250  virtual const CObject* GetObject(void) const;
251  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
252 
253  objects::CSeq_feat_Handle GetFeatHandle() const { return m_Feath; }
254 
255  static const string& s_GetProteinName(const objects::CSeq_feat_Handle& fh);
256 private:
257  mutable objects::CSeq_feat_Handle m_Feath;
258 };
259 
261 {
262 public:
263  CDesktopAlignItem(const objects::CSeq_align_Handle& ah);
265 
266  virtual TLines GetDescription(bool root = false) const;
267  virtual wxColour GetTextColor() const { return m_Colour; }
268  virtual wxColour GetFrameColor() const { return m_Colour; }
269  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
270  virtual const string& GetType() const;
271  virtual bool ShouldBeReduced() const { return true; }
272 
273  virtual const CObject* GetObject(void) const;
274  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
275 
276  objects::CSeq_align_Handle GetAlignHandle() const { return m_Alignh; }
277 
278  static bool s_ContainsFarPointers(const objects::CSeq_align_Handle& ah);
279 private:
280  objects::CSeq_align_Handle m_Alignh;
281  wxColour m_Colour;
282 };
283 
285 {
286 public:
287  CDesktopGraphItem(const objects::CSeq_graph_Handle& gh)
288  : m_Graphh(gh) {}
290 
291  virtual TLines GetDescription(bool root = false) const;
292  virtual wxColour GetTextColor() const { return *wxBLUE; }
293  virtual wxColour GetFrameColor() const { return *wxBLUE; }
294  virtual const wxBrush& GetBackgroundBrush() const { return wxNullBrush; }
295  virtual const string& GetType() const;
296  virtual bool ShouldBeReduced() const { return true; }
297 
298  virtual const CObject* GetObject(void) const;
299  virtual objects::CSeq_entry_Handle GetSeqentryHandle() const;
300 
301  objects::CSeq_graph_Handle GetGraphHandle() const { return m_Graphh; }
302 private:
303  objects::CSeq_graph_Handle m_Graphh;
304 };
305 
306 
308 
309 #endif
310  // GUI_WIDGETS_SEQ_DESKTOP___DESKTOP_TYPED_ITEMS__HPP
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
virtual bool ShouldBeReduced() const
objects::CSeq_align_Handle GetAlignHandle() const
objects::CSeq_align_Handle m_Alignh
virtual wxColour GetFrameColor() const
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetTextColor() const
objects::CSeq_annot_Handle GetAnnotHandle() const
objects::CSeq_annot_Handle m_Annoth
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetTextColor() const
virtual wxColour GetFrameColor() const
objects::CBioseq_Handle GetBioseqHandle() const
virtual wxColour GetTextColor() const
objects::CBioseq_Handle m_Bsh
virtual wxColour GetFrameColor() const
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetTextColor() const
objects::CBioseq_set_Handle GetBioseqsetHandle() const
virtual wxColour GetFrameColor() const
virtual const wxBrush & GetBackgroundBrush() const
objects::CBioseq_set_Handle m_Bssh
const objects::CCit_sub & GetCitSub() const
CConstRef< objects::CCit_sub > m_CitSub
CRef< objects::CScope > m_Scope
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetTextColor() const
CConstRef< objects::CSeq_submit > m_Submit
CDesktopCitSubItem(const objects::CSeq_submit &submit, const objects::CCit_sub &sub, objects::CScope &scope)
virtual wxColour GetFrameColor() const
virtual wxColour GetFrameColor() const
CDesktopContactInfoItem(const objects::CSeq_submit &submit, const objects::CContact_info &contact, objects::CScope &scope)
CConstRef< objects::CSeq_submit > m_Submit
CConstRef< objects::CContact_info > m_Contact
const objects::CContact_info & GetContactInfo() const
virtual wxColour GetTextColor() const
CRef< objects::CScope > m_Scope
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetFrameColor() const
CDesktopFeatItem(const objects::CSeq_feat_Handle &fh)
virtual wxColour GetTextColor() const
virtual const wxBrush & GetBackgroundBrush() const
objects::CSeq_feat_Handle m_Feath
virtual bool ShouldBeReduced() const
objects::CSeq_feat_Handle GetFeatHandle() const
virtual wxColour GetTextColor() const
virtual bool ShouldBeReduced() const
CDesktopGraphItem(const objects::CSeq_graph_Handle &gh)
objects::CSeq_graph_Handle GetGraphHandle() const
virtual const wxBrush & GetBackgroundBrush() const
virtual wxColour GetFrameColor() const
objects::CSeq_graph_Handle m_Graphh
virtual wxColour GetFrameColor() const
CDesktopSeqSubmitItem(const objects::CSeq_submit &submit, objects::CScope &scope)
CRef< objects::CScope > m_Scope
virtual wxColour GetTextColor() const
virtual const wxBrush & GetBackgroundBrush() const
CConstRef< objects::CSeq_submit > m_Submit
const objects::CSeq_submit & GetSeqSubmit() const
virtual const wxBrush & GetBackgroundBrush() const
CDesktopSeqdescItem(const objects::CSeqdesc &desc, const objects::CSeq_entry_Handle &seh)
static TLines s_GetDescription(const objects::COrg_ref &org)
objects::CSeq_entry_Handle m_Seh
CConstRef< objects::CSeqdesc > m_Seqdesc
virtual wxColour GetTextColor() const
virtual objects::CSeq_entry_Handle GetSeqentryHandle() const
const objects::CSeqdesc & GetSeqdesc() const
virtual bool ShouldBeReduced() const
virtual wxColour GetFrameColor() const
static TLines s_GetDescription(const objects::CUser_object &user_obj)
static TLines s_GetDescription(const objects::CSeqdesc::TModif &modif)
CObject –.
Definition: ncbiobj.hpp:180
virtual const CObject * GetObject(void) const =0
virtual wxColour GetTextColor() const =0
virtual objects::CSeq_entry_Handle GetSeqentryHandle() const =0
virtual const wxBrush & GetBackgroundBrush() const =0
virtual const string & GetType() const
virtual TLines GetDescription(bool root=false) const =0
virtual wxColour GetFrameColor() const =0
vector< string > TLines
virtual bool ShouldBeReduced() const
Include a standard set of the NCBI C++ Toolkit most basic headers.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIWIDGETS_DESKTOP_EXPORT
Definition: gui_export.h:542
Defines to provide correct exporting from DLLs in Windows.
static string s_GetProteinName(const CBioseq_Handle &handle, CScope &scope, CConstRef< CSeq_loc > &cds_loc, TGetTitleFlags flags)
Definition: seqtitle.cpp:1188
Modified on Wed Jun 19 17:04:52 2024 by modify_doxy.py rev. 669887