/*
    Rosegarden
    A MIDI and audio sequencer and musical notation editor.

    This program is Copyright 2000-2008
        Guillaume Laurent   <glaurent@telegraph-road.org>,
        Chris Cannam        <cannam@all-day-breakfast.com>,
        Richard Bown        <richard.bown@ferventsoftware.com>

    The moral rights of Guillaume Laurent, Chris Cannam, and Richard
    Bown to claim authorship of this work have been asserted.

    Other copyrights also apply to some parts of this work.  Please
    see the AUTHORS file and individual file headers for details.

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.  See the file
    COPYING included with this distribution for more information.
*/

#ifndef _RG_NAMESETEDITOR_H_
#define _RG_NAMESETEDITOR_H_

#include <kcompletion.h>
#include <tqstring.h>
#include <tqvgroupbox.h>
#include <vector>


class TQWidget;
class TQPushButton;
class TQListViewItem;
class TQLabel;
class TQGridLayout;
class TQFrame;
class KLineEdit;


namespace Rosegarden
{

class BankEditorDialog;


class NameSetEditor : public TQVGroupBox
{
    TQ_OBJECT
  
public:
    virtual void clearAll() = 0;

    virtual void populate(TQListViewItem *) = 0;
    virtual void reset() = 0;

public slots:
    virtual void slotNameChanged(const TQString&) = 0;
    virtual void slotEntryButtonPressed() = 0;
    void slotToggleInitialLabel();

protected:
    NameSetEditor(BankEditorDialog *bankEditor,
                  TQString title,
                  TQWidget *parent,
                  const char *name,
                  TQString headingPrefix = "",
                  bool showEntryButtons = false);

    TQPushButton *getEntryButton(int n) { return m_entryButtons[n]; }
    const TQPushButton *getEntryButton(int n) const { return m_entryButtons[n]; }

    TQGridLayout             *m_mainLayout;
    BankEditorDialog*        m_bankEditor;
    TDECompletion              m_completion;
    TQPushButton             *m_initialLabel;
    std::vector<TQLabel*>     m_labels;
    std::vector<KLineEdit*>  m_names;
    TQFrame                  *m_mainFrame;
    TQLabel                  *m_librarian;
    TQLabel                  *m_librarianEmail;
    std::vector<TQPushButton *> m_entryButtons;
};


}

#endif
