/*
 * 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@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.venice.core;

import java.util.BitSet;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.silverwrist.venice.except.AccessError;
import com.silverwrist.venice.except.DataException;
import com.silverwrist.venice.except.EmailException;

public interface CommunityContext extends SearchMode
{
  public static final int HIDE_NONE = 0;
  public static final int HIDE_DIRECTORY = 1;
  public static final int HIDE_BOTH = 2;

  public abstract int getCommunityID();

  public abstract String getName();

  public abstract String getAlias();

  public abstract boolean isMember();

  public abstract boolean isAdmin();

  public abstract boolean isPublicCommunity();

  public abstract int getCategoryID();

  public abstract CategoryDescriptor getCategory() throws DataException;

  public abstract String getSynopsis();

  public abstract int getHostUID();

  public abstract UserProfile getHostProfile() throws DataException;

  public abstract String getLanguageCode();

  public abstract String getLanguageFullName();

  public abstract String getRules();

  public abstract Date getCreationDate();

  public abstract Date getLastAccessDate();

  public abstract Date getLastUpdateDate();

  public abstract ContactInfo getContactInfo() throws DataException;

  public abstract void putContactInfo(ContactInfo ci) throws DataException, AccessError;

  public abstract Set getServices();

  public abstract Set getConfiguredServices();

  public abstract void setServiceEnable(ServiceToken token, boolean enable) throws AccessError, DataException;

  public abstract void setName(String name) throws DataException, AccessError;

  public abstract void setAlias(String alias) throws DataException, AccessError;

  public abstract void setCategoryID(int catid) throws DataException, AccessError;

  public abstract void setCategory(CategoryDescriptor cat) throws DataException, AccessError;

  public abstract void setSynopsis(String synopsis) throws DataException, AccessError;

  public abstract void setLanguage(String language) throws DataException, AccessError;

  public abstract void setRules(String rules) throws DataException, AccessError;

  public abstract int getHideMode();

  public abstract void setHideMode(int mode) throws DataException, AccessError;

  public abstract boolean getMembersOnly();

  public abstract void setMembersOnly(boolean flag) throws DataException, AccessError;

  public abstract ServiceToken getDefaultService();

  public abstract void setDefaultService(ServiceToken token) throws AccessError, DataException;

  public abstract String getJoinKey() throws DataException, AccessError;

  public abstract void setJoinKey(String key) throws DataException, AccessError;

  public abstract int getReadLevel() throws DataException, AccessError;

  public abstract int getWriteLevel() throws DataException, AccessError;

  public abstract int getCreateLevel() throws DataException, AccessError;

  public abstract int getDeleteLevel() throws DataException, AccessError;

  public abstract int getJoinLevel() throws DataException, AccessError;

  public abstract void setSecurityLevels(int read, int write, int create, int delete, int join)
      throws DataException, AccessError;

  public abstract boolean canAdministerCommunity();

  public abstract boolean canModifyProfile();

  public abstract boolean isAdminCommunity();

  public abstract void join(String joinkey) throws DataException, AccessError;

  public abstract void unjoin() throws DataException, AccessError;

  public abstract int getMemberCount() throws DataException;

  public abstract boolean canUnjoin();

  public abstract boolean canJoin();

  public abstract List getConferences() throws DataException, AccessError;

  public abstract ConferenceContext getConferenceContext(int confid) throws DataException, AccessError;

  public abstract ConferenceContext getConferenceContext(String alias) throws DataException, AccessError;

  public abstract ConferenceContext createConference(String name, String alias, String description,
						     boolean pvt, boolean hide_list)
      throws DataException, AccessError;

  public abstract boolean canCreateConference();

  public abstract List searchForMembers(int field, int mode, String term, int offset, int count)
      throws DataException;

  public abstract int getSearchMemberCount(int field, int mode, String term) throws DataException;

  public abstract List getMemberList() throws DataException;

  public abstract boolean canManageConferences();

  public abstract int getMemberLevel(int uid) throws DataException, AccessError;

  public abstract void setMembership(int uid, int new_level)
      throws DataException, AccessError;

  public abstract boolean canDelete();

  public abstract void delete() throws DataException, AccessError;

  public abstract void deleteCommunity() throws DataException, AccessError;

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

  public abstract boolean canSendInvitation();

  public abstract List getAuditRecords(int offset, int count) throws AccessError, DataException;

  public abstract int getAuditRecordCount() throws AccessError, DataException;

  public abstract CommunityProperties getProperties() throws DataException, AccessError;

  public abstract void setProperties(CommunityProperties props) throws DataException, AccessError;

  public abstract SecurityInfo getSecurityInfo();

  public abstract boolean canMassMail();

  public abstract void massMail(String subject, String text) throws AccessError, DataException;

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

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

} // end interface CommunityContext
