/*
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef __PVRUSB2_SETUP_H
#define __PVRUSB2_SETUP_H

#include "common.h"

#include "setuptools.h"

class cRMSetupItem;

class cRMSetup
{
    private:
        int itemArraySize;
        cRMSetupItem* setupItems;

    protected:
        virtual bool IsValidItem(eSetupItem _item);

        virtual int DeviceValue2Index(eSetupItem _item, cRMDevice* _device);
        virtual void SetDefaultIndex(eSetupItem _item, cRMDevice* _device);

    public:
        cRMSetup();
        virtual ~cRMSetup();

        virtual void operator=(cRMSetup& _setup);
        virtual void SetDefaults(cRMDevice* _device);
        virtual bool SetupParse(const char* _name, const char* _value);

        virtual int NumItems();
        virtual eSetupItem Item(int _iterIndex);

        virtual const char* ItemName(eSetupItem _item);
        virtual eItemType ItemType(eSetupItem _item);
        virtual int ClipIndex(eSetupItem _item, int _index);

        virtual int Index(eSetupItem _item);
        virtual int* IndexReference(eSetupItem _item);
        virtual bool SetIndex(eSetupItem _item, int _index);

        virtual int Value(eSetupItem _item, int _min=-1, int _max=-1);
        virtual bool SetValue(eSetupItem _item, const char* _value);
        virtual bool SetValue(eSetupItem _item,
                int _value, int _min=-1, int _max=-1);

};

#endif // __PVRUSB2_SETUP_H
