If you think the Android project RadaeePDF-B4A listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.radaee.pdf;
/**//fromwww.java2s.com
class for PDF Book-mark database.
@author Radaee
@version 1.1
*/publicclass BMDatabase
{
privatestaticnativeint openAndCreate( String db_path );
privatestaticnativevoid close( int db );
privatestaticnativeint recOpen( int db, String look_path );
privatestaticnativevoid recClose( int rec );
privatestaticnativeint recGetCount( int rec );
privatestaticnative String recItemGetName( int rec, int index );
privatestaticnativeint recItemGetPage( int rec, int index );
privatestaticnativeboolean recItemRemove( int rec, int index );
privatestaticnativeboolean recItemInsert( int rec, String name, int pageno );
privateint m_hand = 0;
/**
* open exist database file or create it if not exist. (Database for BookMark)
* @param db_path
* @return
*/publicboolean OpenOrCreate( String db_path )
{
m_hand = openAndCreate( db_path );
return (m_hand != 0);
}
/**
* close database
*/publicvoid Close()
{
close( m_hand );
m_hand = 0;
}
/**
* Get a RecordSet handle, by input PDF file path
* @param look_path PDF path to lookup.
* @return handle value of RecordSet.
*/publicint RecOpen( String look_path )
{
return recOpen( m_hand, look_path );
}
/**
* Close a RecordSet handle
* @param rec handle value of RecordSet. obtained by RecOpen
*/publicvoid RecClose( int rec )
{
recClose( rec );
}
/**
* Get items count of RecordSet.
* @param rec RecordSet Handle, obtained by RecOpen
* @return records count
*/publicint RecGetCount( int rec )
{
return recGetCount( rec );
}
/**
* Get item name by index.
* @param rec RecordSet Handle that returned by RecOpen
* @param index 0 based index value, range:[0, RecGetCount()-1]
* @return name of item.
*/public String RecItemGetName( int rec, int index )
{
return recItemGetName( rec, index );
}
/**
* Get page no by index.
* @param rec RecordSet Handle that returned by RecOpen
* @param index 0 based index value, range:[0, RecGetCount()-1]
* @return 0 based page NO.
*/publicint RecItemGetPage( int rec, int index )
{
return recItemGetPage( rec, index );
}
/**
* remove item by index.
* @param rec RecordSet Handle that returned by RecOpen
* @param index 0 based index value, range:[0, RecGetCount()-1]
* @return true or false.
*/publicboolean RecItemRemove( int rec, int index )
{
return recItemRemove( rec, index );
}
/**
* insert item.
* @param rec RecordSet Handle that returned by RecOpen
* @param name label of BookMark.
* @param pageno 0 based page no recorded.
* @return true or false
*/publicboolean RecItemInsert( int rec, String name, int pageno )
{
return recItemInsert( rec, name, pageno );
}
}