package jpos;

import jpos.events.*;

public interface HardTotalsControl12 extends BaseControl
{
    // Capabilities
    public boolean getCapErrorDetection() throws JposException;
    public boolean getCapSingleFile() throws JposException;
    public boolean getCapTransactions() throws JposException;

    // Properties
    public int     getFreeData() throws JposException;
    public int     getNumberOfFiles() throws JposException;
    public int     getTotalsSize() throws JposException;
    public boolean getTransactionInProgress() throws JposException;

    // Methods
    public void    beginTrans() throws JposException;
    public void    claimFile(int hTotalsFile, int timeout)
                       throws JposException;
    public void    commitTrans() throws JposException;
    public void    create(String fileName, int[] pHTotalsFile, int size,
                       boolean errorDetection) throws JposException;
    public void    delete(String fileName) throws JposException;
    public void    find(String fileName, int[] pHTotalsFile, int[] pSize)
                       throws JposException;
    public void    findByIndex(int index, String[] pFileName)
                       throws JposException;
    public void    read(int hTotalsFile, byte[] pData, int offset,
                       int count) throws JposException;
    public void    recalculateValidationData(int hTotalsFile)
                       throws JposException;
    public void    releaseFile(int hTotalsFile) throws JposException;
    public void    rename(int hTotalsFile, String fileName)
                       throws JposException;
    public void    rollback() throws JposException;
    public void    setAll(int hTotalsFile, int value) throws JposException;
    public void    validateData(int hTotalsFile) throws JposException;
    public void    write(int hTotalsFile, byte[] data, int offset, int count)
                       throws JposException;

    // Event listener methods
    public void    addDirectIOListener(DirectIOListener l);
    public void    removeDirectIOListener(DirectIOListener l);
}