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

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

#include "DocTreeView.h"

#include <ntqvariant.h>
#include <tdelistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "DocTreeView.ui.h"

/*
 *  Constructs a DocTreeView as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
DocTreeView::DocTreeView( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "DocTreeView" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( TQSize( 100, 200 ) );
    DocTreeViewLayout = new TQGridLayout( this, 1, 1, 2, 6, "DocTreeViewLayout"); 
    DocTreeViewLayout->setResizeMode( TQLayout::Minimum );

    listView = new TDEListView( this, "listView" );
    listView->addColumn( tr2i18n( "Chapter" ) );
    listView->header()->setClickEnabled( false, listView->header()->count() - 1 );
    listView->addColumn( tr2i18n( "Info" ) );
    listView->header()->setClickEnabled( false, listView->header()->count() - 1 );
    listView->addColumn( tr2i18n( "Page" ) );
    listView->header()->setClickEnabled( false, listView->header()->count() - 1 );
    listView->addColumn( tr2i18n( "Hidden" ) );
    listView->header()->setClickEnabled( false, listView->header()->count() - 1 );
    listView->header()->setResizeEnabled( false, listView->header()->count() - 1 );
    listView->setResizePolicy( TDEListView::Default );
    listView->setProperty( "selectionMode", "NoSelection" );
    listView->setRootIsDecorated( true );
    listView->setItemsMovable( false );

    DocTreeViewLayout->addWidget( listView, 0, 0 );
    languageChange();
    resize( TQSize(467, 331).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( listView, TQ_SIGNAL( clicked(TQListViewItem*) ), this, TQ_SLOT( slotItemClicked(TQListViewItem*) ) );
    connect( listView, TQ_SIGNAL( rightButtonPressed(TQListViewItem*,const TQPoint&,int) ), this, TQ_SLOT( slotRightButtonPressed(TQListViewItem*,const TQPoint&,int) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DocTreeView::languageChange()
{
    setCaption( tr2i18n( "Document Contents" ) );
    listView->header()->setLabel( 0, tr2i18n( "Chapter" ) );
    listView->header()->setLabel( 1, tr2i18n( "Info" ) );
    listView->header()->setLabel( 2, tr2i18n( "Page" ) );
    listView->header()->setLabel( 3, tr2i18n( "Hidden" ) );
}

/****************************************************************************
** DocTreeView meta object code from reading C++ file 'DocTreeView.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 "DocTreeView.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 *DocTreeView::className() const
{
    return "DocTreeView";
}

TQMetaObject *DocTreeView::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DocTreeView( "DocTreeView", &DocTreeView::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* DocTreeView::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 TQUParameter param_slot_0[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"slotItemClicked", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "i", &static_QUType_ptr, "TQListViewItem", TQUParameter::In },
	{ 0, &static_QUType_varptr, "\x0e", TQUParameter::In },
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"slotRightButtonPressed", 3, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQUMethod slot_3 = {"slotRenameItem", 0, 0 };
    static const TQUMethod slot_4 = {"slotDeleteItem", 0, 0 };
    static const TQUMethod slot_5 = {"slotNewBookInfo", 0, 0 };
    static const TQUMethod slot_6 = {"slotNewChapter", 0, 0 };
    static const TQUMethod slot_7 = {"slotNewKeywordSet", 0, 0 };
    static const TQUMethod slot_8 = {"slotNewKeyword", 0, 0 };
    static const TQUMethod slot_9 = {"slotNewAbstract", 0, 0 };
    static const TQUMethod slot_10 = {"slotNewAuthorGroup", 0, 0 };
    static const TQUMethod slot_11 = {"slotNewAuthor", 0, 0 };
    static const TQUMethod slot_12 = {"slotNewDate", 0, 0 };
    static const TQUMethod slot_13 = {"slotNewReleaseInfo", 0, 0 };
    static const TQUMethod slot_14 = {"slotNewTitle", 0, 0 };
    static const TQUMethod slot_15 = {"slotNewParagraph", 0, 0 };
    static const TQUMethod slot_16 = {"slotNewSection_1", 0, 0 };
    static const TQUMethod slot_17 = {"slotNewSection_2", 0, 0 };
    static const TQUMethod slot_18 = {"slotNewSection_3", 0, 0 };
    static const TQUMethod slot_19 = {"slotNewSection_4", 0, 0 };
    static const TQUMethod slot_20 = {"slotNewSection_5", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotItemClicked(TQListViewItem*)", &slot_0, TQMetaData::Public },
	{ "slotRightButtonPressed(TQListViewItem*,const TQPoint&,int)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected },
	{ "slotRenameItem()", &slot_3, TQMetaData::Protected },
	{ "slotDeleteItem()", &slot_4, TQMetaData::Protected },
	{ "slotNewBookInfo()", &slot_5, TQMetaData::Protected },
	{ "slotNewChapter()", &slot_6, TQMetaData::Protected },
	{ "slotNewKeywordSet()", &slot_7, TQMetaData::Protected },
	{ "slotNewKeyword()", &slot_8, TQMetaData::Protected },
	{ "slotNewAbstract()", &slot_9, TQMetaData::Protected },
	{ "slotNewAuthorGroup()", &slot_10, TQMetaData::Protected },
	{ "slotNewAuthor()", &slot_11, TQMetaData::Protected },
	{ "slotNewDate()", &slot_12, TQMetaData::Protected },
	{ "slotNewReleaseInfo()", &slot_13, TQMetaData::Protected },
	{ "slotNewTitle()", &slot_14, TQMetaData::Protected },
	{ "slotNewParagraph()", &slot_15, TQMetaData::Protected },
	{ "slotNewSection_1()", &slot_16, TQMetaData::Protected },
	{ "slotNewSection_2()", &slot_17, TQMetaData::Protected },
	{ "slotNewSection_3()", &slot_18, TQMetaData::Protected },
	{ "slotNewSection_4()", &slot_19, TQMetaData::Protected },
	{ "slotNewSection_5()", &slot_20, TQMetaData::Protected }
    };
    static const TQUParameter param_signal_0[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_0 = {"signalContentChanged", 1, param_signal_0 };
    static const TQUMethod signal_1 = {"signalAllNodesProcessed", 0, 0 };
    static const TQUParameter param_signal_2[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_2 = {"signalSetText", 1, param_signal_2 };
    static const TQUParameter param_signal_3[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod signal_3 = {"signalEnableTextedit", 1, param_signal_3 };
    static const TQUParameter param_signal_4[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In },
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_4 = {"signalNotifyBookmarkManager", 2, param_signal_4 };
    static const TQUParameter param_signal_5[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_5 = {"signalSetBookmarkFilename", 1, param_signal_5 };
    static const TQUParameter param_signal_6[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_6 = {"signalChangeBookmarkFilename", 1, param_signal_6 };
    static const TQUParameter param_signal_7[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In },
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_7 = {"signalDeleteBookmark", 2, param_signal_7 };
    static const TQMetaData signal_tbl[] = {
	{ "signalContentChanged(const TQString&)", &signal_0, TQMetaData::Public },
	{ "signalAllNodesProcessed()", &signal_1, TQMetaData::Public },
	{ "signalSetText(const TQString&)", &signal_2, TQMetaData::Public },
	{ "signalEnableTextedit(bool)", &signal_3, TQMetaData::Public },
	{ "signalNotifyBookmarkManager(const TQString&,const TQString&)", &signal_4, TQMetaData::Public },
	{ "signalSetBookmarkFilename(const TQString&)", &signal_5, TQMetaData::Public },
	{ "signalChangeBookmarkFilename(const TQString&)", &signal_6, TQMetaData::Public },
	{ "signalDeleteBookmark(const TQString&,const TQString&)", &signal_7, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"DocTreeView", parentObject,
	slot_tbl, 21,
	signal_tbl, 8,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_DocTreeView.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL signalContentChanged
void DocTreeView::signalContentChanged( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}

// TQ_SIGNAL signalAllNodesProcessed
void DocTreeView::signalAllNodesProcessed()
{
    activate_signal( staticMetaObject()->signalOffset() + 1 );
}

// TQ_SIGNAL signalSetText
void DocTreeView::signalSetText( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 2, t0 );
}

// TQ_SIGNAL signalEnableTextedit
void DocTreeView::signalEnableTextedit( bool t0 )
{
    activate_signal_bool( staticMetaObject()->signalOffset() + 3, t0 );
}

#include <ntqobjectdefs.h>
#include <ntqsignalslotimp.h>

// TQ_SIGNAL signalNotifyBookmarkManager
void DocTreeView::signalNotifyBookmarkManager( const TQString& t0, const TQString& t1 )
{
    if ( signalsBlocked() )
	return;
    TQConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 4 );
    if ( !clist )
	return;
    TQUObject o[3];
    static_QUType_TQString.set(o+1,t0);
    static_QUType_TQString.set(o+2,t1);
    o[2].isLastObject = true;
    activate_signal( clist, o );
}

// TQ_SIGNAL signalSetBookmarkFilename
void DocTreeView::signalSetBookmarkFilename( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 5, t0 );
}

// TQ_SIGNAL signalChangeBookmarkFilename
void DocTreeView::signalChangeBookmarkFilename( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 6, t0 );
}

// TQ_SIGNAL signalDeleteBookmark
void DocTreeView::signalDeleteBookmark( const TQString& t0, const TQString& t1 )
{
    if ( signalsBlocked() )
	return;
    TQConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 7 );
    if ( !clist )
	return;
    TQUObject o[3];
    static_QUType_TQString.set(o+1,t0);
    static_QUType_TQString.set(o+2,t1);
    o[2].isLastObject = true;
    activate_signal( clist, o );
}

bool DocTreeView::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotItemClicked((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: slotRightButtonPressed((TQListViewItem*)static_QUType_ptr.get(_o+1),(const TQPoint&)*((const TQPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 2: languageChange(); break;
    case 3: slotRenameItem(); break;
    case 4: slotDeleteItem(); break;
    case 5: slotNewBookInfo(); break;
    case 6: slotNewChapter(); break;
    case 7: slotNewKeywordSet(); break;
    case 8: slotNewKeyword(); break;
    case 9: slotNewAbstract(); break;
    case 10: slotNewAuthorGroup(); break;
    case 11: slotNewAuthor(); break;
    case 12: slotNewDate(); break;
    case 13: slotNewReleaseInfo(); break;
    case 14: slotNewTitle(); break;
    case 15: slotNewParagraph(); break;
    case 16: slotNewSection_1(); break;
    case 17: slotNewSection_2(); break;
    case 18: slotNewSection_3(); break;
    case 19: slotNewSection_4(); break;
    case 20: slotNewSection_5(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool DocTreeView::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: signalContentChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: signalAllNodesProcessed(); break;
    case 2: signalSetText((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 3: signalEnableTextedit((bool)static_QUType_bool.get(_o+1)); break;
    case 4: signalNotifyBookmarkManager((const TQString&)static_QUType_TQString.get(_o+1),(const TQString&)static_QUType_TQString.get(_o+2)); break;
    case 5: signalSetBookmarkFilename((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 6: signalChangeBookmarkFilename((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 7: signalDeleteBookmark((const TQString&)static_QUType_TQString.get(_o+1),(const TQString&)static_QUType_TQString.get(_o+2)); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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