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

#include "MainWindowBase.h"

#include <ntqvariant.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqaction.h>
#include <ntqmenubar.h>
#include <ntqpopupmenu.h>
#include <ntqtoolbar.h>

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

    // actions
    actionOpenSourceFile = new TQAction( this, "actionOpenSourceFile" );
    actionMenuRecentlyOpenedFiles = new TQAction( this, "actionMenuRecentlyOpenedFiles" );
    actionClearRecentlyOpenedList = new TQAction( this, "actionClearRecentlyOpenedList" );
    actionMenuEncoding = new TQAction( this, "actionMenuEncoding" );
    actionSaveSourceFile = new TQAction( this, "actionSaveSourceFile" );
    actionSaveSourceFileAs = new TQAction( this, "actionSaveSourceFileAs" );
    actionMenuSaveEncoded = new TQAction( this, "actionMenuSaveEncoded" );
    actionMenuExport = new TQAction( this, "actionMenuExport" );
    actionExportHTML = new TQAction( this, "actionExportHTML" );
    actionExportPDF = new TQAction( this, "actionExportPDF" );
    actionShowInfo = new TQAction( this, "actionShowInfo" );
    actionExit = new TQAction( this, "actionExit" );
    actionLoadIndenterConfigFile = new TQAction( this, "actionLoadIndenterConfigFile" );
    actionSaveIndenterConfigFile = new TQAction( this, "actionSaveIndenterConfigFile" );
    actionCreateShellScript = new TQAction( this, "actionCreateShellScript" );
    actionResetIndenterParameters = new TQAction( this, "actionResetIndenterParameters" );
    actionLiveIndentPreview = new TQAction( this, "actionLiveIndentPreview" );
    actionLiveIndentPreview->setToggleAction( true );
    actionLiveIndentPreview->setVisible( false );
    actionEnableSyntaxHighlighting = new TQAction( this, "actionEnableSyntaxHighlighting" );
    actionEnableSyntaxHighlighting->setToggleAction( true );
    actionEnableSyntaxHighlighting->setOn( true );
    actionWhiteSpaceIsVisible = new TQAction( this, "actionWhiteSpaceIsVisible" );
    actionWhiteSpaceIsVisible->setToggleAction( true );
    actionWhiteSpaceIsVisible->setVisible( true );
    actionMenuHighlighter = new TQAction( this, "actionMenuHighlighter" );
    actionIndenterParameterTooltipsEnabled = new TQAction( this, "actionIndenterParameterTooltipsEnabled" );
    actionIndenterParameterTooltipsEnabled->setToggleAction( true );
    actionIndenterParameterTooltipsEnabled->setOn( true );
    actionLoadLastOpenedFileOnStartup = new TQAction( this, "actionLoadLastOpenedFileOnStartup" );
    actionLoadLastOpenedFileOnStartup->setToggleAction( true );
    actionLoadLastOpenedFileOnStartup->setOn( true );
    actionLoadLastOpenedFileOnStartup->setVisible( true );
    actionShowSettings = new TQAction( this, "actionShowSettings" );
    actionAboutUniversalIndentGUITQt = new TQAction( this, "actionAboutUniversalIndentGUITQt" );


    // toolbars
    toolBar = new TQToolBar( TQString(""), this, DockTop ); 

    toolBar->setOrientation( TQToolBar::TQt::Horizontal );
    toolBar->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 1, 1, toolBar->sizePolicy().hasHeightForWidth() ) );


    // menubar
    menuBar = new TQMenuBar( this, "menuBar" );

    menuBar->setGeometry( TQRect( 0, 0, 949, 21 ) );

    menuFile = new TQPopupMenu( this );
    actionOpenSourceFile->addTo( menuFile );
    popupMenuRecentlyOpenedFiles = new TQPopupMenu( this );
    menuFile->insertItem( actionMenuRecentlyOpenedFiles->iconSet(), tr( "Recently Opened Files" ), popupMenuRecentlyOpenedFiles );
    popupMenuRecentlyOpenedFiles->insertSeparator();
    actionClearRecentlyOpenedList->addTo( popupMenuRecentlyOpenedFiles );
    popupMenuEncoding = new TQPopupMenu( this );
    menuFile->insertItem( actionMenuEncoding->iconSet(), tr( "Reopen File with other Encoding" ), popupMenuEncoding );
    menuFile->insertSeparator();
    actionSaveSourceFile->addTo( menuFile );
    actionSaveSourceFileAs->addTo( menuFile );
    popupMenuSaveEncoded = new TQPopupMenu( this );
    menuFile->insertItem( actionMenuSaveEncoded->iconSet(), tr( "Save Source File As with other Encoding" ), popupMenuSaveEncoded );
    menuFile->insertSeparator();
    actionShowInfo->addTo( menuFile );
    menuFile->insertSeparator();
    actionExit->addTo( menuFile );
    menuBar->insertItem( TQString(""), menuFile, 2 );

    menuIndenter = new TQPopupMenu( this );
    actionLoadIndenterConfigFile->addTo( menuIndenter );
    actionSaveIndenterConfigFile->addTo( menuIndenter );
    actionCreateShellScript->addTo( menuIndenter );
    actionResetIndenterParameters->addTo( menuIndenter );
    menuBar->insertItem( TQString(""), menuIndenter, 3 );

    menuSettings = new TQPopupMenu( this );
    actionLiveIndentPreview->addTo( menuSettings );
    actionEnableSyntaxHighlighting->addTo( menuSettings );
    actionWhiteSpaceIsVisible->addTo( menuSettings );
    popupMenuHighlighter = new TQPopupMenu( this );
    menuSettings->insertItem( actionMenuHighlighter->iconSet(), tr( "Set Syntax Highlighter" ), popupMenuHighlighter );
    actionIndenterParameterTooltipsEnabled->addTo( menuSettings );
    actionLoadLastOpenedFileOnStartup->addTo( menuSettings );
    actionShowSettings->addTo( menuSettings );
    menuBar->insertItem( TQString(""), menuSettings, 4 );

    menuHelp = new TQPopupMenu( this );
    actionAboutUniversalIndentGUITQt->addTo( menuHelp );
    menuBar->insertItem( TQString(""), menuHelp, 5 );

    languageChange();
    resize( TQSize(949, 633).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( actionExit, TQ_SIGNAL( activated() ), this, TQ_SLOT( close() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MainWindowBase::languageChange()
{
    actionOpenSourceFile->setText( tr( "Open Source File" ) );
    actionOpenSourceFile->setStatusTip( tr( "Opens a dialog for selecting a source code file." ) );
    actionOpenSourceFile->setAccel( tr( "Ctrl+O" ) );
    actionMenuRecentlyOpenedFiles->setText( tr( "Recently Opened Files" ) );
    actionMenuRecentlyOpenedFiles->setStatusTip( tr( "Open a recently used file." ) );
    actionClearRecentlyOpenedList->setText( tr( "Clear Recently Opened List" ) );
    actionClearRecentlyOpenedList->setStatusTip( tr( "Clears the list of recently open files." ) );
    actionMenuEncoding->setText( tr( "Reopen File with other Encoding" ) );
    actionMenuEncoding->setStatusTip( tr( "Reopen the current file using a specified encoding." ) );
    actionSaveSourceFile->setText( tr( "Save Source File" ) );
    actionSaveSourceFile->setStatusTip( tr( "Saves the currently shown source code to the last opened or saved source file." ) );
    actionSaveSourceFile->setAccel( tr( "Ctrl+S" ) );
    actionSaveSourceFileAs->setText( tr( "Save Source File As..." ) );
    actionSaveSourceFileAs->setStatusTip( tr( "Opens a file dialog to save the currently shown source code." ) );
    actionSaveSourceFileAs->setAccel( tr( "Ctrl+Shift+S" ) );
    actionMenuSaveEncoded->setText( tr( "Save Source File As with other Encoding" ) );
    actionMenuSaveEncoded->setStatusTip( tr( "Save the current source file using a specified encoding." ) );
    actionMenuExport->setText( tr( "Export" ) );
    actionMenuExport->setStatusTip( tr( "Export the currently visible source." ) );
    actionExportHTML->setText( tr( "HTML" ) );
    actionExportHTML->setStatusTip( tr( "Export the currently visible source code as HTML document." ) );
    actionExportPDF->setText( tr( "PDF" ) );
    actionExportPDF->setStatusTip( tr( "Export the currently visible source code as PDF document." ) );
    actionShowInfo->setText( tr( "Show file and path info" ) );
    actionShowInfo->setStatusTip( tr( "Opens a window showing some info about the current open file and paths." ) );
    actionShowInfo->setAccel( tr( "Ctrl+I" ) );
    actionExit->setText( tr( "Exit" ) );
    actionExit->setStatusTip( tr( "Quits the UniversalIndentGUI." ) );
    actionExit->setAccel( tr( "Ctrl+Q" ) );
    actionLoadIndenterConfigFile->setText( tr( "Load Indenter Config File" ) );
    actionLoadIndenterConfigFile->setStatusTip( tr( "Opens a file dialog to load the original config file of the indenter." ) );
    actionLoadIndenterConfigFile->setAccel( tr( "Alt+O" ) );
    actionSaveIndenterConfigFile->setText( tr( "Save Indenter Config File" ) );
    actionSaveIndenterConfigFile->setStatusTip( tr( "Opens a dialog to save the current indenter configuration to a file." ) );
    actionSaveIndenterConfigFile->setAccel( tr( "Alt+S" ) );
    actionCreateShellScript->setText( tr( "Create Indenter Call Shell Script" ) );
    actionCreateShellScript->setStatusTip( tr( "Create a shell script that calls the current selected indenter for formatting a given file with the current indent settings." ) );
    actionResetIndenterParameters->setText( tr( "Reset indenter parameters" ) );
    actionResetIndenterParameters->setStatusTip( tr( "Resets all indenter parameters to the default values." ) );
    actionLiveIndentPreview->setText( tr( "Live Indent Preview" ) );
    actionLiveIndentPreview->setAccel( tr( "Ctrl+L" ) );
    actionEnableSyntaxHighlighting->setText( tr( "Syntax Highlighting" ) );
    actionEnableSyntaxHighlighting->setStatusTip( tr( "By enabling this, special keywords of the source code are highlighted." ) );
    actionEnableSyntaxHighlighting->setAccel( tr( "Ctrl+H" ) );
    actionWhiteSpaceIsVisible->setText( tr( "White Space Visible" ) );
    actionWhiteSpaceIsVisible->setToolTip( tr( "Set white space visible" ) );
    actionWhiteSpaceIsVisible->setStatusTip( tr( "Enables or disables diplaying of white space characters in the editor." ) );
    actionMenuHighlighter->setText( tr( "Set Syntax Highlighter" ) );
    actionMenuHighlighter->setStatusTip( tr( "Set the syntax highlighter to use." ) );
    actionIndenterParameterTooltipsEnabled->setText( tr( "Parameter Tooltips" ) );
    actionIndenterParameterTooltipsEnabled->setStatusTip( tr( "If checked, tooltips will show up if the mouse cursor remains over an indenter parameter for a while." ) );
    actionLoadLastOpenedFileOnStartup->setText( tr( "Auto Open Last File" ) );
    actionLoadLastOpenedFileOnStartup->setToolTip( tr( "Auto open last source file on startup" ) );
    actionLoadLastOpenedFileOnStartup->setStatusTip( tr( "If selected opens last source code file on startup." ) );
    actionShowSettings->setText( tr( "Settings" ) );
    actionShowSettings->setToolTip( tr( "Opens the settings dialog" ) );
    actionShowSettings->setStatusTip( tr( "Opens the settings dialog, to set language etc." ) );
    actionAboutUniversalIndentGUITQt->setText( tr( "About UniversalIndentGUI TQt" ) );
    actionAboutUniversalIndentGUITQt->setStatusTip( tr( "Shows info about UniversalIndentGUI TQt." ) );
    toolBar->setLabel( tr( "Tools" ) );
    menuFile->changeItem( menuFile->idAt( 1 ), tr( "Recently Opened Files" ) );
    menuFile->changeItem( menuFile->idAt( 2 ), tr( "Reopen File with other Encoding" ) );
    menuFile->changeItem( menuFile->idAt( 6 ), tr( "Save Source File As with other Encoding" ) );
    if (menuBar->findItem(2))
        menuBar->findItem(2)->setText( tr( "&File" ) );
    if (menuBar->findItem(3))
        menuBar->findItem(3)->setText( tr( "&Indenter" ) );
    menuSettings->changeItem( menuSettings->idAt( 3 ), tr( "Set Syntax Highlighter" ) );
    if (menuBar->findItem(4))
        menuBar->findItem(4)->setText( tr( "&Settings" ) );
    if (menuBar->findItem(5))
        menuBar->findItem(5)->setText( tr( "&Help" ) );
}

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

TQMetaObject *MainWindowBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MainWindowBase( "MainWindowBase", &MainWindowBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MainWindowBase::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 = TQMainWindow::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"MainWindowBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MainWindowBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool MainWindowBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQMainWindow::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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