ViewportArguments.h [plain text]
#ifndef ViewportArguments_h
#define ViewportArguments_h
namespace WebCore {
class Document;
class String;
enum ViewportErrorCode {
DeviceWidthShouldBeUsedWarning,
DeviceHeightShouldBeUsedWarning,
UnrecognizedViewportArgumentError,
MaximumScaleTooLargeError
};
struct ViewportArguments {
enum { ValueUndefined = -1 };
ViewportArguments()
: initialScale(ValueUndefined)
, minimumScale(ValueUndefined)
, maximumScale(ValueUndefined)
, width(ValueUndefined)
, height(ValueUndefined)
, userScalable(ValueUndefined)
{
}
float initialScale;
float minimumScale;
float maximumScale;
float width;
float height;
float userScalable;
bool hasCustomArgument() const
{
return initialScale != ValueUndefined || minimumScale != ValueUndefined || maximumScale != ValueUndefined || width != ValueUndefined || height != ValueUndefined || userScalable != ValueUndefined;
}
};
void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data);
void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement);
}
#endif // ViewportArguments_h