/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.venice.core;

import java.util.Date;
import java.util.List;
import com.silverwrist.venice.except.AccessError;
import com.silverwrist.venice.except.DataException;
import com.silverwrist.venice.except.EmailException;
import com.silverwrist.venice.htmlcheck.HTMLChecker;

public interface TopicContext
{
  // Modes for postNewMessage()
  public static final int POST_MODE_NORMAL = 0;
  public static final int POST_MODE_EMAIL = 1;

  public void refresh() throws DataException;

  public int getTopicID();

  public short getTopicNumber();

  public String getName();

  public int getUnreadMessages();

  public int getTotalMessages();

  public Date getLastUpdateDate();

  public int getCreatorUID();

  public boolean isFrozen();

  public boolean isArchived();

  public boolean isSticky();

  public Date getCreatedDate();

  public boolean isHidden();

  public boolean isDeleted();

  public boolean canFreeze();

  public boolean canArchive();

  public boolean canStick();

  public void setFrozen(boolean flag) throws DataException, AccessError;

  public void setArchived(boolean flag) throws DataException, AccessError;

  public void setSticky(boolean flag) throws DataException, AccessError;

  public void setHidden(boolean flag) throws DataException;

  public int getFirstUnreadMessage();

  public void setUnreadMessages(int count) throws DataException;

  public void fixSeen() throws DataException;

  public List getMessages(int low, int high) throws DataException, AccessError;

  public TopicMessageContext getMessage(int number) throws DataException, AccessError;

  public TopicMessageContext postNewMessage(long parent, String pseud, String text, int mode)
      throws DataException, AccessError;

  public TopicMessageContext postNewMessage(long parent, String pseud, String text)
      throws DataException, AccessError;

  public HTMLChecker getPreviewChecker();

  public boolean canDelete();

  public void delete() throws DataException, AccessError;

  public void deleteTopic() throws DataException, AccessError;

  public List getActivePosters(int skip, int limit) throws DataException, AccessError;

  public List getActivePosters(int limit) throws DataException, AccessError;

  public List getActivePosters() throws DataException, AccessError;

  public List getActiveReaders(int skip, int limit) throws DataException, AccessError;

  public List getActiveReaders(int limit) throws DataException, AccessError;

  public List getActiveReaders() throws DataException, AccessError;

  public boolean isBozo(int other_uid) throws DataException;

  public void setBozo(int other_uid, boolean bozo) throws DataException;

  public boolean canSetBozo(int other_uid);

  public List getBozos() throws DataException;

  public boolean isSubscribed();

  public void setSubscribed(boolean flag) throws DataException;

  public void sendInvitation(String address, String personal_message)
      throws AccessError, DataException, EmailException;

  public boolean canSendInvitation();

  public void sendMailToParticipants(boolean posters, int day_limit, String subject, String text)
      throws AccessError, DataException;

  public List searchPosts(String search_terms, int offset, int count)
      throws AccessError, DataException;

  public int getSearchPostCount(String search_terms) throws AccessError, DataException;

  public ConferenceContext getEnclosingConference();

  public String getPostLink() throws DataException;

} // end interface TopicContext
