#
# Copyright (C) 2007 Mobio Networks, Inc.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see .
#
require 'builder/xmlmarkup'
require 'rmobio/rxml/base_transformer'
require 'singleton'
module Rmobio
module Rxml
class WapTransformer < BaseTransformer
include Singleton
def doctype(xml)
xml << ' '
yield xml
xml << ""
end
def body(doc, title,style=nil)
doc << "
\r"
if style
doc << "\r"
end
doc << ""
doc << title
doc << "\r"
doc << "\r"
yield doc
doc << "\r"
end
# Produce a text string. The style will be the tag name, ex, "i" will
# be the xhtml tag.
def text(doc, txt="", id=nil, style=nil, height=nil, width=nil)
doc << txt
end
def textarea(doc, txt="", height=nil, width=nil, attr=nil, id=nil)
doc << "\n'
end
# Tag for user input field. Type can be "text" or "password". For type "submit",
# use submit tag.
def input(doc, name, value, type, attr=nil)
doc << "\n\n"
end
def submit_tag()
end
def form(doc, name, action, method, req_id=nil, replace_id=nil, attr=nil)
doc << "\n'
end
def link(doc)
end
def softBr(doc)
doc.br
end
# def extra_text(msg, doc)
# doc << msg
# doc
# end
def dummy(doc)
doc << doc.dum
yield doc
doc << doc.dum
end
# Create XML markup based on the name of the method. This method
# is never invoked directly, but is called for each markup method
# in the markup block.
def method_missing(sym, *args, &block)
#uts 'method missing'
super(sym, *args, &block)
end
end
end
end