extern "C"
bool initializeIntegration( )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << getHostname();
    if( !dcopClient()->call( "kded", "tdeintegration","initializeIntegration(TQString)", data, replyType, replyData, true ))
        {
        bool ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    bool ret;
    replystream >> ret;
    return ret;
    }

extern "C"
TQStringList getOpenFileNames( const TQString& filter, TQString* workingDirectory,
    long parent, const TQCString& name, const TQString& caption, TQString* selectedFilter,
    bool multiple )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << convertFileFilter( filter ) << ( workingDirectory != NULL ? *workingDirectory : TQString()) << parent << name << caption << convertFileFilter( ( selectedFilter != NULL ? *selectedFilter : TQString()) ) << multiple << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","getOpenFileNames(TQString,TQString,long,TQCString,TQString,TQString,bool,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        TQStringList ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    TQStringList ret;
    replystream >> ret;
    TQString workingDirectory_dummy;
    TQString selectedFilter_dummy;
    replystream >> ( workingDirectory != NULL ? *workingDirectory : workingDirectory_dummy ) >> selectedFilter_dummy;
    if( selectedFilter != NULL )
        *selectedFilter = convertBackFileFilter( selectedFilter_dummy );
    return ret;
    }

extern "C"
TQString getSaveFileName( const TQString& initialSelection, const TQString& filter,
    TQString* workingDirectory, long parent, const TQCString& name, const TQString& caption,
    TQString* selectedFilter )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << initialSelection << convertFileFilter( filter ) << ( workingDirectory != NULL ? *workingDirectory : TQString()) << parent << name << caption << convertFileFilter( ( selectedFilter != NULL ? *selectedFilter : TQString()) ) << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","getSaveFileName(TQString,TQString,TQString,long,TQCString,TQString,TQString,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        TQString ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    TQString ret;
    replystream >> ret;
    TQString workingDirectory_dummy;
    TQString selectedFilter_dummy;
    replystream >> ( workingDirectory != NULL ? *workingDirectory : workingDirectory_dummy ) >> selectedFilter_dummy;
    if( selectedFilter != NULL )
        *selectedFilter = convertBackFileFilter( selectedFilter_dummy );
    return ret;
    }

extern "C"
TQString getExistingDirectory( const TQString& initialDirectory, long parent, const TQCString& name,
    const TQString& caption )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << initialDirectory << parent << name << caption << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","getExistingDirectory(TQString,long,TQCString,TQString,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        TQString ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    TQString ret;
    replystream >> ret;
    return ret;
    }

extern "C"
TQColor getColor( const TQColor& color, long parent, const TQCString& name )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << color << parent << name << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","getColor(TQColor,long,TQCString,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        TQColor ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    TQColor ret;
    replystream >> ret;
    return ret;
    }

extern "C"
TQFont getFont( bool* ok, const TQFont& def, long parent, const TQCString& name )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << ( ok != NULL ? *ok : bool()) << def << parent << name << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","getFont(bool,TQFont,long,TQCString,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        TQFont ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    TQFont ret;
    replystream >> ret;
    bool ok_dummy;
    replystream >> ( ok != NULL ? *ok : ok_dummy );
    return ret;
    }

extern "C"
int messageBox1( int type, long parent, const TQString& caption, const TQString& text,
    int button0, int button1, int button2 )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << type << parent << caption << text << button0 << button1 << button2 << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","messageBox1(int,long,TQString,TQString,int,int,int,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        int ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    int ret;
    replystream >> ret;
    return ret;
    }

extern "C"
int messageBox2( int type, long parent, const TQString& caption, const TQString& text,
    const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
    int defaultButton, int escapeButton )
    {
    if( tqt_xdisplay() != NULL )
        XSync( tqt_xdisplay(), False );
    if( parent == 0 )
        DCOPRef( "kded", "MainApplication-Interface" ).call( "updateUserTimestamp", tqt_x_time );
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream datastream( data, IO_WriteOnly );
    datastream << type << parent << caption << text << button0Text << button1Text << button2Text << defaultButton << escapeButton << tqAppName() << tqAppClass();
    if( !dcopClient()->call( "kded", "tdeintegration","messageBox2(int,long,TQString,TQString,TQString,TQString,TQString,int,int,TQCString,TQCString)", data, replyType, replyData, true ))
        {
        int ret;
        dcopTypeInit( ret ); // set to false/0/whatever
        return ret;
        }
    TQDataStream replystream( replyData, IO_ReadOnly );
    int ret;
    replystream >> ret;
    return ret;
    }

