ROOT logo
// @(#)root/qt:$Id: TQtRootSlot.h 27630 2009-02-26 19:06:42Z brun $
// Author: Valery Fine      18/01/2007

** $Id: TQtRootSlot.h 27630 2009-02-26 19:06:42Z brun $
** Copyright (C) 2007 by Valeri Fine. Brookhaven National Laboratory.
**                                    All rights reserved.
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
// The TQRootSlot singleton class introduces the global SLOT to invoke
// the  ROOT command line from the GUI signals
// Optionally one can execute TApplication::Terminate method directly
// It provides a Qt slot to attach the the CINT C++ interpreter 
// to any Qt signal
// To execute any C++ statement from the GUI oen should connect 
// his/her Qt signal with the Qt slot of the global instance of this class

#ifndef ROOT_TQRootSlot
#define ROOT_TQRootSlot

#ifndef __CINT__
#include <qobject.h>
class QObject;
#define Q_OBJECT
#define slots

class QString;

class TQtRootSlot : public QObject {
   TQtRootSlot (const TQtRootSlot &);
   void operator=(const TQtRootSlot &);
   static TQtRootSlot *fgTQtRootSlot;
   TQtRootSlot () {} 
   static TQtRootSlot *CintSlot();
   virtual ~TQtRootSlot() {}
public slots:
   void ProcessLine(const char *);
   void ProcessLine(const QString &);
   void Terminate(int status) const;
   void Terminate()           const;
   void TerminateAndQuit()    const;

#ifndef __CINT__
   void Error(int error);

bool QConnectCint(const QObject *sender, const char *signal);
bool QConnectTerminate( const QObject *sender, const char *signal);