#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'calltreelayout.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "calltreelayout.h"

#include <ntqvariant.h>
#include <graphwidget.h>
#include <treewidget.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqtoolbutton.h>
#include <ntqframe.h>
#include <ntqwidgetstack.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "graphwidget.h"
#include "treewidget.h"

/*
 *  Constructs a CallTreeLayout as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
CallTreeLayout::CallTreeLayout( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "CallTreeLayout" );
    CallTreeLayoutLayout = new TQVBoxLayout( this, 11, 6, "CallTreeLayoutLayout"); 

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 

    m_pViewGroup = new TQButtonGroup( this, "m_pViewGroup" );
    m_pViewGroup->setFrameShape( TQButtonGroup::NoFrame );
    m_pViewGroup->setLineWidth( 0 );
    m_pViewGroup->setExclusive( true );
    m_pViewGroup->setColumnLayout(0, TQt::Vertical );
    m_pViewGroup->layout()->setSpacing( 6 );
    m_pViewGroup->layout()->setMargin( 0 );
    m_pViewGroupLayout = new TQHBoxLayout( m_pViewGroup->layout() );
    m_pViewGroupLayout->setAlignment( TQt::AlignTop );

    m_pGraphButton = new TQToolButton( m_pViewGroup, "m_pGraphButton" );
    m_pGraphButton->setToggleButton( true );
    m_pGraphButton->setAutoRaise( true );
    m_pViewGroupLayout->addWidget( m_pGraphButton );

    m_pCalledButton = new TQToolButton( m_pViewGroup, "m_pCalledButton" );
    m_pCalledButton->setToggleButton( true );
    m_pCalledButton->setAutoRaise( true );
    m_pViewGroupLayout->addWidget( m_pCalledButton );

    m_pCallingButton = new TQToolButton( m_pViewGroup, "m_pCallingButton" );
    m_pCallingButton->setToggleButton( true );
    m_pCallingButton->setAutoRaise( true );
    m_pViewGroupLayout->addWidget( m_pCallingButton );
    layout2->addWidget( m_pViewGroup );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::VLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::VLine );
    layout2->addWidget( line1 );

    m_pGraphGroup = new TQButtonGroup( this, "m_pGraphGroup" );
    m_pGraphGroup->setFrameShape( TQButtonGroup::NoFrame );
    m_pGraphGroup->setLineWidth( 0 );
    m_pGraphGroup->setFlat( true );
    m_pGraphGroup->setColumnLayout(0, TQt::Vertical );
    m_pGraphGroup->layout()->setSpacing( 6 );
    m_pGraphGroup->layout()->setMargin( 0 );
    m_pGraphGroupLayout = new TQHBoxLayout( m_pGraphGroup->layout() );
    m_pGraphGroupLayout->setAlignment( TQt::AlignTop );

    m_pSaveButton = new TQToolButton( m_pGraphGroup, "m_pSaveButton" );
    m_pSaveButton->setAutoRaise( true );
    m_pGraphGroupLayout->addWidget( m_pSaveButton );

    m_pZoomInButton = new TQToolButton( m_pGraphGroup, "m_pZoomInButton" );
    m_pZoomInButton->setToggleButton( false );
    m_pZoomInButton->setAutoRaise( true );
    m_pGraphGroupLayout->addWidget( m_pZoomInButton );

    m_pZoomOutButton = new TQToolButton( m_pGraphGroup, "m_pZoomOutButton" );
    m_pZoomOutButton->setToggleButton( false );
    m_pZoomOutButton->setAutoRaise( true );
    m_pGraphGroupLayout->addWidget( m_pZoomOutButton );

    m_pRotateButton = new TQToolButton( m_pGraphGroup, "m_pRotateButton" );
    m_pRotateButton->setToggleButton( false );
    m_pRotateButton->setAutoRaise( true );
    m_pGraphGroupLayout->addWidget( m_pRotateButton );

    m_pPrefButton = new TQToolButton( m_pGraphGroup, "m_pPrefButton" );
    m_pPrefButton->setToggleButton( false );
    m_pPrefButton->setAutoRaise( true );
    m_pGraphGroupLayout->addWidget( m_pPrefButton );
    layout2->addWidget( m_pGraphGroup );
    spacer2 = new TQSpacerItem( 110, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer2 );
    CallTreeLayoutLayout->addLayout( layout2 );

    m_pStack = new TQWidgetStack( this, "m_pStack" );
    m_pStack->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, m_pStack->sizePolicy().hasHeightForWidth() ) );

    WStackPage = new TQWidget( m_pStack, "WStackPage" );
    WStackPageLayout = new TQVBoxLayout( WStackPage, 0, 6, "WStackPageLayout"); 

    m_pGraphWidget = new GraphWidget( WStackPage, "m_pGraphWidget" );
    WStackPageLayout->addWidget( m_pGraphWidget );
    m_pStack->addWidget( WStackPage, 0 );

    WStackPage_2 = new TQWidget( m_pStack, "WStackPage_2" );
    WStackPageLayout_2 = new TQVBoxLayout( WStackPage_2, 0, 6, "WStackPageLayout_2"); 

    m_pCalledWidget = new TreeWidget( WStackPage_2, "m_pCalledWidget" );
    WStackPageLayout_2->addWidget( m_pCalledWidget );
    m_pStack->addWidget( WStackPage_2, 1 );

    WStackPage_3 = new TQWidget( m_pStack, "WStackPage_3" );
    WStackPageLayout_3 = new TQVBoxLayout( WStackPage_3, 0, 6, "WStackPageLayout_3"); 

    m_pCallingWidget = new TreeWidget( WStackPage_3, "m_pCallingWidget" );
    WStackPageLayout_3->addWidget( m_pCallingWidget );
    m_pStack->addWidget( WStackPage_3, 2 );
    CallTreeLayoutLayout->addWidget( m_pStack );

    m_pHelpLabel = new TQLabel( this, "m_pHelpLabel" );
    CallTreeLayoutLayout->addWidget( m_pHelpLabel );
    languageChange();
    resize( TQSize(695, 578).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_pPrefButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotPrefClicked() ) );
    connect( m_pRotateButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotRotateClicked() ) );
    connect( m_pZoomOutButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotZoomOutClicked() ) );
    connect( m_pZoomInButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotZoomInClicked() ) );
    connect( m_pSaveButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotSaveClicked() ) );
    connect( m_pViewGroup, TQ_SIGNAL( clicked(int) ), this, TQ_SLOT( slotViewChanged(int) ) );
    connect( m_pViewGroup, TQ_SIGNAL( clicked(int) ), m_pStack, TQ_SLOT( raiseWidget(int) ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
CallTreeLayout::~CallTreeLayout()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CallTreeLayout::languageChange()
{
    setCaption( tr2i18n( "Call Graph" ) );
    m_pViewGroup->setTitle( TQString::null );
    m_pGraphButton->setText( tr2i18n( "..." ) );
    TQToolTip::add( m_pGraphButton, tr2i18n( "Call Graph" ) );
    m_pCalledButton->setText( tr2i18n( "..." ) );
    TQToolTip::add( m_pCalledButton, tr2i18n( "Called Functions Tree" ) );
    m_pCallingButton->setText( tr2i18n( "..." ) );
    TQToolTip::add( m_pCallingButton, tr2i18n( "Calling Functions Tree" ) );
    m_pGraphGroup->setTitle( TQString::null );
    m_pSaveButton->setText( tr2i18n( "a" ) );
    TQToolTip::add( m_pSaveButton, tr2i18n( "Save As..." ) );
    m_pZoomInButton->setText( tr2i18n( "a" ) );
    TQToolTip::add( m_pZoomInButton, tr2i18n( "Zoom In" ) );
    m_pZoomOutButton->setText( tr2i18n( "a" ) );
    TQToolTip::add( m_pZoomOutButton, tr2i18n( "Zoom Out" ) );
    m_pRotateButton->setText( tr2i18n( "a" ) );
    TQToolTip::add( m_pRotateButton, tr2i18n( "Rotate" ) );
    m_pPrefButton->setText( tr2i18n( "a" ) );
    TQToolTip::add( m_pPrefButton, tr2i18n( "Preferences" ) );
    m_pHelpLabel->setText( tr2i18n( "Help Message" ) );
}

void CallTreeLayout::slotSaveClicked()
{
    tqWarning( "CallTreeLayout::slotSaveClicked(): Not implemented yet" );
}

void CallTreeLayout::slotZoomInClicked()
{
    tqWarning( "CallTreeLayout::slotZoomInClicked(): Not implemented yet" );
}

void CallTreeLayout::slotZoomOutClicked()
{
    tqWarning( "CallTreeLayout::slotZoomOutClicked(): Not implemented yet" );
}

void CallTreeLayout::slotRotateClicked()
{
    tqWarning( "CallTreeLayout::slotRotateClicked(): Not implemented yet" );
}

void CallTreeLayout::slotViewChanged(int)
{
    tqWarning( "CallTreeLayout::slotViewChanged(int): Not implemented yet" );
}

void CallTreeLayout::slotViewChanged(TQWidget*)
{
    tqWarning( "CallTreeLayout::slotViewChanged(TQWidget*): Not implemented yet" );
}

void CallTreeLayout::slotPrefClicked()
{
    tqWarning( "CallTreeLayout::slotPrefClicked(): Not implemented yet" );
}

/****************************************************************************
** CallTreeLayout meta object code from reading C++ file 'calltreelayout.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "calltreelayout.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *CallTreeLayout::className() const
{
    return "CallTreeLayout";
}

TQMetaObject *CallTreeLayout::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_CallTreeLayout( "CallTreeLayout", &CallTreeLayout::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString CallTreeLayout::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "CallTreeLayout", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString CallTreeLayout::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "CallTreeLayout", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* CallTreeLayout::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"slotSaveClicked", 0, 0 };
    static const TQUMethod slot_2 = {"slotZoomInClicked", 0, 0 };
    static const TQUMethod slot_3 = {"slotZoomOutClicked", 0, 0 };
    static const TQUMethod slot_4 = {"slotRotateClicked", 0, 0 };
    static const TQUParameter param_slot_5[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_5 = {"slotViewChanged", 1, param_slot_5 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_ptr, "TQWidget", TQUParameter::In }
    };
    static const TQUMethod slot_6 = {"slotViewChanged", 1, param_slot_6 };
    static const TQUMethod slot_7 = {"slotPrefClicked", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotSaveClicked()", &slot_1, TQMetaData::Protected },
	{ "slotZoomInClicked()", &slot_2, TQMetaData::Protected },
	{ "slotZoomOutClicked()", &slot_3, TQMetaData::Protected },
	{ "slotRotateClicked()", &slot_4, TQMetaData::Protected },
	{ "slotViewChanged(int)", &slot_5, TQMetaData::Protected },
	{ "slotViewChanged(TQWidget*)", &slot_6, TQMetaData::Protected },
	{ "slotPrefClicked()", &slot_7, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"CallTreeLayout", parentObject,
	slot_tbl, 8,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_CallTreeLayout.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* CallTreeLayout::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "CallTreeLayout" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool CallTreeLayout::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotSaveClicked(); break;
    case 2: slotZoomInClicked(); break;
    case 3: slotZoomOutClicked(); break;
    case 4: slotRotateClicked(); break;
    case 5: slotViewChanged((int)static_QUType_int.get(_o+1)); break;
    case 6: slotViewChanged((TQWidget*)static_QUType_ptr.get(_o+1)); break;
    case 7: slotPrefClicked(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool CallTreeLayout::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool CallTreeLayout::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool CallTreeLayout::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
