/*
**  MyLibrary.h
**
**  Copyright (c) 2004
**
**  Author: Yen-Ju Chen <yjchenx@hotmail.com>
**
**  This program is free software; you can redistribute it and/or modify
**  it under the terms of the GNU General Public License as published by
**  the Free Software Foundation; either version 2 of the License, or
**  (at your option) any later version.
**
**  This program is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef __MyDocument__
#define __MyDocument__

#include <AppKit/AppKit.h>

@class IconTableView;
@class NoteTextView;
@class Sources;
@class LibrarySource;
@class SearchSource;
@class Criterion;
@class CriterionView;
@class AttributesSource;

@interface MyLibrary : NSObject
{
  /* outliet */
  IBOutlet NSWindow *mainWindow;
  IBOutlet NSSplitView *sourceSplitView;
  IBOutlet NSSplitView *itemSplitView;
  IBOutlet IconTableView *sourceTableView;
  IBOutlet NSTableView *itemTableView;
  IBOutlet NSTextField *titleTextField;
  IBOutlet NoteTextView *noteTextView;

  NSToolbar *toolbar;
  NSToolbarItem *searchToolbarItem;

  /* Libraries */
  NSString *libraryPath;
  Sources *sources;
  LibrarySource *librarySource;
  SearchSource *searchSource;
  AttributesSource *attributesSource;

  /* criterion */
  CriterionView *searchView;
  Criterion *searchCriterion;

  /* file handling */
  BOOL terminateNormally;

  /* back and forward action */
  NSMutableArray *stack;
  unsigned int stack_index;
  BOOL stackAction;

  /* Sorting */
  NSComparisonResult titleSortingOrder, typeSortingOrder;

  /* Common object */
  NSFileManager *fm;
}

/* Menu actions */
- (void) mainLibraryAction: (id) sender;
- (void) newFolderAction: (id) sender;
- (void) newSmartFolderAction: (id) sender;
- (void) editSmartFolderAction: (id) sender;
- (void) newNoteAction: (id) sender;
- (void) editNoteAction: (id) sender;
- (void) importFileAction: (id) sender;
- (void) removeItemAction: (id) sender;
- (void) backAction: (id) sender;
- (void) forwardAction: (id) sender;
- (void) showFileAction: (id) sender;
- (void) searchBarAction: (id) sender;
- (void) summaryViewerAction: (id) sender;
- (void) indexingAction: (id) sender;
- (void) libraryLocationAction: (id) sender;

@end

#endif
