Image Component Library (ICL)
|
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.GPL ** 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 <ICLQt/GUIComponent.h> 00034 00035 namespace icl{ 00036 namespace qt{ 00037 00038 struct GUIComponentWithOutput : public GUIComponent{ 00039 GUIComponentWithOutput(const std::string &type, const std::string ¶ms): 00040 GUIComponent(type,params){} 00041 00043 const GUIComponentWithOutput &handle(const std::string &handle) const{ 00044 m_options.handle = handle; return *this; 00045 } 00046 00048 const GUIComponentWithOutput &label(const std::string &label) const{ 00049 m_options.label = label; return *this; 00050 } 00051 00053 const GUIComponentWithOutput &tooltip(const std::string &tooltip) const{ 00054 m_options.tooltip = tooltip; return *this; 00055 } 00056 00058 const GUIComponentWithOutput &size(const utils::Size &size) const { 00059 m_options.size = size; return *this; 00060 } 00061 00063 const GUIComponentWithOutput &size(int w, int h) const { 00064 return size(utils::Size(w,h)); 00065 } 00066 00068 const GUIComponentWithOutput &minSize(const utils::Size &minSize) const { 00069 m_options.minSize = minSize; return *this; 00070 } 00071 00073 const GUIComponentWithOutput &minSize(int w, int h) const { 00074 return minSize(utils::Size(w,h)); 00075 } 00076 00078 const GUIComponentWithOutput &maxSize(const utils::Size &maxSize) const { 00079 m_options.maxSize = maxSize; return *this; 00080 } 00081 00083 const GUIComponentWithOutput &maxSize(int w, int h) const { 00084 return maxSize(utils::Size(w,h)); 00085 } 00086 00088 00089 const GUIComponentWithOutput &hideIf(bool flag) const{ 00090 if(flag) m_options.hide = true; return *this; 00091 } 00092 00094 const GUIComponentWithOutput &out(const std::string &name) const { 00095 m_options.out = name; return *this; 00096 } 00097 00099 GUIComponentWithOutput &handle(std::string &handle) { 00100 m_options.handle = handle; return *this; 00101 } 00102 00104 GUIComponentWithOutput &label(std::string &label) { 00105 m_options.label = label; return *this; 00106 } 00107 00109 GUIComponentWithOutput &tooltip(std::string &tooltip) { 00110 m_options.tooltip = tooltip; return *this; 00111 } 00112 00114 GUIComponentWithOutput &size(utils::Size &size) { 00115 m_options.size = size; return *this; 00116 } 00117 00119 GUIComponentWithOutput &size(int w, int h) { 00120 m_options.size = utils::Size(w,h); return *this; 00121 } 00122 00124 GUIComponentWithOutput &minSize(utils::Size &minSize) { 00125 m_options.minSize = minSize; return *this; 00126 } 00127 00129 GUIComponentWithOutput &minSize(int w, int h) { 00130 m_options.minSize = utils::Size(w,h); return *this; 00131 } 00132 00134 GUIComponentWithOutput &maxSize(utils::Size &maxSize) { 00135 m_options.maxSize = maxSize; return *this; 00136 } 00137 00139 GUIComponentWithOutput &maxSize(int w, int h) { 00140 m_options.maxSize = utils::Size(w,h); return *this; 00141 } 00142 00144 00145 GUIComponentWithOutput &hideIf(bool flag) { 00146 if(flag) m_options.hide = true; return *this; 00147 } 00148 00150 GUIComponentWithOutput &out(const std::string &name){ 00151 m_options.out = name; return *this; 00152 } 00153 00154 }; 00155 00156 } // namespace qt 00157 }