00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: bbtkQtBlackBox.h,v $ 00004 Language: C++ 00005 Date: $Date: 2009/05/28 14:22:10 $ 00006 Version: $Revision: 1.2 $ 00007 ========================================================================*/ 00008 00009 00010 /* --------------------------------------------------------------------- 00011 00012 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00013 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 00014 * 00015 * This software is governed by the CeCILL-B license under French law and 00016 * abiding by the rules of distribution of free software. You can use, 00017 * modify and/ or redistribute the software under the terms of the CeCILL-B 00018 * license as circulated by CEA, CNRS and INRIA at the following URL 00019 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 00020 * or in the file LICENSE.txt. 00021 * 00022 * As a counterpart to the access to the source code and rights to copy, 00023 * modify and redistribute granted by the license, users are provided only 00024 * with a limited warranty and the software's author, the holder of the 00025 * economic rights, and the successive licensors have only limited 00026 * liability. 00027 * 00028 * The fact that you are presently reading this means that you have had 00029 * knowledge of the CeCILL-B license and that you accept its terms. 00030 * ------------------------------------------------------------------------ */ 00045 #ifndef __bbtkQtBlackBox_h_INCLUDED__ 00046 #define __bbtkQtBlackBox_h_INCLUDED__ 00047 00048 00049 #ifdef USE_QT 00050 00051 00052 #include "bbtkWidgetBlackBox.h" 00053 00054 00055 #include "bbtkQt.h" 00056 00057 00058 //================================================================== 00059 class QWidget; 00060 //================================================================== 00061 00062 00063 namespace bbtk 00064 { 00065 00066 00067 00068 00069 00070 //================================================================== 00072 class BBTK_EXPORT QtBlackBox : public bbtk::WidgetBlackBox<QWidget> 00073 { 00074 BBTK_BLACK_BOX_INTERFACE(QtBlackBox,bbtk::WidgetBlackBox<QWidget>); 00075 public: 00076 //================================================================== 00079 virtual void bbCreateDialogWindow(); 00080 //================================================================== 00081 00082 //================================================================== 00085 virtual void bbCreateFrameWindow(); 00086 //================================================================== 00087 00088 //================================================================== 00089 QWidget* bbGetWindow() { return bbmWindow; } 00090 void bbSetWindow(QWidget*) ; 00091 bool bbWindowIsCreated() { return (bbGetWindow() != 0); } 00092 //================================================================== 00093 00094 00095 //================================================================== 00096 virtual void bbShowWindow(); 00097 //================================================================== 00098 00099 //================================================================== 00100 virtual void bbDestroyWindow(); 00101 //================================================================== 00102 00103 private: 00104 00105 QWidget* bbmWindow; 00106 00107 //================================================================== 00108 // virtual void InitWindowManagerIfNeeded(); 00109 virtual void IncNbWindowsAlive(); 00110 virtual void DecNbWindowsAlive(); 00111 virtual int GetNbWindowsAlive(); 00112 virtual bool IsSomeWindowAlive(); 00113 00114 virtual void IncNbWindowsShown(); 00115 virtual void DecNbWindowsShown(); 00116 virtual int GetNbWindowsShown(); 00117 virtual bool IsSomeWindowShown(); 00118 //================================================================== 00119 00120 }; 00121 //================================================================= 00122 00123 00124 //================================================================= 00125 // QtBlackBoxDescriptor declaration 00126 // 00127 class QtBlackBoxDescriptor : public WidgetBlackBoxDescriptor<QWidget> 00128 BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(QtBlackBox); 00129 BBTK_NAME("QtBlackBox"); 00130 BBTK_END_DESCRIBE_BLACK_BOX(QtBlackBox); 00131 //================================================================= 00132 00133 00134 00135 } //namespace bbtk 00136 00137 00138 00139 #endif // USE_QT 00140 #endif //__bbtkQtBlackBox_h__