Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GUIComponentWithOutput.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLQt/src/ICLQt/GUIComponentWithOutput.h               **
00010 ** Module : ICLQt                                                  **
00011 ** Authors: Christof Elbrechter                                    **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once 
00032 
00033 #include <ICLUtils/CompatMacros.h>
00034 #include <ICLQt/GUIComponent.h>
00035 
00036 namespace icl{
00037   namespace qt{
00038   
00039     struct GUIComponentWithOutput : public GUIComponent{
00040       GUIComponentWithOutput(const std::string &type, const std::string &params):
00041       GUIComponent(type,params){}
00042   
00044       const GUIComponentWithOutput &handle(const std::string &handle) const{
00045         m_options.handle = handle; return *this;
00046       }
00047   
00049       const GUIComponentWithOutput &label(const std::string &label) const{
00050         m_options.label = label; return *this;
00051       }
00052   
00054       const GUIComponentWithOutput &tooltip(const std::string &tooltip) const{
00055         m_options.tooltip = tooltip; return *this;
00056       }
00057   
00059       const GUIComponentWithOutput &size(const utils::Size &size) const {
00060         m_options.size = size; return *this;
00061       }
00062   
00064       const GUIComponentWithOutput &size(int w, int h) const {
00065         return size(utils::Size(w,h));
00066       }
00067   
00069       const GUIComponentWithOutput &minSize(const utils::Size &minSize) const {
00070         m_options.minSize = minSize; return *this;
00071       }
00072         
00074       const GUIComponentWithOutput &minSize(int w, int h) const {
00075         return minSize(utils::Size(w,h));
00076       }
00077       
00079       const GUIComponentWithOutput &maxSize(const utils::Size &maxSize) const {
00080         m_options.maxSize = maxSize; return *this;
00081       }
00082   
00084       const GUIComponentWithOutput &maxSize(int w, int h) const {
00085         return maxSize(utils::Size(w,h));
00086       }
00087   
00089 
00090       const GUIComponentWithOutput &hideIf(bool flag) const{
00091         if(flag) m_options.hide = true; return *this;
00092       }
00093   
00095       const GUIComponentWithOutput &out(const std::string &name) const {
00096         m_options.out = name; return *this;
00097       }
00098   
00100       GUIComponentWithOutput &handle(std::string &handle) {
00101         m_options.handle = handle; return *this;
00102       }
00103       
00105       GUIComponentWithOutput &label(std::string &label) {
00106         m_options.label = label; return *this;
00107       }
00108       
00110       GUIComponentWithOutput &tooltip(std::string &tooltip) {
00111         m_options.tooltip = tooltip; return *this;
00112       }
00113       
00115       GUIComponentWithOutput &size(utils::Size &size)  {
00116         m_options.size = size; return *this;
00117       }
00118       
00120       GUIComponentWithOutput &size(int w, int h)  {
00121         m_options.size = utils::Size(w,h); return *this;
00122       }
00123       
00125       GUIComponentWithOutput &minSize(utils::Size &minSize)  {
00126         m_options.minSize = minSize; return *this;
00127       }
00128   
00130       GUIComponentWithOutput &minSize(int w, int h)  {
00131         m_options.minSize = utils::Size(w,h); return *this;
00132       }
00133       
00135       GUIComponentWithOutput &maxSize(utils::Size &maxSize)  {
00136         m_options.maxSize = maxSize; return *this;
00137       }
00138       
00140       GUIComponentWithOutput &maxSize(int w, int h)  {
00141         m_options.maxSize = utils::Size(w,h); return *this;
00142       }
00143   
00145 
00146       GUIComponentWithOutput &hideIf(bool flag)  {
00147         if(flag) m_options.hide = true; return *this;
00148       }
00149   
00151       GUIComponentWithOutput &out(const std::string &name){
00152         m_options.out = name; return *this;
00153       }
00154   
00155     };
00156   
00157   } // namespace qt
00158 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines