/*
 * 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.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 int getCommunityID();

  public String getName();

  public String getAlias();

  public boolean isMember();

  public boolean isAdmin();

  public boolean isPublicCommunity();

  public int getCategoryID();

  public CategoryDescriptor getCategory() throws DataException;

  public String getSynopsis();

  public int getHostUID();

  public UserProfile getHostProfile() throws DataException;

  public String getLanguageCode();

  public String getLanguageFullName();

  public String getRules();

  public Date getCreationDate();

  public Date getLastAccessDate();

  public Date getLastUpdateDate();

  public ContactInfo getContactInfo() throws DataException;

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

  public Set getServices();

  public Set getConfiguredServices();

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

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

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

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

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

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

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

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

  public CommunityHideMode getHideMode();

  public void setHideMode(CommunityHideMode mode) throws DataException, AccessError;

  public boolean getMembersOnly();

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

  public ServiceToken getDefaultService();

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

  public String getJoinKey() throws DataException, AccessError;

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

  public int getReadLevel() throws DataException, AccessError;

  public int getWriteLevel() throws DataException, AccessError;

  public int getCreateLevel() throws DataException, AccessError;

  public int getDeleteLevel() throws DataException, AccessError;

  public int getJoinLevel() throws DataException, AccessError;

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

  public boolean canAdministerCommunity();

  public boolean canModifyProfile();

  public boolean isAdminCommunity();

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

  public void unjoin() throws DataException, AccessError;

  public int getMemberCount() throws DataException;

  public boolean canUnjoin();

  public boolean canJoin();

  public List getConferences() throws DataException, AccessError;

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

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

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

  public boolean canCreateConference();

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

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

  public List getMemberList() throws DataException;

  public boolean canManageConferences();

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

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

  public boolean canDelete();

  public void delete() throws DataException, AccessError;

  public void deleteCommunity() throws DataException, AccessError;

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

  public boolean canSendInvitation();

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

  public int getAuditRecordCount() throws AccessError, DataException;

  public CommunityProperties getProperties() throws DataException, AccessError;

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

  public SecurityInfo getSecurityInfo();

  public boolean canMassMail();

  public void massMail(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;

} // end interface CommunityContext
