]> Creatis software - bbtk.git/blob - kernel/src/bbtkQtBlackBox.h
e624bbef5b19ba81b99d08db1466279d8ef21be5
[bbtk.git] / kernel / src / bbtkQtBlackBox.h
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbtkQtBlackBox.h,v $
4   Language:  C++
5   Date:      $Date: 2009/05/28 14:22:10 $
6   Version:   $Revision: 1.2 $
7 ========================================================================*/
8
9
10 /* ---------------------------------------------------------------------
11
12 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
13 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 *
15 *  This software is governed by the CeCILL-B license under French law and 
16 *  abiding by the rules of distribution of free software. You can  use, 
17 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
18 *  license as circulated by CEA, CNRS and INRIA at the following URL 
19 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
20 *  or in the file LICENSE.txt.
21 *
22 *  As a counterpart to the access to the source code and  rights to copy,
23 *  modify and redistribute granted by the license, users are provided only
24 *  with a limited warranty  and the software's author,  the holder of the
25 *  economic rights,  and the successive licensors  have only  limited
26 *  liability. 
27 *
28 *  The fact that you are presently reading this means that you have had
29 *  knowledge of the CeCILL-B license and that you accept its terms.
30 * ------------------------------------------------------------------------ */                                                                         
31 /**
32  * \brief Short description in one line
33  * 
34  * Long description which 
35  * can span multiple lines
36  */
37 /**
38  * \file 
39  * \brief 
40  */
41 /**
42  * \class bbtk::
43  * \brief 
44  */
45 #ifndef __bbtkQtBlackBox_h_INCLUDED__
46 #define __bbtkQtBlackBox_h_INCLUDED__
47
48
49 #ifdef USE_QT
50
51
52 #include "bbtkWidgetBlackBox.h"
53
54
55 #include "bbtkQt.h"
56
57
58 //==================================================================
59 class QWidget;
60 //==================================================================
61
62
63 namespace bbtk
64 {
65
66
67
68
69
70   //==================================================================
71   /// Widget black boxes
72   class BBTK_EXPORT QtBlackBox : public bbtk::WidgetBlackBox<QWidget>
73   { 
74     BBTK_BLACK_BOX_INTERFACE(QtBlackBox,bbtk::WidgetBlackBox<QWidget>);
75   public:
76    //==================================================================    
77     /// Callback for creating a Dialog window (modal)
78     /// ** Must be defined ** in toolkit specific descendants 
79     virtual void bbCreateDialogWindow();
80     //==================================================================    
81
82     //==================================================================    
83     /// Callback for creating a Frame window 
84     /// ** Must be defined ** in toolkit specific descendants 
85     virtual void bbCreateFrameWindow();
86     //==================================================================    
87
88    //==================================================================    
89     QWidget* bbGetWindow() { return bbmWindow; }
90     void bbSetWindow(QWidget*) ;
91     bool bbWindowIsCreated() { return (bbGetWindow() != 0); }
92     //==================================================================    
93
94
95     //==================================================================    
96     virtual void bbShowWindow();
97     //==================================================================   
98  
99     //==================================================================    
100     virtual void bbDestroyWindow();
101     //==================================================================    
102
103   private:
104
105     QWidget* bbmWindow;
106     
107     //==================================================================
108     //    virtual void InitWindowManagerIfNeeded();
109     virtual void IncNbWindowsAlive();
110     virtual void DecNbWindowsAlive();
111     virtual int  GetNbWindowsAlive();
112     virtual bool IsSomeWindowAlive();
113     
114     virtual void IncNbWindowsShown();
115     virtual void DecNbWindowsShown();
116     virtual int  GetNbWindowsShown();
117     virtual bool IsSomeWindowShown();
118     //==================================================================
119
120   };
121   //=================================================================
122  
123
124  //=================================================================
125   // QtBlackBoxDescriptor declaration
126   //
127   class QtBlackBoxDescriptor : public WidgetBlackBoxDescriptor<QWidget>
128   BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(QtBlackBox);
129   BBTK_NAME("QtBlackBox");
130   BBTK_END_DESCRIBE_BLACK_BOX(QtBlackBox);
131   //=================================================================
132
133
134
135 } //namespace bbtk
136
137
138
139 #endif  // USE_QT
140 #endif  //__bbtkQtBlackBox_h__