libyui
3.0.10
|
00001 /* 00002 Copyright (C) 2000-2012 Novell, Inc 00003 This library is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU Lesser General Public License as 00005 published by the Free Software Foundation; either version 2.1 of the 00006 License, or (at your option) version 3.0 of the License. This library 00007 is distributed in the hope that it will be useful, but WITHOUT ANY 00008 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00010 License for more details. You should have received a copy of the GNU 00011 Lesser General Public License along with this library; if not, write 00012 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00013 Floor, Boston, MA 02110-1301 USA 00014 */ 00015 00016 00017 /*-/ 00018 00019 File: YDialogSpy.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 00026 #ifndef YDialogSpy_h 00027 #define YDialogSpy_h 00028 00029 #include "ImplPtr.h" 00030 00031 class YWidget; 00032 class YDialog; 00033 class YDialogSpyPrivate; 00034 00035 00036 /** 00037 * An interactive dialog debugger: Show the structure and content of a dialog 00038 * and its widgets. 00039 * 00040 * This can be invoked by special key combinations: 00041 * Ctrl-Alt-Shift-Y in the Qt UI 00042 **/ 00043 class YDialogSpy 00044 { 00045 public: 00046 /** 00047 * Show a YDialogSpy for the specified dialog. 0 means "use the topmost 00048 * dialog". 00049 * This will return only when the user closes the YDialogSpy dialog. 00050 **/ 00051 static void showDialogSpy( YDialog * dialog = 0 ); 00052 00053 /** 00054 * Show the "Properties" sub-window. 00055 **/ 00056 void showProperties(); 00057 00058 /** 00059 * Hide the "Properties" sub-window. 00060 **/ 00061 void hideProperties(); 00062 00063 /** 00064 * Return 'true' if the "Properties" sub-window is currently shown, 00065 * 'false' if not. 00066 **/ 00067 bool propertiesShown() const; 00068 00069 protected: 00070 /** 00071 * Constructor: Create a YDialogSpy for the specified dialog. 0 means "use 00072 * the topmost dialog". 00073 * 00074 * In most cases it is more useful to use the static showDialogSpy() method 00075 * rather than create this dialog directly. 00076 **/ 00077 YDialogSpy( YDialog * dialog = 0 ); 00078 00079 /** 00080 * Destructor. 00081 **/ 00082 virtual ~YDialogSpy(); 00083 00084 /** 00085 * Execute the event loop. This will only return when the user closes the 00086 * YDialogSpy dialog. 00087 **/ 00088 void exec(); 00089 00090 /** 00091 * Show the properties of the specified widget if the "Properties" 00092 * sub-window is currently shown. 00093 **/ 00094 void showProperties( YWidget * widget ); 00095 00096 private: 00097 00098 ImplPtr<YDialogSpyPrivate> priv; 00099 }; 00100 00101 00102 #endif // YDialogSpy_h