PlatformStrategies.h [plain text]
#ifndef PlatformStrategies_h
#define PlatformStrategies_h
#if USE(PLATFORM_STRATEGIES)
namespace WebCore {
class CookiesStrategy;
class PasteboardStrategy;
class PluginStrategy;
class VisitedLinkStrategy;
class PlatformStrategies {
public:
CookiesStrategy* cookiesStrategy()
{
if (!m_cookiesStrategy)
m_cookiesStrategy = createCookiesStrategy();
return m_cookiesStrategy;
}
PluginStrategy* pluginStrategy()
{
if (!m_pluginStrategy)
m_pluginStrategy = createPluginStrategy();
return m_pluginStrategy;
}
VisitedLinkStrategy* visitedLinkStrategy()
{
if (!m_visitedLinkStrategy)
m_visitedLinkStrategy = createVisitedLinkStrategy();
return m_visitedLinkStrategy;
}
PasteboardStrategy* pasteboardStrategy()
{
if (!m_pasteboardStrategy)
m_pasteboardStrategy = createPasteboardStrategy();
return m_pasteboardStrategy;
}
protected:
PlatformStrategies()
: m_cookiesStrategy(0)
, m_pluginStrategy(0)
, m_visitedLinkStrategy(0)
, m_pasteboardStrategy(0)
{
}
virtual ~PlatformStrategies()
{
}
private:
virtual CookiesStrategy* createCookiesStrategy() = 0;
virtual PluginStrategy* createPluginStrategy() = 0;
virtual VisitedLinkStrategy* createVisitedLinkStrategy() = 0;
virtual PasteboardStrategy* createPasteboardStrategy() = 0;
CookiesStrategy* m_cookiesStrategy;
PluginStrategy* m_pluginStrategy;
VisitedLinkStrategy* m_visitedLinkStrategy;
PasteboardStrategy* m_pasteboardStrategy;
};
PlatformStrategies* platformStrategies();
void setPlatformStrategies(PlatformStrategies*);
bool hasPlatformStrategies();
}
#endif // USE(PLATFORM_STRATEGIES)
#endif // PlatformStrategies_h