from zope.interface import Interface, Attribute

class ISilvaBlog(Interface):
    """Silva Blog"""
    
    comments_allowed = Attribute("Set to true if discussion is allowed for comments")
    def get_current_items(month=None, year=None):
        """get the currently published items for this blog"""
    
    def get_recent_article():
        """ get the last, published blog article """
    
    def get_editable_items(month, year):
        """get the current items for this blog"""
    
    def get_processed_items(month, year):
        """helper method overridden from ViewCode for tab_edit to
           provide a set of dicts
        """
    def get_processed_status_tree(status, offset, limit=25):
        """ XXX undocumented"""
    
    def get_categories():
        """return list of categories for all blog articles"""
    
    def get_articles_for_category(category):
        """return a list of ISilvaBlogArticle objects published under
           subject otherwise return all ISilvaBlogArticles
        """
    def get_archive():
        """returns a dictionary with:
            keys: years
            values: months (list)
           under which articles are published
        """
    def get_archived_months(currentyear):
        """Returns a list of tuples in which months articles where published"""
    
    def get_blog():
        """returns self"""
    
    def get_categories():
        """returns the categories the article is published under,
           None otherwise
        """

class ISilvaBlogArticle(Interface):
    """Silva Blog Article"""

    def get_categories():
        """returns the categories the article is published under,
           None otherwise
        """
    def get_article():
        """returns the written SilvaDocument"""

    def get_comments():
        """returns comments posted for this article"""

    def version_status():
        """Returns version status of the article.
           Note: Delegates to Silva Document version_status
        """

class ISilvaBlogEntry(Interface):
    """An entry in a Silva Blog Article"""

class ISilvaBlogComment(Interface):
    """Silva Blog Comment"""

    def updateComment():
        """updates comment values"""

##########
# adapters

class IBlog(Interface):
    
    def get_current_items(month=None, year=None):
        """get the current items for this blog"""
    
    def get_processed_items(month=None, year=None):
        """helper method overridden from ViewCode for tab_edit to
           provide a set of dicts
        """

class IBlogArticle(Interface):

    def get_processed_items():
        """helper method overridden from ViewCode for tab_edit to
           provide a set of dicts
        """

class IBlogCategory(Interface):
    """A category adapter for SilvaBlog"""

    def get_categories():
        """ returns the categories the blog is published under,
            empty string otherwise
        """

class IRSSFeed(Interface):
    """Adapter class to provide RSS 1.0 export"""

    def rss(REQUEST):
        """Return the contents of this viewer as an RSS/RDF (RSS 1.0) feed"""

