/*
 * 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.List;
import java.util.Locale;
import java.util.TimeZone;
import com.silverwrist.venice.except.AccessError;
import com.silverwrist.venice.except.DataException;
import com.silverwrist.venice.except.EmailException;

public interface UserContext extends SearchMode
{
  public abstract int getUID();

  public abstract String getUserName();

  public abstract int getContactID();

  public abstract String getDescription();

  public abstract boolean isLoggedIn();

  public abstract boolean isEmailVerified();

  public abstract void authenticate(String username, String password)
      throws AccessError, DataException;

  public abstract void confirmEmail(int conf_num) throws AccessError, DataException;

  public abstract void resendEmailConfirmation() throws DataException, EmailException;

  public abstract ContactInfo getContactInfo() throws DataException;

  public abstract boolean putContactInfo(ContactInfo ci) throws DataException, EmailException;

  public abstract UserProfile getProfile(String xusername) throws DataException;

  public abstract UserProfile getProfile(int xuid) throws DataException;

  public abstract void setPassword(String password, String reminder) throws DataException;

  public abstract void setDescription(String new_descr) throws DataException;

  public abstract List getMemberCommunities() throws DataException;

  public abstract CommunityContext getCommunityContext(int cid) throws DataException;

  public abstract CommunityContext getCommunityContext(String alias) throws DataException;

  public abstract List getRootCategoryList() throws DataException;

  public abstract CategoryDescriptor getCategoryDescriptor(int catid) throws DataException;

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

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

  public abstract List getCommunitiesInCategory(int catid, int offset, int count) throws DataException;

  public abstract List getCommunitiesInCategory(CategoryDescriptor cat, int offset, int count)
      throws DataException;

  public abstract int getNumCommunitiesInCategory(int catid) throws DataException;

  public abstract int getNumCommunitiesInCategory(CategoryDescriptor cat) throws DataException;

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

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

  public abstract CommunityContext createCommunity(String name, String alias, String language, String synopsis,
						   String rules, String joinkey, int hide_mode)
      throws DataException, AccessError;

  public abstract boolean canCreateCommunity();

  public abstract List getSideBoxList() throws DataException;

  public abstract void addSideBox(int id) throws DataException;

  public abstract List getConferenceHotlist() throws DataException;

  public abstract boolean hasAdminAccess();

  public abstract AdminOperations getAdminInterface() throws AccessError;

  public abstract Locale getLocale() throws DataException;

  public abstract void setLocale(Locale locale) throws DataException;

  public abstract TimeZone getTimeZone() throws DataException;

  public abstract void setTimeZone(TimeZone timezone) throws DataException;

  public abstract String getAuthenticationToken() throws AccessError, DataException;

  public abstract boolean authenticateWithToken(String token) throws DataException;

  public abstract Advertisement selectAd();

  public abstract boolean displayPostPictures() throws DataException;

  public abstract UserProperties getProperties() throws DataException;

  public abstract void setProperties(UserProperties props) throws DataException;

  public abstract boolean canSetUserPhoto() throws DataException;

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

  public abstract int getSearchPostCount(String search_terms) throws DataException;

} // end interface UserContext

