libyui-ncurses  2.44.1
/usr/src/RPM/BUILD/libyui-ncurses-2.44.1/src/NCPopupInfo.h
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:       NCPopupInfo.h
00020 
00021    Author:     Gabriele Strattner <gs@suse.de>
00022 
00023 /-*/
00024 
00025 #ifndef NCPopupInfo_h
00026 #define NCPopupInfo_h
00027 
00028 #include <iosfwd>
00029 
00030 #include <vector>
00031 #include <string>
00032 
00033 #include "NCPopup.h"
00034 #include "NCComboBox.h"
00035 #include "NCLabel.h"
00036 #include "NCRichText.h"
00037 #include "NCCheckBox.h"
00038 #include "NCPushButton.h"
00039 #include "NCi18n.h"
00040 
00041 
00042 /*
00043   Textdomain "ncurses"
00044  */
00045 
00046 
00047 
00048 class NCPopupInfo : public NCPopup
00049 {
00050 private:
00051 
00052     NCPopupInfo & operator=( const NCPopupInfo & );
00053     NCPopupInfo( const NCPopupInfo & );
00054 
00055 
00056     NCRichText * helpText;
00057     NCPushButton * okButton;
00058     NCPushButton * cancelButton;
00059 
00060     int hDim;
00061     int vDim;
00062     bool visible;
00063 
00064 protected:
00065 
00066     virtual bool postAgain();
00067 
00068     virtual NCursesEvent wHandleInput( wint_t ch );
00069 
00070 public:
00071 
00072     NCPopupInfo( const wpos at,
00073                  const std::string & headline,
00074                  const std::string & text,
00075                  // the label of an OK button
00076                  std::string okButtonLabel = _( "&OK" ),
00077                  std::string cancelButtonLabel = "" );
00078 
00079     virtual ~NCPopupInfo();
00080 
00081     virtual int preferredWidth();
00082     virtual int preferredHeight();
00083 
00084     void createLayout( const std::string & headline,
00085                        const std::string & text,
00086                        std::string okButtonLabel,
00087                        std::string cancelButtonLabel );
00088 
00089     NCursesEvent & showInfoPopup( );
00090 
00091     void popup();
00092 
00093     void popdown();
00094 
00095     bool isVisible() { return visible; }
00096 
00097     void setPreferredSize( int horiz, int vert ) { hDim = horiz; vDim = vert; }
00098 
00099     void focusOkButton() { okButton->setKeyboardFocus(); }
00100 
00101     void focusCancelButton() { cancelButton->setKeyboardFocus(); }
00102 
00103 };
00104 
00105 
00106 
00107 #endif // NCPopupInfo_h
 All Classes Functions Variables