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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_WX___UI_TOOL__HPP
2 #define GUI_WIDGETS_WX___UI_TOOL__HPP
3 
4 /* $Id: ui_tool.hpp 25706 2012-04-25 00:21:04Z voronov $
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: Andrey Yazhuk
30  *
31  * File Description: Defines base interfaces and classes
32  * (i.e. for Alignment Scoring Methods).
33  *
34  */
35 
36 #include <corelib/ncbistd.hpp>
37 
38 #include <gui/gui_export.h>
39 
40 class wxWindow;
41 
43 
44 class CDialog;
45 class CMenuItem;
46 class CNcbiRegistry;
47 
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// IUITool represents an abstract algorithm that is bound to a UI component.
51 /// IUITool has a unique Name that identifies the algorithm and Description that
52 /// can contain provide detailed information. Both Name and Description are
53 /// supposed to be human-readable so that they can be used in UI.
54 /// IUITool serves as a base class for the hierarchy of interfaces representing
55 /// various types of algorithms such as alignment scoring methods, functions
56 /// calculated along the sequence, search methods etc.
57 
59 {
60 public:
61  virtual ~IUITool() {};
62 
63  // creates a copy
64  virtual IUITool* Clone() const = 0;
65 
66  /// returns unique name of the method that is used in UI to identify it
67  virtual string GetName() const = 0;
68 
69  /// returns a detailed description of the method that is used in UI
70  virtual string GetDescription() const = 0;
71 };
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// ITemplateUITool
76 {
77 public:
78  virtual ~ITemplateUITool();
79 
80  /// loads only descriptive information
81  virtual bool LoadInfo(CNcbiRegistry& reg) = 0;
82 
83  // loads all information
84  virtual bool Load(CNcbiRegistry& reg);
85 
86  /// @name Edit interface
87  /// @{
88  virtual void SetName(const string& s) = 0;
89  virtual void SetDescription(const string& s) = 0;
90 
91  /// saves only descriptive information
92  virtual bool SaveInfo(CNcbiRegistry& reg) = 0;
93 
94  // saves all information
95  virtual bool Save(CNcbiRegistry& reg);
96  /// @}
97 };
98 
99 ////////////////////////////////////////////////////////////////////////////////
100 /// IUIToolWithGUI - represents a method that can be integrated in GUI.
102 {
103 public:
104  virtual ~IUIToolWithGUI() {}
105 
106  /// Returns a pointer to the submenu. If the pointer is not NULL, then this
107  /// submenu is integrated into the application's menu. If method is derived
108  /// from CCommandTarget it will recieve command events.
109  virtual const CMenuItem* GetMenu() = 0;
110 
111  /// returns true if the method supports properties dialog
112  virtual bool HasPropertiesPanel() const = 0;
113 
114  /// This a factory method that shall produce a CPropertiesPanel
115  /// representing properties of the method; the panel Apply() must take care
116  /// of appying changes to the method.
117  virtual wxWindow* CreatePropertiesPanel(wxWindow* parent) = 0;
118 };
119 
121 
122 #endif // GUI_WIDGETS_WX___UI_TOOL__HPP
CDialog.
Definition: dialog.hpp:47
CMenuItem - represents a menu items in IMenu-style menus.
Definition: menu_item.hpp:53
CNcbiRegistry –.
Definition: ncbireg.hpp:913
ITemplateUITool.
Definition: ui_tool.hpp:76
virtual bool SaveInfo(CNcbiRegistry &reg)=0
saves only descriptive information
virtual bool LoadInfo(CNcbiRegistry &reg)=0
loads only descriptive information
virtual void SetName(const string &s)=0
virtual void SetDescription(const string &s)=0
IUIToolWithGUI - represents a method that can be integrated in GUI.
Definition: ui_tool.hpp:102
virtual bool HasPropertiesPanel() const =0
returns true if the method supports properties dialog
virtual ~IUIToolWithGUI()
Definition: ui_tool.hpp:104
virtual wxWindow * CreatePropertiesPanel(wxWindow *parent)=0
This a factory method that shall produce a CPropertiesPanel representing properties of the method; th...
virtual const CMenuItem * GetMenu()=0
Returns a pointer to the submenu.
IUITool represents an abstract algorithm that is bound to a UI component.
Definition: ui_tool.hpp:59
virtual IUITool * Clone() const =0
virtual string GetDescription() const =0
returns a detailed description of the method that is used in UI
virtual ~IUITool()
Definition: ui_tool.hpp:61
virtual string GetName() const =0
returns unique name of the method that is used in UI to identify it
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 NCBI_GUIWIDGETS_WX_EXPORT
Definition: gui_export.h:543
Defines to provide correct exporting from DLLs in Windows.
Modified on Mon May 20 04:58:54 2024 by modify_doxy.py rev. 669887