/** @file MOMDeviceCollection.h
 *
 * Copyright (C) Espial Limited 2014 - Company confidential - All rights reserved.
 *
 */

#ifndef MOMDeviceCollection_h
#define MOMDeviceCollection_h

#if ENABLE(RMAI)

#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/AtomicString.h>

#include "ExceptionCode.h"

extern "C" {
#include "layers.h"
#include "layers_string.h"
}

namespace WebCore {

class MOMDevice;
class ScriptExecutionContext;

class MOMDeviceCollection : public RefCounted<MOMDeviceCollection> {
public:

    enum CollectionStrategy {
        STRATEGY_UNKNOWN = 0,
        STRATEGY_ALL,
        STRATEGY_SOURCE,
        STRATEGY_RECORDER,
        STRATEGY_RF,
        STRATEGY_IPTV,
        STRATEGY_UPNP,
        STRATEGY_VOD
    };
    
    static PassRefPtr<MOMDeviceCollection> create(ScriptExecutionContext* context, enum CollectionStrategy strategy, bool localOnly);
    static PassRefPtr<MOMDeviceCollection> create(ScriptExecutionContext* context, layers_string matchUri, bool localOnly);
    ~MOMDeviceCollection();
    int length() const;

    PassRefPtr<MOMDevice> item( int index );

protected:
    MOMDeviceCollection(ScriptExecutionContext* context, enum CollectionStrategy strategy, layers_string matchUri, bool localOnly);

private:
    CollectionStrategy m_strategy;
    layers_string m_matchUri;
    bool m_localOnly;
    ScriptExecutionContext* m_context;
};

} // namespace WebCore

#endif // ENABLE(RMAI)

#endif // MOMDeviceCollection_h
