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

#include "editfunctions.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a EditFunctionsBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
EditFunctionsBase::EditFunctionsBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "EditFunctionsBase" );
    setSizeGripEnabled( true );
    EditFunctionsBaseLayout = new TQVBoxLayout( this, 11, 6, "EditFunctionsBaseLayout"); 

    functionListView = new TQListView( this, "functionListView" );
    functionListView->addColumn( tr( "Function" ) );
    functionListView->addColumn( tr( "Return Type" ) );
    functionListView->addColumn( tr( "Specifier" ) );
    functionListView->addColumn( tr( "Access" ) );
    functionListView->addColumn( tr( "Type" ) );
    functionListView->addColumn( tr( "In Use" ) );
    functionListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, functionListView->sizePolicy().hasHeightForWidth() ) );
    functionListView->setFrameShape( TQListView::StyledPanel );
    functionListView->setFrameShadow( TQListView::Sunken );
    functionListView->setAllColumnsShowFocus( true );
    functionListView->setShowSortIndicator( true );
    EditFunctionsBaseLayout->addWidget( functionListView );

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

    showOnlySlots = new TQCheckBox( this, "showOnlySlots" );
    showOnlySlots->setFocusPolicy( TQCheckBox::StrongFocus );
    Layout11->addWidget( showOnlySlots );
    Vertical_Spacing1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout11->addItem( Vertical_Spacing1 );

    addFunction = new TQPushButton( this, "addFunction" );
    Layout11->addWidget( addFunction );

    deleteFunction = new TQPushButton( this, "deleteFunction" );
    Layout11->addWidget( deleteFunction );
    EditFunctionsBaseLayout->addLayout( Layout11 );

    boxProperties = new TQGroupBox( this, "boxProperties" );
    boxProperties->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, boxProperties->sizePolicy().hasHeightForWidth() ) );
    boxProperties->setColumnLayout(0, TQt::Vertical );
    boxProperties->layout()->setSpacing( 6 );
    boxProperties->layout()->setMargin( 11 );
    boxPropertiesLayout = new TQVBoxLayout( boxProperties->layout() );
    boxPropertiesLayout->setAlignment( TQt::AlignTop );

    Layout14 = new TQVBoxLayout( 0, 0, 6, "Layout14"); 

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

    Label8 = new TQLabel( boxProperties, "Label8" );
    Label8->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    Layout5->addWidget( Label8 );

    functionName = new TQLineEdit( boxProperties, "functionName" );
    functionName->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, functionName->sizePolicy().hasHeightForWidth() ) );
    Layout5->addWidget( functionName );

    labelType = new TQLabel( boxProperties, "labelType" );
    labelType->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    Layout5->addWidget( labelType );

    editType = new TQLineEdit( boxProperties, "editType" );
    editType->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, editType->sizePolicy().hasHeightForWidth() ) );
    Layout5->addWidget( editType );
    Layout14->addLayout( Layout5 );
    Spacer6_2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    Layout14->addItem( Spacer6_2 );

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

    Label9_2 = new TQLabel( boxProperties, "Label9_2" );
    Label9_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    Layout13->addWidget( Label9_2 );

    functionSpecifier = new TQComboBox( false, boxProperties, "functionSpecifier" );
    functionSpecifier->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, functionSpecifier->sizePolicy().hasHeightForWidth() ) );
    Layout13->addWidget( functionSpecifier );

    TextLabel1 = new TQLabel( boxProperties, "TextLabel1" );
    TextLabel1->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    Layout13->addWidget( TextLabel1 );

    functionAccess = new TQComboBox( false, boxProperties, "functionAccess" );
    functionAccess->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, functionAccess->sizePolicy().hasHeightForWidth() ) );
    Layout13->addWidget( functionAccess );

    TextLabel1_2 = new TQLabel( boxProperties, "TextLabel1_2" );
    TextLabel1_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    Layout13->addWidget( TextLabel1_2 );

    functionType = new TQComboBox( false, boxProperties, "functionType" );
    Layout13->addWidget( functionType );
    Spacer5 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout13->addItem( Spacer5 );
    Layout14->addLayout( Layout13 );
    boxPropertiesLayout->addLayout( Layout14 );
    EditFunctionsBaseLayout->addWidget( boxProperties );

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

    helpButton = new TQPushButton( this, "helpButton" );
    helpButton->setAutoDefault( true );
    Layout1->addWidget( helpButton );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    okButton = new TQPushButton( this, "okButton" );
    okButton->setAutoDefault( true );
    okButton->setDefault( true );
    Layout1->addWidget( okButton );

    cancelButton = new TQPushButton( this, "cancelButton" );
    cancelButton->setAutoDefault( true );
    Layout1->addWidget( cancelButton );
    EditFunctionsBaseLayout->addLayout( Layout1 );
    languageChange();
    resize( TQSize(600, 371).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( deleteFunction, TQ_SIGNAL( clicked() ), this, TQ_SLOT( functionRemove() ) );
    connect( addFunction, TQ_SIGNAL( clicked() ), this, TQ_SLOT( functionAdd() ) );
    connect( functionName, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( currentTextChanged(const TQString&) ) );
    connect( functionListView, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( currentItemChanged(TQListViewItem*) ) );
    connect( functionListView, TQ_SIGNAL( currentChanged(TQListViewItem*) ), this, TQ_SLOT( currentItemChanged(TQListViewItem*) ) );
    connect( editType, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( currentReturnTypeChanged(const TQString&) ) );
    connect( functionSpecifier, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( currentSpecifierChanged(const TQString&) ) );
    connect( functionAccess, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( currentAccessChanged(const TQString&) ) );
    connect( functionType, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( currentTypeChanged(const TQString&) ) );
    connect( showOnlySlots, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( displaySlots(bool) ) );

    // tab order
    setTabOrder( functionName, editType );
    setTabOrder( editType, functionSpecifier );
    setTabOrder( functionSpecifier, functionAccess );
    setTabOrder( functionAccess, functionType );
    setTabOrder( functionType, helpButton );
    setTabOrder( helpButton, okButton );
    setTabOrder( okButton, cancelButton );
    setTabOrder( cancelButton, functionListView );
    setTabOrder( functionListView, showOnlySlots );
    setTabOrder( showOnlySlots, addFunction );
    setTabOrder( addFunction, deleteFunction );

    // buddies
    Label8->setBuddy( functionName );
    labelType->setBuddy( editType );
    Label9_2->setBuddy( functionSpecifier );
    TextLabel1->setBuddy( functionAccess );
    TextLabel1_2->setBuddy( functionType );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EditFunctionsBase::languageChange()
{
    setCaption( tr( "Edit Functions" ) );
    TQWhatsThis::add( this, tr( "<b>Edit Functions</b><p>Add, edit or delete the current form's slots or functions.</p><p>Click the <b>Add Function</b>-button to create a new function; enter a name, choose an access mode and specify if it should be a slot or normal function.</p><p>Select an entry from the list and click the <b>Delete Function</b>-button to remove a function; in case of a slot all connections using this slot will also be removed.</p>" ) );
    functionListView->header()->setLabel( 0, tr( "Function" ) );
    functionListView->header()->setLabel( 1, tr( "Return Type" ) );
    functionListView->header()->setLabel( 2, tr( "Specifier" ) );
    functionListView->header()->setLabel( 3, tr( "Access" ) );
    functionListView->header()->setLabel( 4, tr( "Type" ) );
    functionListView->header()->setLabel( 5, tr( "In Use" ) );
    TQWhatsThis::add( functionListView, tr( "<b>This form's functions.</b><p>Select the function you want to change or delete.</p>" ) );
    showOnlySlots->setText( tr( "Only d&isplay slots" ) );
    TQToolTip::add( showOnlySlots, tr( "Change displaying mode for functions" ) );
    TQWhatsThis::add( showOnlySlots, tr( "<b>Check this button if only the slots should be displayed</b><p>Otherwise all functions, i.e. normal C++ functions and slots are displayed.</p>\n"
"" ) );
    addFunction->setText( tr( "&New Function" ) );
    TQToolTip::add( addFunction, tr( "Add new function" ) );
    TQWhatsThis::add( addFunction, tr( "<b>Add a new function.</b><p>New functions have a default name and public access.</p>" ) );
    deleteFunction->setText( tr( "&Delete Function" ) );
    TQToolTip::add( deleteFunction, tr( "Delete function" ) );
    TQWhatsThis::add( deleteFunction, tr( "<b>Delete the selected function.</b><p>All connections using this function are also removed.</p>" ) );
    boxProperties->setTitle( tr( "Function Properties" ) );
    Label8->setText( tr( "&Function:" ) );
    TQToolTip::add( functionName, tr( "Change function name" ) );
    TQWhatsThis::add( functionName, tr( "<b>Change the name of the selected function.</b><p>The name should include the argument list and must be syntactically correct.</p>" ) );
    labelType->setText( tr( "&Return type:" ) );
    TQToolTip::add( editType, tr( "Change the return type of the function" ) );
    TQWhatsThis::add( editType, tr( "<b>Change the return type of the selected function.</b><p>Specifiy here the datatype which should be returned by the function.</p>" ) );
    Label9_2->setText( tr( "S&pecifier:" ) );
    functionSpecifier->clear();
    functionSpecifier->insertItem( tr( "non virtual" ) );
    functionSpecifier->insertItem( tr( "virtual" ) );
    functionSpecifier->insertItem( tr( "pure virtual" ) );
    functionSpecifier->insertItem( tr( "static" ) );
    TQToolTip::add( functionSpecifier, tr( "Change function access" ) );
    TQWhatsThis::add( functionSpecifier, tr( "<b>Change the access policy of the function</b><p>All functions are created virtual and should be reimplemented in subclasses.</p>" ) );
    TextLabel1->setText( tr( "&Access:" ) );
    functionAccess->clear();
    functionAccess->insertItem( tr( "public" ) );
    functionAccess->insertItem( tr( "protected" ) );
    functionAccess->insertItem( tr( "private" ) );
    TQToolTip::add( functionAccess, tr( "Change function access" ) );
    TQWhatsThis::add( functionAccess, tr( "<b>Change the access policy of the function</b><p>All functions are created virtual and should be reimplemented in subclasses.</p>" ) );
    TextLabel1_2->setText( tr( "&Type:" ) );
    functionType->clear();
    functionType->insertItem( tr( "slot" ) );
    functionType->insertItem( tr( "function" ) );
    TQToolTip::add( functionType, tr( "Change function type" ) );
    TQWhatsThis::add( functionType, tr( "<b>Change the type of the function.</b><p>The type specifies if the function is either a slot or a normal C++ function.</p>" ) );
    helpButton->setText( tr( "&Help" ) );
    okButton->setText( tr( "&OK" ) );
    TQWhatsThis::add( okButton, tr( "Close the dialog and apply all the changes." ) );
    cancelButton->setText( tr( "&Cancel" ) );
    TQWhatsThis::add( cancelButton, tr( "Close the dialog and discard any changes." ) );
}

void EditFunctionsBase::currentItemChanged(TQListViewItem*)
{
    tqWarning( "EditFunctionsBase::currentItemChanged(TQListViewItem*): Not implemented yet" );
}

void EditFunctionsBase::currentSpecifierChanged(const TQString&)
{
    tqWarning( "EditFunctionsBase::currentSpecifierChanged(const TQString&): Not implemented yet" );
}

void EditFunctionsBase::currentTextChanged(const TQString&)
{
    tqWarning( "EditFunctionsBase::currentTextChanged(const TQString&): Not implemented yet" );
}

void EditFunctionsBase::currentReturnTypeChanged(const TQString&)
{
    tqWarning( "EditFunctionsBase::currentReturnTypeChanged(const TQString&): Not implemented yet" );
}

void EditFunctionsBase::destroy()
{
}

void EditFunctionsBase::init()
{
}

void EditFunctionsBase::currentAccessChanged(const TQString&)
{
    tqWarning( "EditFunctionsBase::currentAccessChanged(const TQString&): Not implemented yet" );
}

void EditFunctionsBase::currentTypeChanged(const TQString&)
{
    tqWarning( "EditFunctionsBase::currentTypeChanged(const TQString&): Not implemented yet" );
}

void EditFunctionsBase::okClicked()
{
    tqWarning( "EditFunctionsBase::okClicked(): Not implemented yet" );
}

void EditFunctionsBase::functionAdd()
{
    tqWarning( "EditFunctionsBase::functionAdd(): Not implemented yet" );
}

void EditFunctionsBase::functionRemove()
{
    tqWarning( "EditFunctionsBase::functionRemove(): Not implemented yet" );
}

void EditFunctionsBase::displaySlots(bool)
{
    tqWarning( "EditFunctionsBase::displaySlots(bool): Not implemented yet" );
}

