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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___MACRO_ITEM_CONSTRAINT_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___MACRO_ITEM_CONSTRAINT_PANEL__HPP
3 /* $Id: macro_item_constraint_panel.hpp 46866 2021-11-16 22:59:56Z asztalos $
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: Igor Filippov
29  *
30  * File Description:
31  *
32  */
33 
34 #include <corelib/ncbistd.hpp>
36 
37 
39 
40 /// Denotes the type of panel that is used to create macro constraint
42 {
56 };
57 
59 {
60  string m_Label; ///< description of the constraint as it is listed in the macro editor
61  string m_Constraint; ///< constraint expression, e.g., Strand() = "plus"
62  vector<string> m_Variables; ///< variables used in the constraint
63  string m_Fieldname; ///< fieldname referred in the constraint
64  vector<CFuncWithArgs> m_FuncInfo; ///< interpreted functions with their arguments
66 
68  : m_MatcherType(panel_type) {}
69 };
70 
72 
73 
75 {
76 public:
78 
79  virtual pair<string, string> GetMatcher(const pair<string, string>& target, size_t num) = 0;
80  virtual void SetMatcher(const vector<CFuncWithArgs>& func_info) {}
81  virtual vector<CFuncWithArgs> GetFuncWithArgs(const pair<string, string>& target, size_t num) const { return {}; }
82 
83  virtual void SetFieldName(const string& field) {}
84 
85  virtual void PopulateFeatureListbox(objects::CSeq_entry_Handle seh) {}
86  virtual void SetFieldNames(const vector<string>& field_names) {}
87 
88  virtual void GetVars(vector<string> &vars, size_t num) {}
89  virtual string GetQualName(const pair<string, string>& target) {return kEmptyStr;}
90 
92 private:
93  /// Map between constraint macro function and panel type(s)
95 };
96 
98 
99 #endif // GUI_WIDGETS_EDIT___MACRO_ITEM_CONSTRAINT_PANEL__HPP
Class to store one function as it appears in the macro and its arguments (as GUI fieldnames)
virtual void GetVars(vector< string > &vars, size_t num)
virtual void PopulateFeatureListbox(objects::CSeq_entry_Handle seh)
virtual string GetQualName(const pair< string, string > &target)
virtual vector< CFuncWithArgs > GetFuncWithArgs(const pair< string, string > &target, size_t num) const
static map< string, vector< EMMatcherPanelType > > sm_FunctionToPanelMap
Map between constraint macro function and panel type(s)
virtual pair< string, string > GetMatcher(const pair< string, string > &target, size_t num)=0
virtual void SetFieldName(const string &field)
virtual void SetFieldNames(const vector< string > &field_names)
static const EMMatcherPanelType s_GetMatcherPanels(const CFuncWithArgs &func_info)
virtual void SetMatcher(const vector< CFuncWithArgs > &func_info)
Definition: map.hpp:338
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
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
CNcbiOstream & operator<<(CNcbiOstream &ostrm, const SMacroConstraint &constraint)
EMMatcherPanelType
Denotes the type of panel that is used to create macro constraint.
SMacroConstraint(EMMatcherPanelType panel_type)
vector< CFuncWithArgs > m_FuncInfo
interpreted functions with their arguments
string m_Fieldname
fieldname referred in the constraint
vector< string > m_Variables
variables used in the constraint
EMMatcherPanelType m_MatcherType
string m_Constraint
constraint expression, e.g., Strand() = "plus"
string m_Label
description of the constraint as it is listed in the macro editor
Modified on Sun Jul 21 04:12:53 2024 by modify_doxy.py rev. 669887