Optika GUI Toolik  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Optika_GUI.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Optika: A Tool For Developing Parameter Obtaining GUIs
5 // Copyright (2009) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, with Sandia Corporation, the
8 // U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Kurtis Nusbaum (klnusbaum@gmail.com)
38 //
39 // ***********************************************************************
40 // @HEADER
41 #ifndef OPTIKA_GUI_HPP_
42 #define OPTIKA_GUI_HPP_
43 
44 #include "Optika_metawindow.hpp"
45 
52 namespace Optika{
53 
55 
56 
70  void getInput(
71  RCP<ParameterList> validParameters,
72  RCP<DependencySheet> dependencySheet=null,
73  void (*customFunc)(RCP<const ParameterList>)=NULL);
74 
88  void getInput(
89  const std::string& nameOfXmlFile,
90  RCP<ParameterList>& userInput,
91  void (*customFunc)(RCP<const ParameterList>)=NULL);
92 
111  RCP<ParameterList> validParameters,
112  RCP<DependencySheet> dependencySheet=null,
113  std::string styleSheetFilePath = "",
114  std::string iconFilePath = "",
115  void (*customFunc)(RCP<const ParameterList>)=NULL);
116 
135  const std::string& nameOfXmlFile,
136  RCP<ParameterList>& userInput,
137  std::string styleSheetFilePath = "",
138  std::string iconFilePath = "",
139  void (*customFunc)(RCP<const ParameterList>)=NULL);
140 
141 
143 
147 class OptikaGUI{
148 public:
151 
162  OptikaGUI(
163  RCP<ParameterList> validParameters,
165  void (*customFunc)(RCP<const ParameterList>)=NULL);
166 
174  OptikaGUI(const std::string& xmlFileName,
175  void (*customFunc)(RCP<const ParameterList>)=NULL);
176 
178 
180 
181 
185  void exec();
186 
188 
190 
191 
197  void setAboutInfo(const std::string& aboutInfo);
198 
204  void setActionButtonText(const std::string& text);
205 
212  void setWindowTitle(const std::string& title);
213 
220  void setWindowIcon(const std::string& filePath);
221 
228  void setStyleSheet(const std::string& filePath);
229 
238 
244  std::string getWindowTitle();
245 
253  std::string getWindowIcon();
254 
262  std::string getStyleSheet();
263 
269  std::string getAboutInfo();
270 
272 
273 private:
276 
281 
286 
290  std::string title;
291 
295  std::string iconFilePath;
296 
300  std::string styleSheetFilePath;
301 
305  std::string aboutInfo;
306 
310  std::string actionButtonText;
311 
316 
318 };
319 
320 }
321 
322 #endif //OPTIKA_GUI_HPP_
void setActionButtonText(const std::string &text)
Sets the text in the "action" button".
Definition: Optika_GUI.cpp:237
std::string styleSheetFilePath
File path to the QT style sheet to be used for the GUI.
Definition: Optika_GUI.hpp:300
std::string getAboutInfo()
Gets the information to be added to the about dialog of the GUI.
Definition: Optika_GUI.cpp:253
std::string aboutInfo
Information to be added to the about dialog of the GUI.
Definition: Optika_GUI.hpp:305
A class that allows the user to create and customize their Optika GUI.
Definition: Optika_GUI.hpp:147
void(* customFunc)(RCP< const ParameterList >)
The custom function to be run whenever the user clicks the action button.
Definition: Optika_GUI.hpp:315
std::string getStyleSheet()
Gets the file path describing the location of the file being used as the QT Style Sheet...
Definition: Optika_GUI.cpp:249
void setCustomFunction(void(*customFunc)(RCP< const ParameterList >))
Sets the custom function to be used in the GUI. When ever the user clicks the action button...
Definition: Optika_GUI.cpp:229
void getInput(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet, void(*customFunc)(RCP< const ParameterList >))
Retreives the input for a Teuchos Parameter List using a GUI. Note the Parameter List will be edited...
Definition: Optika_GUI.cpp:47
RCP< DependencySheet > dependencySheet
A sheet listing any dependencies between parameters in the validParameters.
Definition: Optika_GUI.hpp:285
void setWindowIcon(const std::string &filePath)
Sets the window icon to the image specified in the filePath.
Definition: Optika_GUI.cpp:221
std::string getWindowTitle()
Gets the window title.
Definition: Optika_GUI.cpp:241
std::string actionButtonText
Text to display in the action button.
Definition: Optika_GUI.hpp:310
std::string title
A string containing the window title.
Definition: Optika_GUI.hpp:290
void setStyleSheet(const std::string &filePath)
Sets the QT style sheet that should be used for the GUI.
Definition: Optika_GUI.cpp:225
void getInputExtraOptions(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet, std::string styleSheetFilePath, std::string iconFilePath, void(*customFunc)(RCP< const ParameterList >))
Retreives the input for a Teuchos Parameter List using a GUI. Note the Parameter List will be edited...
Definition: Optika_GUI.cpp:81
RCP< ParameterList > validParameters
A list of parameters from which the users may specify values.
Definition: Optika_GUI.hpp:280
void setWindowTitle(const std::string &title)
Sets the title of the GUI window that is displayed to the user.
Definition: Optika_GUI.cpp:217
OptikaGUI(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet=null, void(*customFunc)(RCP< const ParameterList >)=NULL)
Constructs an OptikaGUI object.
Definition: Optika_GUI.cpp:159
The main window users interact with along with a small search widget used in the main window...
void exec()
Runs the GUI and gets the user input.
Definition: Optika_GUI.cpp:177
void setAboutInfo(const std::string &aboutInfo)
Adds the information specified to the about dialog of the GUI.
Definition: Optika_GUI.cpp:233
std::string getWindowIcon()
Gets the file path describing the location of the file being used for the window icon.
Definition: Optika_GUI.cpp:245
std::string iconFilePath
File path to the image that should be used as the window icon.
Definition: Optika_GUI.hpp:295