File indexing completed on 2024-03-24 04:05:23

0001 //
0002 // C++ Interface: cmxpconsole
0003 //
0004 // Description: 
0005 //
0006 /*
0007 Copyright 2004-2011 Tomas Mecir <kmuddy@kmuddy.com>
0008 
0009 This program is free software; you can redistribute it and/or
0010 modify it under the terms of the GNU General Public License as
0011 published by the Free Software Foundation; either version 2 of 
0012 the License, or (at your option) any later version.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #ifndef CMXPCONSOLE_H
0024 #define CMXPCONSOLE_H
0025 
0026 #include <qobject.h>
0027 
0028 #include <config-mxp.h>
0029 
0030 class QDockWidget;
0031 class dlgMXPConsole;
0032 
0033 /**
0034 This class manages the MXP console dialog box.
0035 
0036 It follows the Singleton pattern.
0037 
0038 @author Tomas Mecir
0039 */
0040 class cMXPConsole : public QObject
0041 {
0042 Q_OBJECT
0043 public:
0044 
0045 #ifdef HAVE_MXP
0046   
0047   /** destructor */
0048   ~cMXPConsole ();
0049   static cMXPConsole *self ();
0050   QDockWidget *dialog ();
0051 
0052 #endif  //HAVE_MXP
0053 
0054 public slots:   //slots need to be defined at all occassions, otherwise MOC would have problems
0055   void addError (int sess, const QString &text);
0056   void addWarning (int sess, const QString &text);
0057 
0058 #ifdef HAVE_MXP
0059 
0060 protected:
0061   /** constructor */
0062   cMXPConsole ();
0063   /** create the dialog */
0064   void createDialog ();
0065   dlgMXPConsole *dlgmxpconsole;
0066   
0067   static cMXPConsole *_self;
0068 
0069 #endif  //HAVE_MXP
0070 
0071 };
0072 
0073 #endif