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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___FIELD_NAME_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___FIELD_NAME_PANEL__HPP
3 /* $Id: field_name_panel.hpp 42321 2019-01-31 21:06:40Z filippov $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Colleen Bollin
29  */
30 
31 #include <corelib/ncbistd.hpp>
34 
35 #include <wx/panel.h>
36 
38 
40 public:
41  virtual void UpdateEditor() = 0;
42  virtual ~CFieldNamePanelParent() {};
43 };
44 
45 
46 /*!
47  * CFieldNamePanel class declaration
48  */
49 
51 {
52 public:
53  /// Constructors
55 
56  /// Destructor
58  ///Returns the name of the field as selected in the panel.
59  ///In case of names composed of multiple words, for example, feature_name + qualifier
60  ///when the subfield parameter is true, the qualifier name is returned only.
61  virtual string GetFieldName(const bool subfield = false) = 0;
62  virtual bool SetFieldName(const string& field) = 0;
63  virtual vector<string> GetChoices(bool& allow_other);
64  virtual vector<string> GetMacroValues();
65  virtual void ClearValues(void) {}
66  virtual void SetShowLegalOnly(bool show) {}
67 
68  virtual string GetMacroFieldName(const string &target, const string& selected_field = kEmptyStr){return kEmptyStr;}
69  virtual string GetMacroFieldLabel(const string& target, const string& selected_field = kEmptyStr) {return kEmptyStr;}
70  enum EFieldType {
71  eFieldType_Unknown = 0,
93  eFieldType_Taxname
94  };
95 
96  static string GetFieldTypeName(EFieldType field_type);
97  static EFieldType GetFieldTypeFromName(const string & field_type_name);
98  static bool IsFeature(const string& target);
99  static bool IsDescriptor(const string& target);
100 
101 protected:
102  void x_UpdateParent(void);
103  bool x_IsParentAECRDlg(void);
104  void x_UpdateAECRDlgLayout(void);
105  // returns true if the CStringConstraintPanel should be smaller in the parent dialog
106  bool x_ShouldDecreaseStrConstrPanel(void);
107 };
108 
109 
111 
112 #endif
113  // GUI_WIDGETS_EDIT___FIELD_NAME_PANEL__HPP
virtual void UpdateEditor()=0
virtual string GetFieldName(const bool subfield=false)=0
Returns the name of the field as selected in the panel.
virtual void SetShowLegalOnly(bool show)
virtual string GetMacroFieldName(const string &target, const string &selected_field=kEmptyStr)
virtual bool SetFieldName(const string &field)=0
virtual string GetMacroFieldLabel(const string &target, const string &selected_field=kEmptyStr)
CFieldNamePanel()
Constructors.
~CFieldNamePanel()
Destructor.
virtual void ClearValues(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#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_EDIT_EXPORT
Definition: gui_export.h:526
Modified on Tue Apr 16 20:13:35 2024 by modify_doxy.py rev. 669887