/****************************************************************************
** Form implementation generated from reading ui file 'contactframeinterface.ui'
**
** Created: Tue Feb 4 20:37:40 2003
**      by: The User Interface Compiler ($Id: contactframeinterface.cpp,v 1.6 2005/07/13 14:49:43 codingdomain Exp $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "contactframeinterface.h"

#include <qvariant.h>
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

#include <klocale.h>

/* 
 *  Constructs a ContactFrameInterface as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 */
ContactFrameInterface::ContactFrameInterface( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "ContactFrameInterface" );

    mainLayout_ = new QVBoxLayout( this, 0, 0, "mainLayout_");

    statusLayout_ = new QHBoxLayout( 0, 0, 0, "statusLayout_");

    statusPixmapLabel_ = new QLabel( this, "statusPixmapLabel_" );
    statusPixmapLabel_->setMinimumSize( QSize( 20, 20 ) );
    statusPixmapLabel_->setMaximumSize( QSize( 20, 20 ) );
    //statusPixmapLabel_->setScaledContents( TRUE );
    statusLayout_->addWidget( statusPixmapLabel_ );

    statusLabel_ = new QLabel( this, "statusLabel_" );
    statusLabel_->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );
    statusLayout_->addWidget( statusLabel_ );
    mainLayout_->addLayout( statusLayout_ );

    centralLayout_ = new QGridLayout( 0, 1, 1, 0, 0, "centralLayout_");
    QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    centralLayout_->addItem( spacer, 0, 3 );
    QSpacerItem* spacer_2 = new QSpacerItem( 10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    centralLayout_->addItem( spacer_2, 0, 1 );

    emailButton_ = new QPushButton( this, "emailButton_" );
    emailButton_->setMinimumSize( QSize( 50, 50 ) );
    emailButton_->setMaximumSize( QSize( 50, 50 ) );

    centralLayout_->addWidget( emailButton_, 1, 2 );

    contactPixmapLabel_ = new QLabel( this, "contactPixmapLabel_" );
    contactPixmapLabel_->setScaledContents( FALSE );
    contactPixmapLabel_->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    centralLayout_->addMultiCellWidget( contactPixmapLabel_, 0, 1, 0, 0 );

    profileButton_ = new QPushButton( this, "profileButton_" );
    profileButton_->setMinimumSize( QSize( 50, 50 ) );
    profileButton_->setMaximumSize( QSize( 50, 50 ) );

    centralLayout_->addWidget( profileButton_, 0, 2 );
    mainLayout_->addLayout( centralLayout_ );

    handleLabel_ = new QLabel( this, "handleLabel_" );
    handleLabel_->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );
    mainLayout_->addWidget( handleLabel_ );

    messageTimeLabel_ = new QLabel( this, "messageTimeLabel_" );
    messageTimeLabel_->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );
    mainLayout_->addWidget( messageTimeLabel_ );

    line_ = new QFrame( this, "line_" );
    line_->setMinimumSize( QSize( 0, 16 ) );
    line_->setFrameShape( QFrame::HLine );
    line_->setFrameShadow( QFrame::Sunken );
    line_->setLineWidth( 3 );
    line_->setFrameShape( QFrame::HLine );
    mainLayout_->addWidget( line_ );

    languageChange();
    resize( QSize(600, 480).expandedTo(minimumSizeHint()) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ContactFrameInterface::languageChange()
{
    setCaption( QString::null );
    statusLabel_->setText( QString::null );
    emailButton_->setText( QString::null );
    QToolTip::add( emailButton_, i18n( "Send this person an email" ) );
    profileButton_->setText( QString::null );
    QToolTip::add( profileButton_, i18n( "Show this person's profile" ) );
    handleLabel_->setText( QString::null );
    messageTimeLabel_->setText( QString::null );
}


#include "contactframeinterface.moc"
