Esempio n. 1
0
void LocalPrefServer::startNewGame()
{
	PrefAssert( model != 0 );
	model->StartNewBullet();
	notifyAll(BulletStartedMessage(model->GetSettings()));
	startNewLayout();
}
Esempio n. 2
0
bool KHTMLReader::parse_ul(DOM::Element e)
{
    _list_depth++;
    bool popstateneeded = false;
    for (DOM::Node items = e.firstChild();!items.isNull();items = items.nextSibling()) {
        if (items.nodeName().string().toLower() == "li") {
            if (popstateneeded) {
                popState();
                //popstateneeded = false;
            }
            pushNewState();
            startNewLayout();
            popstateneeded = true;
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
            if (e.tagName().string().toLower() == "ol") {
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "1");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
            } else {
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "10");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", "");
            }
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "depth", QString("%1").arg(_list_depth - 1));
        }
        parseNode(items);
    }
    if (popstateneeded)
        popState();
    _list_depth--;
    return false;
}
Esempio n. 3
0
void LocalPrefServer::processModelChanged()
{
	DealStateType type = model->GetDealStateType();
	switch( type ) {
		case GST_MisereCatcherVote:
		{
			sendMisereCatcherVoteRequest();
			break;
		}
		case GST_Finished:
			if( model->IsBulletFinished() ) {
				processBulletFinish();
			} else {
				startNewLayout();
			}
			break;
		default:
			players[mapModelToRealPlayer(model->PlayerCardsOwner(model->CurrentPlayer()))].Player->
				OnMessage( MoveRequestMessage() );
			break;
	}
}
Esempio n. 4
0
void KHTMLReader::popState()
{

    HTMLReader_state *s = _state.pop();

    /**
       the recursion trough html is somewhat clumsy still, I am working on a better method.
       popState gets called when a tag is closed, but since a closed tag doesn't mean the end
       of a (kword) "tag" we have to copy some things over from the closed tag:
        - the paragraph (after a </B>, we still are in the same paragraph, but
      inside the <B></B> , there might have been a <BR>)
       if we go back into another frameset, we start a new paragraph.
     **/
    if (s->frameset == state()->frameset) {
        state()->paragraph = s->paragraph;
        if ((state()->layout != s->layout)) {
            startNewLayout(false, state()->layout);
        }
        state()->format = _writer->startFormat(state()->paragraph, state()->format);
    }
    delete(s);
}
Esempio n. 5
0
void KHTMLReader::startNewLayout(bool startNewFormat)
{
    QDomElement layout;
    startNewLayout(startNewFormat, layout);
}