# Copyright (c) 2005 # Authors: # Godefroid Chapelle # Tarek Ziade # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as published # by the Free Software Foundation. # # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # from zope.interface import Interface, Attribute try: # 2.10 from zope.lifecycleevent.interfaces import IObjectModifiedEvent except ImportError: from zope.app.event.objectevent import IObjectModifiedEvent class IAzaxCommands(Interface): 'Azax commands' def addCommand(self, name, selector=None): 'Add a command' def render(self, request): 'All methods must use this to return their command set' def getSelector(self, type, selector): 'Return selector' # more helpers for the basic selectors def getCssSelector(self, selector): 'Return selector' def getHtmlIdSelector(self, selector): 'Return selector' class IAzaxCommand(Interface): 'An Azax command' def addParam(self, name, content=''): 'Add the param as is' # # Some helpers # def addUnicodeParam(self, name, content=''): 'Add the param as unicode' def addStringParam(self, name, content='', encoding='utf'): 'Add the param as an encoded string, by default UTF-8' def addHtmlParam(self, name, content=''): 'Add the param as an HTML content.' def addXmlParam(self, name, content=''): 'Add the param as XML content' def addCdataParam(self, name, content=''): 'Add the param as a CDATA node' # -- # Accessors, not sure if we need them # -- def getName(self): '' def getSelector(self): '' def getSelectorType(self): '' def getParams(self): '' class IAzaxCommandView(Interface): 'View of a command set' def render(): 'This renders the command set' class IAzaxParam(Interface): 'An Azax parameter' def force_content_unicode(self): 'Content must be str with ascii encoding, or unicode' def getName(self): '' def getContent(self): '' class IAzaxView(Interface): #XXX document all interface def render(): '' class ICommandSet(Interface): 'Methods of this class implement a command set' def getCommandSet(self, name): 'Returns the command set for a given name' class IAzaxEvent(Interface): """Used to notify of events during an Ajax call This will normally be accompanied by another event.""" view = Attribute(u"The Azax view") event = Attribute(u"The orginal event")