AxResourceLibrary Class Reference

#include <ax_resource/ax_resource_library.h>

List of all members.

Public Member Functions

 AxResourceLibrary ()
 AxResourceLibrary (const AxResourceLibrary &library)
 ~AxResourceLibrary ()
void Init ()
void operator= (const AxResourceLibrary &library)
void Copy (const AxResourceLibrary &library)
virtual bool Initialize ()
 Initialize modules etc.
virtual bool Uninitialize ()
 Uninitialize modules etc.
virtual void CreateFullWorkingSet ()
 Create a working set from the currently loaded books.
virtual void CreateFullWorkingSet (AxResourceSet &workingSet)
virtual void CreateWorkingSetFromSearch (const wxString &field, const wxString &value, int flags=axSEARCH_EXACT_MATCH)
 Create a working set from a specification.
virtual void CreateWorkingSetFromSearch (AxResourceSet &workingSet, const wxString &field, const wxString &value, int flags=axSEARCH_EXACT_MATCH)
virtual void ApplySearchToWorkingSet (const wxString &field, const wxString &value, int flags)
 Apply search to current working set.
virtual void ApplySearchToWorkingSet (AxResourceSet &workingSet, const wxString &field, const wxString &value, int flags)
virtual bool Match (AxResource &resource, const wxString &field, const wxString &value, int flags)
 Match?
virtual bool RefreshAll ()
 Refresh the display using current settings TODO reflect current settings!
virtual bool LoadFromFolder (const wxString &folder, bool clearFirst=true, bool checkIfFileLoaded=false)
 Load books from a folder.
virtual bool LoadFromFolder (AxResourceInfoArray &books, const wxString &folder, bool clearFirst=true, bool checkIfFileLoaded=false, bool allocId=true)
virtual bool LoadFromFolders (const wxArrayString &folders, bool clearFirst=true, bool checkIfFileLoaded=false)
 Load books from a set of folders.
virtual bool RefreshLibrary (bool clearAll, bool interactive, wxWindow *parent=NULL)
 Refresh the library.
virtual bool LoadLibrary ()
 Load the library.
virtual bool SaveLibrary (bool forceConsolidatedWrite=false)
 Save the library.
virtual AxResourceCreateResourceFromFile (const wxString &filename)
 Load resource from file.
bool AggregateFiles (AxResourceInfoArray &books, wxArrayString &files, bool checkIfFileLoaded, bool allocId)
 Aggregate any files that belong together and add to books.
bool LoadImageFromCoverDesign (AxResourceInfo &info, const wxSize &thumbnailImageSize)
 Load image from cover book or default design.
int AddResource (AxResource *resource)
 Add resource.
int AddResource (AxResourceInfo &info, bool isNew)
 Add resource.
bool RemoveSelectedBooks (bool interactive=true, wxWindow *win=NULL)
 Remove resources from library.
bool RemoveResource (int sel, bool interactive=true, wxWindow *win=NULL)
 Remove resource from library.
bool PurgeDeletedFiles ()
 Purge files that no longer exist.
bool RecursivelyFindFiles (const wxString &folder, AxFolders &folders)
 Recursively find all supported files.
bool LoadEpubBookInfo (const wxString &filename, AxResourceInfo &info, bool makeThumbnail, const wxSize &thumbnailImageSize, bool &foundCoverImage)
 Load information from epub file.
bool IsFileSupported (const wxString &filename) const
 Is this file supported?
bool IsFileInIndex (const wxString &filename) const
 Is this file in the index?
bool IsFileInIndex (const AxResourceInfoArray &books, const wxString &filename) const
int FindByFile (const wxString &filename) const
 Find by file.
int FindByFile (const AxResourceInfoArray &books, const wxString &filename) const
AxResourceInfoFindByRecordIdentifier (long id) const
 Find by unique record identifier.
wxString CreateHtmlSummary (AxResourceInfo &info, const wxColour &backgroundColour, const wxColour &textColour)
 Write HTML summary for this book.
wxString CreateHtmlBlankSummary (const wxColour &backgroundColour, const wxColour &textColour)
 Write HTML blank page.
int CompareItems (AxResource &item1, AxResource &item2, int col)
 Compare two items for sorting purposes.
int CompareItemsHelper (AxResource &item1, AxResource &item2, int col)
virtual void Sort (int col)
 Sort the working set.
void UpdateSelectedBookInfo (int idx, bool forceClear=false)
 Update main panel according to current document.
virtual bool Read (wxInputStream &stream, wxDataInputStream &dataStream, int flags=0)
virtual bool Write (wxOutputStream &stream, wxDataOutputStream &dataStream, int flags=0)
virtual bool Read (const wxString &filename, int flags=0)
virtual bool Write (const wxString &filename, int flags=0)
virtual bool CanWriteChangesSeparately (int percentageThreshold=20)
 Decide whether we can save modifications seperately, or whether we should write out the whole file and delete the modifications file.
virtual void Clear ()
 Clear all.
long GetLastIdentifier () const
 Get/set last (highest) identifier.
void SetLastIdentifier (long id)
long AllocateNewIdentifier ()
 Allocate new identifier.
const AxResourceInfoArray & GetBooks () const
 Get books.
AxResourceInfoArray & GetBooks ()
bool GetModified () const
 Get/set modified flag.
void SetModified (bool mod)
wxArrayString & GetCurrentAuthors ()
 Get the current keyword arrays.
wxArrayString & GetCurrentPublishers ()
wxArrayString & GetCurrentSubjects ()
wxArrayString & GetCurrentFormats ()
void AddToCurrentAuthors (const wxString &author)
 Add to current keyword arrays.
void AddToCurrentPublishers (const wxString &publisher)
void AddToCurrentSubjects (const wxString &subject)
void AddToCurrentFormats (const wxString &format)
void AddCurrentInfo (const AxResourceInfo &info)
 Add to current author etc. arrays.
int GetSelection () const
 Get selected item (index into the array of books).
AxResourceInfoGetSelectedBook () const
 Get selected item (index into the array of books).
void SetSelection (int sel, bool select=true)
 Set selection.
void SetSingleSelection (int sel)
 Set single selection, clearing others.
void ClearSelections ()
 Clear selections.
bool GetSelections (wxArrayInt &selections)
 Get all selections.
void DisableProcessing (bool disable)
bool IsProcessingDisabled () const
bool DoSearch (const wxString &searchText)
 Perform a search.
const wxSize & GetSummaryCoverSize () const
 Set/get cover summary/thumbnail sizes.
const wxSize & GetThumbnailCoverSize () const
void SetSummaryCoverSize (const wxSize &sz)
void SetThumbnailCoverSize (const wxSize &sz)
int GetSortByCol () const
 Set/get column to sort on.
void SetSortByCol (int col)
bool UploadFiles (wxWindow *parent)
 Upload files.
bool CanUploadFiles () const
 Can upload files?
void SetSettings (const AxResourceLibrarySettings &settings)
 Set settings.
AxResourceLibrarySettingsGetSettings ()
 Get settings.
const AxResourceLibrarySettingsGetSettings () const
void SetCommandManager (wxEditorCommandManager *manager)
 Set//get the optional command manager object that can be used to launch viewers.
wxEditorCommandManagerGetCommandManager () const

Static Public Member Functions

static AxResourceLibraryGetResourceLibrary ()
 Gets the (one) instance of the manager.


Constructor & Destructor Documentation

AxResourceLibrary::AxResourceLibrary (  )  [inline]

AxResourceLibrary::AxResourceLibrary ( const AxResourceLibrary library  )  [inline]

AxResourceLibrary::~AxResourceLibrary (  ) 


Member Function Documentation

void AxResourceLibrary::Init (  ) 

void AxResourceLibrary::operator= ( const AxResourceLibrary library  )  [inline]

void AxResourceLibrary::Copy ( const AxResourceLibrary library  ) 

bool AxResourceLibrary::Initialize (  )  [virtual]

Initialize modules etc.

bool AxResourceLibrary::Uninitialize (  )  [virtual]

Uninitialize modules etc.

static AxResourceLibrary* AxResourceLibrary::GetResourceLibrary (  )  [inline, static]

Gets the (one) instance of the manager.

void AxResourceLibrary::CreateFullWorkingSet (  )  [virtual]

Create a working set from the currently loaded books.

void AxResourceLibrary::CreateFullWorkingSet ( AxResourceSet workingSet  )  [virtual]

void AxResourceLibrary::CreateWorkingSetFromSearch ( const wxString &  field,
const wxString &  value,
int  flags = axSEARCH_EXACT_MATCH 
) [virtual]

Create a working set from a specification.

If field is empty, allow any field to match

void AxResourceLibrary::CreateWorkingSetFromSearch ( AxResourceSet workingSet,
const wxString &  field,
const wxString &  value,
int  flags = axSEARCH_EXACT_MATCH 
) [virtual]

void AxResourceLibrary::ApplySearchToWorkingSet ( const wxString &  field,
const wxString &  value,
int  flags 
) [virtual]

Apply search to current working set.

void AxResourceLibrary::ApplySearchToWorkingSet ( AxResourceSet workingSet,
const wxString &  field,
const wxString &  value,
int  flags 
) [virtual]

bool AxResourceLibrary::Match ( AxResource resource,
const wxString &  field,
const wxString &  value,
int  flags 
) [virtual]

Match?

bool AxResourceLibrary::RefreshAll (  )  [virtual]

Refresh the display using current settings TODO reflect current settings!

bool AxResourceLibrary::LoadFromFolder ( const wxString &  folder,
bool  clearFirst = true,
bool  checkIfFileLoaded = false 
) [virtual]

Load books from a folder.

bool AxResourceLibrary::LoadFromFolder ( AxResourceInfoArray &  books,
const wxString &  folder,
bool  clearFirst = true,
bool  checkIfFileLoaded = false,
bool  allocId = true 
) [virtual]

bool AxResourceLibrary::LoadFromFolders ( const wxArrayString &  folders,
bool  clearFirst = true,
bool  checkIfFileLoaded = false 
) [virtual]

Load books from a set of folders.

bool AxResourceLibrary::RefreshLibrary ( bool  clearAll,
bool  interactive,
wxWindow *  parent = NULL 
) [virtual]

Refresh the library.

bool AxResourceLibrary::LoadLibrary (  )  [virtual]

Load the library.

bool AxResourceLibrary::SaveLibrary ( bool  forceConsolidatedWrite = false  )  [virtual]

Save the library.

AxResource * AxResourceLibrary::CreateResourceFromFile ( const wxString &  filename  )  [virtual]

Load resource from file.

bool AxResourceLibrary::AggregateFiles ( AxResourceInfoArray &  books,
wxArrayString &  files,
bool  checkIfFileLoaded,
bool  allocId 
)

Aggregate any files that belong together and add to books.

bool AxResourceLibrary::LoadImageFromCoverDesign ( AxResourceInfo info,
const wxSize &  thumbnailImageSize 
)

Load image from cover book or default design.

int AxResourceLibrary::AddResource ( AxResource resource  ) 

Add resource.

int AxResourceLibrary::AddResource ( AxResourceInfo info,
bool  isNew 
)

Add resource.

bool AxResourceLibrary::RemoveSelectedBooks ( bool  interactive = true,
wxWindow *  win = NULL 
)

Remove resources from library.

bool AxResourceLibrary::RemoveResource ( int  sel,
bool  interactive = true,
wxWindow *  win = NULL 
)

Remove resource from library.

bool AxResourceLibrary::PurgeDeletedFiles (  ) 

Purge files that no longer exist.

bool AxResourceLibrary::RecursivelyFindFiles ( const wxString &  folder,
AxFolders &  folders 
)

Recursively find all supported files.

bool AxResourceLibrary::LoadEpubBookInfo ( const wxString &  filename,
AxResourceInfo info,
bool  makeThumbnail,
const wxSize &  thumbnailImageSize,
bool &  foundCoverImage 
)

Load information from epub file.

bool AxResourceLibrary::IsFileSupported ( const wxString &  filename  )  const

Is this file supported?

bool AxResourceLibrary::IsFileInIndex ( const wxString &  filename  )  const

Is this file in the index?

bool AxResourceLibrary::IsFileInIndex ( const AxResourceInfoArray &  books,
const wxString &  filename 
) const

int AxResourceLibrary::FindByFile ( const wxString &  filename  )  const

Find by file.

int AxResourceLibrary::FindByFile ( const AxResourceInfoArray &  books,
const wxString &  filename 
) const

AxResourceInfo * AxResourceLibrary::FindByRecordIdentifier ( long  id  )  const

Find by unique record identifier.

wxString AxResourceLibrary::CreateHtmlSummary ( AxResourceInfo info,
const wxColour &  backgroundColour,
const wxColour &  textColour 
)

Write HTML summary for this book.

wxString AxResourceLibrary::CreateHtmlBlankSummary ( const wxColour &  backgroundColour,
const wxColour &  textColour 
)

Write HTML blank page.

int AxResourceLibrary::CompareItems ( AxResource item1,
AxResource item2,
int  col 
)

Compare two items for sorting purposes.

int AxResourceLibrary::CompareItemsHelper ( AxResource item1,
AxResource item2,
int  col 
)

void AxResourceLibrary::Sort ( int  col  )  [virtual]

Sort the working set.

void AxResourceLibrary::UpdateSelectedBookInfo ( int  idx,
bool  forceClear = false 
)

Update main panel according to current document.

bool AxResourceLibrary::Read ( wxInputStream stream,
wxDataInputStream dataStream,
int  flags = 0 
) [virtual]

bool AxResourceLibrary::Write ( wxOutputStream stream,
wxDataOutputStream dataStream,
int  flags = 0 
) [virtual]

bool AxResourceLibrary::Read ( const wxString &  filename,
int  flags = 0 
) [virtual]

bool AxResourceLibrary::Write ( const wxString &  filename,
int  flags = 0 
) [virtual]

bool AxResourceLibrary::CanWriteChangesSeparately ( int  percentageThreshold = 20  )  [virtual]

Decide whether we can save modifications seperately, or whether we should write out the whole file and delete the modifications file.

void AxResourceLibrary::Clear (  )  [virtual]

Clear all.

long AxResourceLibrary::GetLastIdentifier (  )  const [inline]

Get/set last (highest) identifier.

void AxResourceLibrary::SetLastIdentifier ( long  id  )  [inline]

long AxResourceLibrary::AllocateNewIdentifier (  ) 

Allocate new identifier.

const AxResourceInfoArray& AxResourceLibrary::GetBooks (  )  const [inline]

Get books.

AxResourceInfoArray& AxResourceLibrary::GetBooks (  )  [inline]

bool AxResourceLibrary::GetModified (  )  const [inline]

Get/set modified flag.

void AxResourceLibrary::SetModified ( bool  mod  )  [inline]

wxArrayString& AxResourceLibrary::GetCurrentAuthors (  )  [inline]

Get the current keyword arrays.

wxArrayString& AxResourceLibrary::GetCurrentPublishers (  )  [inline]

wxArrayString& AxResourceLibrary::GetCurrentSubjects (  )  [inline]

wxArrayString& AxResourceLibrary::GetCurrentFormats (  )  [inline]

void AxResourceLibrary::AddToCurrentAuthors ( const wxString &  author  ) 

Add to current keyword arrays.

void AxResourceLibrary::AddToCurrentPublishers ( const wxString &  publisher  ) 

void AxResourceLibrary::AddToCurrentSubjects ( const wxString &  subject  ) 

void AxResourceLibrary::AddToCurrentFormats ( const wxString &  format  ) 

void AxResourceLibrary::AddCurrentInfo ( const AxResourceInfo info  ) 

Add to current author etc. arrays.

int AxResourceLibrary::GetSelection (  )  const [inline]

Get selected item (index into the array of books).

AxResourceInfo * AxResourceLibrary::GetSelectedBook (  )  const

Get selected item (index into the array of books).

void AxResourceLibrary::SetSelection ( int  sel,
bool  select = true 
)

Set selection.

void AxResourceLibrary::SetSingleSelection ( int  sel  ) 

Set single selection, clearing others.

void AxResourceLibrary::ClearSelections (  ) 

Clear selections.

bool AxResourceLibrary::GetSelections ( wxArrayInt &  selections  ) 

Get all selections.

void AxResourceLibrary::DisableProcessing ( bool  disable  )  [inline]

bool AxResourceLibrary::IsProcessingDisabled (  )  const [inline]

bool AxResourceLibrary::DoSearch ( const wxString &  searchText  ) 

Perform a search.

const wxSize& AxResourceLibrary::GetSummaryCoverSize (  )  const [inline]

Set/get cover summary/thumbnail sizes.

const wxSize& AxResourceLibrary::GetThumbnailCoverSize (  )  const [inline]

void AxResourceLibrary::SetSummaryCoverSize ( const wxSize &  sz  )  [inline]

void AxResourceLibrary::SetThumbnailCoverSize ( const wxSize &  sz  )  [inline]

int AxResourceLibrary::GetSortByCol (  )  const [inline]

Set/get column to sort on.

void AxResourceLibrary::SetSortByCol ( int  col  )  [inline]

bool AxResourceLibrary::UploadFiles ( wxWindow *  parent  ) 

Upload files.

bool AxResourceLibrary::CanUploadFiles (  )  const

Can upload files?

void AxResourceLibrary::SetSettings ( const AxResourceLibrarySettings settings  )  [inline]

Set settings.

AxResourceLibrarySettings& AxResourceLibrary::GetSettings (  )  [inline]

Get settings.

const AxResourceLibrarySettings& AxResourceLibrary::GetSettings (  )  const [inline]

void AxResourceLibrary::SetCommandManager ( wxEditorCommandManager manager  )  [inline]

Set//get the optional command manager object that can be used to launch viewers.

TODO: consider replacing with a virtual function that can be overridden by a derived library class. However, we may wish to give all resource handling functionality more than just 'launch this file'.

wxEditorCommandManager* AxResourceLibrary::GetCommandManager (  )  const [inline]


The documentation for this class was generated from the following files:
Generated on Wed May 6 19:20:21 2009 for AxTk by  doxygen 1.5.1