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

Go to the SVN repository for this file.

1 /* $Id: subprep_panel.hpp 37342 2016-12-27 18:02:05Z katargir $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 #ifndef _SUBPREP_PANEL_H_
29 #define _SUBPREP_PANEL_H_
30 
31 #include <corelib/ncbistd.hpp>
33 #include <objmgr/seqdesc_ci.hpp>
34 
45 #include <objmgr/seqdesc_ci.hpp>
46 
49 
50 /*!
51  * Includes
52  */
53 
54 #include <wx/hyperlink.h>
55 #include <wx/scrolwin.h>
56 #include <wx/textctrl.h>
57 #include <wx/choice.h>
58 #include <wx/sizer.h>
59 #include <wx/stattext.h>
60 #include <wx/notebook.h>
61 #include <wx/button.h>
62 
63 /*!
64  * Forward declarations
65  */
66 class wxChoice;
67 
68 
69 ////@begin forward declarations
70 class wxNotebook;
71 class wxBoxSizer;
72 ////@end forward declarations
73 
75 
76 class CSrcQual;
78 class ICommandProccessor;
79 class CSubPrepIntroPanel;
81 
82 /*!
83  * Control identifiers
84  */
85 
86 ////@begin control identifiers
87 #define SYMBOL_CSUBPREP_PANEL_STYLE wxTAB_TRAVERSAL
88 #define SYMBOL_CSUBPREP_PANEL_TITLE _("Submission Preparation Tool")
89 #define SYMBOL_CSUBPREP_PANEL_IDNAME ID_CSUBPREP_PANEL
90 #define SYMBOL_CSUBPREP_PANEL_SIZE wxDefaultSize
91 #define SYMBOL_CSUBPREP_PANEL_POSITION wxDefaultPosition
92 ////@end control identifiers
93 
94 #define ID_MOLTYPE_CHOICE 10100
95 #define ID_TOPOLOGY_CHOICE 10101
96 #define ID_SET_CHOICE 10104
97 #define ID_BULK_MOLINFO_EDIT 10203
98 
99 const string kReleaseDateConfirmed = "Release Date confirmed";
100 
101 
102 /*!
103  * CSubPrep_panel class declaration
104  */
105 
106 class CSubPrep_panel: public wxScrolledWindow, public CEventHandler
107 {
108  DECLARE_DYNAMIC_CLASS( CSubPrep_panel )
109  DECLARE_EVENT_TABLE()
110 
111 public:
112  /// Constructors
113  CSubPrep_panel();
114  CSubPrep_panel( wxWindow* parent, wxWindowID id = SYMBOL_CSUBPREP_PANEL_IDNAME, const wxPoint& pos = SYMBOL_CSUBPREP_PANEL_POSITION, const wxSize& size = SYMBOL_CSUBPREP_PANEL_SIZE, long style = SYMBOL_CSUBPREP_PANEL_STYLE );
115 
116  /// Creation
117  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CSUBPREP_PANEL_IDNAME, const wxPoint& pos = SYMBOL_CSUBPREP_PANEL_POSITION, const wxSize& size = SYMBOL_CSUBPREP_PANEL_SIZE, long style = SYMBOL_CSUBPREP_PANEL_STYLE );
118 
119  /// Destructor
120  ~CSubPrep_panel();
121 
122  /// Initialises member variables
123  void Init();
124 
125  /// Creates the controls and sizers
126  void CreateControls();
127 
128  virtual bool Layout();
129 
131 
132  /// Transfer data to the window
133  virtual bool TransferDataToWindow();
134 
135  /// @name IRegSettings interface implementation
136  virtual void LoadSettings();
137  virtual void SaveSettings() const;
138  /// @}
139 
140 ////@begin CSubPrep_panel event handler declarations
141 
142  /// wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK
143  void OnNotebookPageChanged( wxNotebookEvent& event );
144 
145  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON17
146  void OnButton17Click( wxCommandEvent& event );
147 
148  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_SEQUENCE_BTN
149  void OnAddSequenceBtnClick( wxCommandEvent& event );
150 
151  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_REORDER_SEQ
152  void OnReorderSeqClick( wxCommandEvent& event );
153 
154  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON16
155  void OnRemoveSequencesClick( wxCommandEvent& event );
156 
157  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13
158  void OnClickVectorTrim( wxCommandEvent& event );
159 
160  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PREV_BTN
161  void OnPrevBtnClick( wxCommandEvent& event );
162 
163  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_NEXT_BTN
164  void OnNextBtnClick( wxCommandEvent& event );
165 
166  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLATFILE
167  void OnFlatfileClick( wxCommandEvent& event );
168 
169  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOOKUP_TAXONOMY
170  void OnLookupTaxonomyClick( wxCommandEvent& event );
171 
172  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_VALIDATE
173  void OnValidateClick( wxCommandEvent& event );
174 
175  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_BTN
176  void OnSaveBtnClick( wxCommandEvent& event );
177 
178  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_START_NEW
179  void OnStartNewClick( wxCommandEvent& event );
180 
181 ////@end CSubPrep_panel event handler declarations
182 
183  void OnChangeSet( wxCommandEvent& event );
184 
185 ////@begin CSubPrep_panel member function declarations
186 
187  /// Retrieves bitmap resources
188  wxBitmap GetBitmapResource( const wxString& name );
189 
190  /// Retrieves icon resources
191  wxIcon GetIconResource( const wxString& name );
192 ////@end CSubPrep_panel member function declarations
193 
195 
196  /// Should we show tooltips?
197  static bool ShowToolTips();
198 
199 ////@begin CSubPrep_panel member variables
200  wxStaticText* m_Status;
201  wxNotebook* m_Book;
202  wxStaticText* m_SequenceCount;
205  wxButton* m_VectorTrimBtn;
206  wxButton* m_PrevBtn;
207  wxButton* m_NextBtn;
208  wxBoxSizer* m_StarExplanation;
209  wxButton* m_FlatfileButton;
210  wxButton* m_TaxonomyButton;
211  wxButton* m_ValidateButton;
212  wxButton* m_StartNewBtn;
213  /// Control identifiers
214  enum {
216  ID_NOTEBOOK = 10092,
217  ID_BUTTON17 = 10119,
219  ID_REORDER_SEQ = 10098,
220  ID_BUTTON16 = 10083,
221  ID_BUTTON13 = 10076,
222  ID_PREV_BTN = 10102,
223  ID_NEXT_BTN = 10103,
224  ID_FLATFILE = 10101,
226  ID_VALIDATE = 10106,
227  ID_SAVE_BTN = 10082,
228  ID_START_NEW = 10110
229  };
230 ////@end CSubPrep_panel member variables
232 
233  void SetUndoManager(ICommandProccessor* cmdProccessor) { m_CmdProcessor = cmdProccessor; }
234  void SetWorkbench (IWorkbench* workbench) { m_Workbench = workbench; }
235 
236  typedef pair<CSourceRequirements::EWizardType, string> TWizardKeyword;
237  typedef vector<TWizardKeyword> TWizardKeywordList;
238 
239  void OnDataChange ();
240 
241  // for communication with subtabs
242  void SetSubmissionNotReady(string error);
244  objects::CSeqdesc_CI GetCitSubPub();
245  void UpdateSubmitBlock(CRef<objects::CSubmit_block> new_block, CRef<objects::CCit_gen> new_gen, string alt_email);
248  void SetSourceType(string src_type);
250  string GetWizardTypeField();
251  string GetWizardSrcTypeField();
253  void SetAltEmailAddress(string alt_email) { SetAlternateEmailAddress(m_TopSeqEntry, alt_email); };
254 
255 
256  void LaunchSeqTechEditor();
257  void ClearSeqTechValues();
258  bool OkToBulkEditSeqTech();
259  void LaunchSourceEditor();
260  void LaunchFeatureAdder();
263  void ImportFeatureTableFile ();
264  void HandleBulkCmdDlg (CBulkCmdDlg* dlg, string label = "");
265  void RemoveAllFeatures ();
266 
267  static string GetWizardTypeName (unsigned int wizard_type);
268  static CSourceRequirements::EWizardType GuessWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry);
269  static CSourceRequirements::EWizardType GetWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry);
270  // wizard user object functions
271  static string GetWizardFieldFromSeqEntry (objects::CSeq_entry_Handle entry, string field_name);
272  static CRef<CCmdComposite> SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value);
273 
274  string GetWizardField(string field_name) { return GetWizardFieldFromSeqEntry(m_TopSeqEntry, field_name);};
275  CRef<CCmdComposite> SetWizardField(string field_name, string value) { return SetWizardFieldInSeqEntry(m_TopSeqEntry, field_name, value);};
277 
278 private:
281 
283 
286 
287 
292  void x_CreateWizardExtras();
294 
298  void x_CreatePrimerOptions ();
299  void x_CreateCommentOptions (const string& comment_label);
300  void x_CreateChimeraOptions ();
303  void x_CreateDBLinkOptions ();
304  bool x_IsSequencingTechnologyRequired (objects::CSeq_entry_Handle entry, CSourceRequirements::EWizardType wizard_type);
305  void x_SetSubmissionStatus();
307  void x_SetNextPrevBtns();
308  void x_EnableSeqButtons();
310  void x_CheckValidation();
311 
313  vector<string> m_DBLinkFields;
314  vector<string> m_DBLinkUrls;
315  vector<bool> m_DBLinkRequired;
316 
318 
322 
324  void x_ConvertToSeqSubmit();
325 
326  string m_RegPath;
329  objects::CSeq_entry_Handle m_TopSeqEntry;
331 
337  wxString m_SaveFileDir;
338  wxString m_SaveFileName;
339 };
340 
341 
343 
344 #endif
345  // _SUBPREP_PANEL_H_
User-defined methods of the data storage class.
CEventHandler.
void OnButton17Click(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON17
static bool ShowToolTips()
Should we show tooltips?
string x_CheckSourceQuals(CSourceRequirements::EWizardType wizard_type)
CSubPrepIntroPanel * m_IntroPanel
CSubmissionPrepMainPanel * m_MainPanel
static string GetWizardTypeName(unsigned int wizard_type)
wxBoxSizer * m_StarExplanation
string GetWizardField(string field_name)
static string GetWizardFieldFromSeqEntry(objects::CSeq_entry_Handle entry, string field_name)
CRef< objects::CSubmit_block > GetSubmitBlock()
void SetWorkbench(IWorkbench *workbench)
wxStaticText * m_SequenceCount
CRef< objects::CSeq_table > x_BuildValuesTable()
void x_CreateGenomeOptions(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType src_type)
void OnStartNewClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_START_NEW
CRef< CCmdComposite > x_ClearWizardSpecificData(CSourceRequirements::EWizardType wizard_type)
void SetUndoManager(ICommandProccessor *cmdProccessor)
wxButton * m_ValidateButton
void x_UpdateSequenceCountLabel()
static CSourceRequirements::EWizardType GetWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< size_t > x_GetSequenceLengths(CRef< objects::CSeq_table > table)
void OnSaveBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_BTN
void ImportFeatureTableFile()
CRef< objects::CSeq_submit > m_SeqSubmit
void SetSubmissionNotReady(string error)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnRemoveSequencesClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON16
bool x_NeedTopology(CSourceRequirements::EWizardType wizard_type, CMolInfoTableCommandConverter *converter)
wxStaticText * m_Status
void OnAddSequenceBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_SEQUENCE_BTN
CSubPrep_panel()
Constructors.
string GetWizardTypeField()
bool OkToBulkEditSeqTech()
wxButton * m_VectorTrimBtn
bool Create(wxWindow *parent, wxWindowID id=ID_CSUBPREP_PANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
virtual void SaveSettings() const
void HandleBulkCmdDlg(CBulkCmdDlg *dlg, string label="")
void CreateControls()
Creates the controls and sizers.
void SetAltEmailAddress(string alt_email)
void x_ConvertToSeqSubmit()
objects::CSeqdesc_CI GetCitSubPub()
virtual void LoadSettings()
void x_SetSourceTypeOptionsForWizardType(CSourceRequirements::EWizardType wizard_type)
void OnLookupTaxonomyClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOOKUP_TAXONOMY
static CSourceRequirements::EWizardType GuessWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry)
pair< CSourceRequirements::EWizardType, string > TWizardKeyword
void OnNotebookPageChanged(wxNotebookEvent &event)
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK
wxButton * m_RemoveSequencesBtn
void OnPrevBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PREV_BTN
CSourceRequirements::EWizardSrcType x_GetWizardSrcTypeFromCtrls()
void OnFlatfileClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLATFILE
void x_RefreshSubmitterInfoStatus()
void SetObjects(TConstScopedObjects *objects)
bool IsSequencingTechnologyRequired(CSourceRequirements::EWizardType wizard_type)
void OnChangeSet(wxCommandEvent &event)
wxString m_SaveFileName
~CSubPrep_panel()
Destructor.
void x_CreateCommentOptions(const string &comment_label)
CTableCommandConverter * GetConverterForFieldName(string field_name)
wxButton * m_FlatfileButton
void x_LaunchVectorTrimEditor()
void OnClickVectorTrim(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13
void Init()
Initialises member variables.
void UpdateForSeqEntryChange()
void x_CreateDBLinkOptions()
static CRef< CCmdComposite > SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value)
void x_SetSubmissionStatus()
CSourceRequirements::EWizardType SetWizardType(CSourceRequirements::EWizardType wizard_type)
string GetWizardSrcTypeField()
TConstScopedObjects * m_InputObjects
void x_UpdateFeatureStatus(CSourceRequirements::EWizardType wizard_type)
CFeatureTableCommandConverter * x_GetMicrosatelliteTableConverter()
CRef< CCmdComposite > SetWizardField(string field_name, string value)
CRef< objects::CSeq_table > GetSeqTechTable()
vector< TWizardKeyword > TWizardKeywordList
wxButton * m_NextBtn
void x_CreatePrimerOptions()
void LaunchSeqTechEditor()
TWizardKeywordList m_WizardNames
bool x_IsSequencingTechnologyRequired(objects::CSeq_entry_Handle entry, CSourceRequirements::EWizardType wizard_type)
wxNotebook * m_Book
vector< bool > m_DBLinkRequired
virtual bool Layout()
vector< string > m_DBLinkUrls
void x_CreateChimeraOptions()
void SetSourceType(string src_type)
void OnNextBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_NEXT_BTN
virtual bool TransferDataToWindow()
Transfer data to the window.
wxButton * m_ReorderSequencesBtn
void x_CreateWizardExtras()
wxButton * m_TaxonomyButton
objects::CSeq_entry_Handle m_TopSeqEntry
void x_CreateMoleculeOptions(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType src_type)
wxString m_SaveFileDir
string GetAltEmailAddress()
string m_SubmissionErrors
void OnValidateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_VALIDATE
ICommandProccessor * m_CmdProcessor
TWizardKeywordList m_Keywords
vector< string > m_DBLinkFields
bool x_NeedUniqueMicrosatelliteNames()
wxButton * m_PrevBtn
void UpdateSubmitBlock(CRef< objects::CSubmit_block > new_block, CRef< objects::CCit_gen > new_gen, string alt_email)
IWorkbench * m_Workbench
wxButton * m_StartNewBtn
CSourceRequirements::EWizardType x_GetWizardTypeFromCtrl()
CSourceRequirements::EWizardType GetWizardType()
CSourceRequirements::EWizardSrcType x_GetWizardSrcTypefromSeqEntry(objects::CSeq_entry_Handle entry)
void x_SetSourceType(CSourceRequirements::EWizardSrcType src_type)
CSourceRequirements::EWizardSrcType GetWizardSrcType()
void OnReorderSeqClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_REORDER_SEQ
Undo/Redo interface for editing operations.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Include a standard set of the NCBI C++ Toolkit most basic headers.
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define SYMBOL_CSUBPREP_PANEL_STYLE
const string kReleaseDateConfirmed
#define SYMBOL_CSUBPREP_PANEL_IDNAME
#define SYMBOL_CSUBPREP_PANEL_POSITION
#define SYMBOL_CSUBPREP_PANEL_SIZE
string GetAlternateEmailAddress(objects::CSeq_entry_Handle entry)
void SetAlternateEmailAddress(objects::CSeq_entry_Handle entry, string alt_email)
Modified on Sat Jul 13 13:38:28 2024 by modify_doxy.py rev. 669887