本文整理汇总了C++中WMLPageState类的典型用法代码示例。如果您正苦于以下问题:C++ WMLPageState类的具体用法?C++ WMLPageState怎么用?C++ WMLPageState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WMLPageState类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: wmlPageStateForDocument
bool WMLDocument::initialize(bool aboutToFinishParsing)
{
WMLPageState* wmlPageState = wmlPageStateForDocument(this);
if (!wmlPageState || !wmlPageState->canAccessDeck())
return false;
// Remember that we'e successfully entered the deck
wmlPageState->resetAccessControlData();
// Notify the existance of templates to all cards of the current deck
WMLTemplateElement::registerTemplatesInDocument(this);
// Set destination card
m_activeCard = WMLCardElement::determineActiveCard(this);
if (!m_activeCard) {
reportWMLError(this, WMLErrorNoCardInDocument);
return true;
}
// Handle deck-level task overrides
m_activeCard->handleDeckLevelTaskOverridesIfNeeded();
// Handle card-level intrinsic event
if (!aboutToFinishParsing)
m_activeCard->handleIntrinsicEventIfNeeded();
return true;
}
开发者ID:kupyxa4444,项目名称:a3000_kernel_jb,代码行数:28,代码来源:WMLDocument.cpp
示例2: formControlName
void WMLInputElement::initialize()
{
String nameVariable = formControlName();
String variableValue;
WMLPageState* pageSate = wmlPageStateForDocument(document());
ASSERT(pageSate);
if (!nameVariable.isEmpty())
variableValue = pageSate->getVariable(nameVariable);
if (variableValue.isEmpty() || !isConformedToInputMask(variableValue)) {
String val = value();
if (isConformedToInputMask(val))
variableValue = val;
else
variableValue = "";
pageSate->storeVariable(nameVariable, variableValue);
}
setValue(variableValue);
if (!hasAttribute(WMLNames::emptyokAttr)) {
if (m_formatMask.isEmpty() ||
// check if the format codes is just "*f"
(m_formatMask.length() == 2 && m_formatMask[0] == '*' && formatCodes().find(m_formatMask[1]) != -1))
m_isEmptyOk = true;
}
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:27,代码来源:WMLInputElement.cpp
示例3: wmlPageStateForDocument
void WMLSelectElement::calculateDefaultOptionIndices()
{
WMLPageState* pageState = wmlPageStateForDocument(document());
if (!pageState)
return;
String variable;
// Spec: If the 'iname' attribute is specified and names a variable that is set,
// then the default option index is the validated value of that variable.
String iname = this->iname();
if (!iname.isEmpty()) {
variable = pageState->getVariable(iname);
if (!variable.isEmpty())
m_defaultOptionIndices = parseIndexValueString(variable);
}
// Spec: If the default option index is empty and the 'ivalue' attribute is specified,
// then the default option index is the validated attribute value.
String ivalue = this->ivalue();
if (m_defaultOptionIndices.isEmpty() && !ivalue.isEmpty())
m_defaultOptionIndices = parseIndexValueString(ivalue);
// Spec: If the default option index is empty, and the 'name' attribute is specified
// and the 'name' ttribute names a variable that is set, then for each value in the 'name'
// variable that is present as a value in the select's option elements, the index of the
// first option element containing that value is added to the default index if that
// index has not been previously added.
String name = this->name();
if (m_defaultOptionIndices.isEmpty() && !name.isEmpty()) {
variable = pageState->getVariable(name);
if (!variable.isEmpty())
m_defaultOptionIndices = valueStringToOptionIndices(variable);
}
String value = parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::valueAttr));
// Spec: If the default option index is empty and the 'value' attribute is specified then
// for each value in the 'value' attribute that is present as a value in the select's
// option elements, the index of the first option element containing that value is added
// to the default index if that index has not been previously added.
if (m_defaultOptionIndices.isEmpty() && !value.isEmpty())
m_defaultOptionIndices = valueStringToOptionIndices(value);
// Spec: If the default option index is empty and the select is a multi-choice, then the
// default option index is set to zero. If the select is single-choice, then the default
// option index is set to one.
if (m_defaultOptionIndices.isEmpty())
m_defaultOptionIndices.append((unsigned) !m_data.multiple());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:50,代码来源:WMLSelectElement.cpp
示例4: wmlPageStateForDocument
void WMLPrevElement::executeTask(Event*)
{
WMLPageState* pageState = wmlPageStateForDocument(document());
if (!pageState)
return;
WMLCardElement* card = pageState->activeCard();
if (!card)
return;
storeVariableState(pageState);
// Stop the timer of the current card if it is active
if (WMLTimerElement* eventTimer = card->eventTimer())
eventTimer->stop();
pageState->page()->goBack();
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:18,代码来源:WMLPrevElement.cpp
示例5: if
void WMLDoElement::defaultEventHandler(Event* event)
{
if (m_isOptional)
return;
if (event->type() == eventNames().keypressEvent) {
WMLElement::defaultEventHandler(event);
return;
}
if (event->type() != eventNames().clickEvent && event->type() != eventNames().keydownEvent)
return;
if (event->isKeyboardEvent()
&& static_cast<KeyboardEvent*>(event)->keyIdentifier() != "Enter")
return;
if (m_type == "accept" || m_type == "options") {
if (m_task)
m_task->executeTask();
} else if (m_type == "prev") {
ASSERT(document()->isWMLDocument());
WMLDocument* document = static_cast<WMLDocument*>(this->document());
WMLPageState* pageState = wmlPageStateForDocument(document);
if (!pageState)
return;
// Stop the timer of the current card if it is active
if (WMLCardElement* card = document->activeCard()) {
if (WMLTimerElement* eventTimer = card->eventTimer())
eventTimer->stop();
}
pageState->page()->goBack();
} else if (m_type == "reset") {
WMLPageState* pageState = wmlPageStateForDocument(document());
if (!pageState)
return;
pageState->reset();
}
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:43,代码来源:WMLDoElement.cpp
示例6: ASSERT
void WMLSelectElement::initializeVariables()
{
ASSERT(!m_defaultOptionIndices.isEmpty());
WMLPageState* pageState = wmlPageStateForDocument(document());
if (!pageState)
return;
const Vector<Element*>& items = m_data.listItems(this);
if (items.isEmpty())
return;
// Spec: If the 'iname' attribute is specified, then the named variable is set with the default option index.
String iname = this->iname();
if (!iname.isEmpty())
pageState->storeVariable(iname, optionIndicesToString());
String name = this->name();
if (name.isEmpty())
return;
if (m_data.multiple()) {
// Spec: If the 'name' attribute is specified and the select is a multiple-choice element,
// then for each index greater than zero, the value of the 'value' attribute on the option
// element at the index is added to the name variable.
pageState->storeVariable(name, optionIndicesToValueString());
return;
}
// Spec: If the 'name' attribute is specified and the select is a single-choice element,
// then the named variable is set with the value of the 'value' attribute on the option
// element at the default option index.
unsigned optionIndex = m_defaultOptionIndices.first();
ASSERT(optionIndex >= 1);
int listIndex = optionToListIndex(optionIndex - 1);
ASSERT(listIndex >= 0);
ASSERT(listIndex < (int) items.size());
if (OptionElement* optionElement = toOptionElement(items[listIndex]))
pageState->storeVariable(name, optionElement->value());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:42,代码来源:WMLSelectElement.cpp
示例7: wmlPageStateForDocument
void Text::insertedIntoDocument()
{
CharacterData::insertedIntoDocument();
if (!parentNode()->isWMLElement() || !length())
return;
WMLPageState* pageState = wmlPageStateForDocument(document());
if (!pageState->hasVariables())
return;
String text = data();
if (!text.impl() || text.impl()->containsOnlyWhitespace())
return;
text = substituteVariableReferences(text, document());
ExceptionCode ec;
setData(text, ec);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:20,代码来源:Text.cpp
示例8: initialize
void WMLDocument::finishedParsing()
{
if (ScriptableDocumentParser* parser = this->scriptableDocumentParser()) {
if (!parser->wellFormed()) {
Document::finishedParsing();
return;
}
}
bool hasAccess = initialize(true);
Document::finishedParsing();
if (!hasAccess) {
m_activeCard = 0;
WMLPageState* wmlPageState = wmlPageStateForDocument(this);
if (!wmlPageState)
return;
Page* page = wmlPageState->page();
if (!page)
return;
HistoryItem* item = page->backForward()->backItem();
if (!item)
return;
page->goToItem(item, FrameLoadTypeBackWMLDeckNotAccessible);
return;
}
/// M: ALPS00439551 set a flag to prevent infinite loop in WMLDocument @{
if (m_policyDownloadError) {
m_policyDownloadError = false;
return;
}
/// @}
/// M: ALPS00439551 use a timer to trigger handleIntrinsicEventIfNeeded()
m_intrinsicEventTimer.startOneShot(0.0f);
}
开发者ID:kupyxa4444,项目名称:a3000_kernel_jb,代码行数:41,代码来源:WMLDocument.cpp
示例9: ASSERT
void WMLPrevElement::executeTask()
{
ASSERT(document()->isWMLDocument());
WMLDocument* document = static_cast<WMLDocument*>(this->document());
WMLPageState* pageState = wmlPageStateForDocument(document);
if (!pageState)
return;
WMLCardElement* card = document->activeCard();
if (!card)
return;
storeVariableState(pageState);
// Stop the timer of the current card if it is active
if (WMLTimerElement* eventTimer = card->eventTimer())
eventTimer->stop();
pageState->page()->goBack();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:21,代码来源:WMLPrevElement.cpp
示例10: initialize
void WMLDocument::finishedParsing()
{
if (Tokenizer* tokenizer = this->tokenizer()) {
if (!tokenizer->wellFormed()) {
Document::finishedParsing();
return;
}
}
bool hasAccess = initialize(true);
Document::finishedParsing();
if (!hasAccess) {
m_activeCard = 0;
WMLPageState* wmlPageState = wmlPageStateForDocument(this);
if (!wmlPageState)
return;
Page* page = wmlPageState->page();
if (!page)
return;
BackForwardList* list = page->backForwardList();
if (!list)
return;
HistoryItem* item = list->backItem();
if (!item)
return;
page->goToItem(item, FrameLoadTypeBackWMLDeckNotAccessible);
return;
}
if (m_activeCard) {
m_activeCard->handleIntrinsicEventIfNeeded();
m_activeCard = 0;
}
}
开发者ID:halfkiss,项目名称:ComponentSuperAccessor,代码行数:40,代码来源:WMLDocument.cpp
示例11: wmlPageStateForDocument
void WMLDocument::finishedParsing()
{
if (Tokenizer* tokenizer = this->tokenizer()) {
if (!tokenizer->wellFormed()) {
Document::finishedParsing();
return;
}
}
WMLPageState* wmlPageState = wmlPageStateForDocument(this);
if (!wmlPageState->isDeckAccessible()) {
reportWMLError(this, WMLErrorDeckNotAccessible);
Document::finishedParsing();
return;
}
// Remember that we'e successfully entered the deck
wmlPageState->setNeedCheckDeckAccess(false);
// Notify the existance of templates to all cards of the current deck
WMLTemplateElement::registerTemplatesInDocument(this);
// Set destination card
WMLCardElement* card = WMLCardElement::determineActiveCard(this);
if (!card) {
reportWMLError(this, WMLErrorNoCardInDocument);
Document::finishedParsing();
return;
}
// Handle deck-level task overrides
card->handleDeckLevelTaskOverridesIfNeeded();
// Handle card-level intrinsic event
card->handleIntrinsicEventIfNeeded();
Document::finishedParsing();
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:38,代码来源:WMLDocument.cpp
示例12: substituteVariableReferences
String substituteVariableReferences(const String& reference, Document* document, WMLVariableEscapingMode escapeMode)
{
ASSERT(document);
if (reference.isEmpty())
return reference;
WMLPageState* pageState = wmlPageStateForDocument(document);
if (!pageState)
return reference;
bool isValid = true;
String remainingInput = reference;
String result;
while (!remainingInput.isEmpty()) {
ASSERT(isValid);
int start = remainingInput.find("$");
if (start == -1) {
// Consume all remaining characters, as there's nothing more to substitute
result += remainingInput;
break;
}
// Consume all characters until the variable reference beginning
result += remainingInput.left(start);
remainingInput.remove(0, start);
// Transform adjacent dollar signs into a single dollar sign as string literal
if (remainingInput[1] == '$') {
result += "$";
remainingInput.remove(0, 2);
continue;
}
String variableName;
String conversionMode;
if (remainingInput[1] == '(') {
int referenceEndPosition = remainingInput.find(")");
if (referenceEndPosition == -1) {
isValid = false;
break;
}
variableName = remainingInput.substring(2, referenceEndPosition - 2);
remainingInput.remove(0, referenceEndPosition + 1);
// Determine variable conversion mode string
int pos = variableName.find(':');
if (pos != -1) {
conversionMode = variableName.substring(pos + 1, variableName.length() - (pos + 1));
variableName = variableName.left(pos);
}
} else {
int length = remainingInput.length();
int referenceEndPosition = 1;
for (; referenceEndPosition < length; ++referenceEndPosition) {
if (!isValidVariableNameCharacter(remainingInput[referenceEndPosition]))
break;
}
variableName = remainingInput.substring(1, referenceEndPosition - 1);
remainingInput.remove(0, referenceEndPosition);
}
isValid = isValidVariableName(variableName);
if (!isValid)
break;
ASSERT(!variableName.isEmpty());
String variableValue = pageState->getVariable(variableName);
if (variableValue.isEmpty())
continue;
if (containsVariableReference(variableValue, isValid)) {
if (!isValid)
break;
variableValue = substituteVariableReferences(variableValue, document, escapeMode);
continue;
}
if (!conversionMode.isEmpty()) {
// Override default escape mode, if desired
WMLVariableEscapingMode specifiedEscapeMode = WMLVariableEscapingNone;
if ((isValid = isValidVariableEscapingModeString(conversionMode, specifiedEscapeMode)))
escapeMode = specifiedEscapeMode;
if (!isValid)
break;
}
switch (escapeMode) {
case WMLVariableEscapingNone:
break;
case WMLVariableEscapingEscape:
//.........这里部分代码省略.........
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:101,代码来源:WMLVariables.cpp
示例13: ASSERT
void WMLGoElement::executeTask()
{
ASSERT(document()->isWMLDocument());
WMLDocument* document = static_cast<WMLDocument*>(this->document());
WMLPageState* pageState = wmlPageStateForDocument(document);
if (!pageState)
return;
WMLCardElement* card = document->activeCard();
if (!card)
return;
Frame* frame = document->frame();
if (!frame)
return;
FrameLoader* loader = frame->loader();
if (!loader)
return;
String href = getAttribute(HTMLNames::hrefAttr);
if (href.isEmpty())
return;
// Substitute variables within target url attribute value
KURL url = document->completeURL(substituteVariableReferences(href, document, WMLVariableEscapingEscape));
if (url.isEmpty())
return;
storeVariableState(pageState);
// Stop the timer of the current card if it is active
if (WMLTimerElement* eventTimer = card->eventTimer())
eventTimer->stop();
// FIXME: 'newcontext' handling not implemented for external cards
bool inSameDeck = document->url().path() == url.path();
if (inSameDeck && url.hasFragmentIdentifier()) {
if (WMLCardElement* card = WMLCardElement::findNamedCardInDocument(document, url.fragmentIdentifier())) {
if (card->isNewContext())
pageState->reset();
}
}
// Prepare loading the destination url
ResourceRequest request(url);
if (getAttribute(sendrefererAttr) == "true")
request.setHTTPReferrer(loader->outgoingReferrer());
String cacheControl = getAttribute(cache_controlAttr);
if (m_formAttributes.method() == FormSubmission::PostMethod)
preparePOSTRequest(request, inSameDeck, cacheControl);
else
prepareGETRequest(request, url);
// Set HTTP cache-control header if needed
if (!cacheControl.isEmpty()) {
request.setHTTPHeaderField("cache-control", cacheControl);
if (cacheControl == "no-cache")
request.setCachePolicy(ReloadIgnoringCacheData);
}
loader->load(request, false);
}
开发者ID:KaoTD,项目名称:Nokia-RM-1013-2.0.0.11,代码行数:68,代码来源:WMLGoElement.cpp
注:本文中的WMLPageState类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论