/*
**  Constants.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 __Constants__
#define __Constants__

#include <Foundation/NSString.h>
#include "GNUstep.h"

/* enum of ItemType */
typedef enum _ItemType {
  ItemErrorType = 999, /* Internal Error */
  ItemUnknownType = 0,
  ItemNoteType,
  ItemFileType
} ItemType;

/* enum of source type */
typedef enum _SourceType {
  SourceLibraryType = 0,
  SourceSearchType,
  SourceSmartFolderType,
  SourceFolderType,
  SourceNoteType,
  SourceUnknownType = 99,
  SourceErrorType = 999 /* Internal Error */
} SourceType;

/* Identify each GUI component */
enum GraphicComponentTag {
  SourceTableViewTag = 501,
  ItemTableViewTag = 601,
  NoteTextViewTag = 701
};

/* Summary style */
typedef enum _SummaryStyle {
  SummaryBriefStyle,
  SummaryRegularStyle,
  SummaryCompleteStyle
} SummaryStyle;

static NSString *CalendarDateDisplayFormat = @"%a, %b %d, %Y, %H:%M"; 
static NSString *CalendarDateMMDDYYYYInputFormat = @"(%m/%d/%Y %H:%M)";
static NSString *CalendarDateDDMMYYYYInputFormat = @"(%d/%m/%Y %H:%M)";
static NSString *CalendarDateYYYYMMDDInputFormat = @"(%Y/%m/%d %H:%M)";

/* User default */
static NSString *CalendarInputFormatDefault = @"CaneldarInputFormat";
static NSString *SearchBarIsVisible = @"SearchBarIsVisible";
static NSString *NoteTextViewEditable = @"NoteTextViewEditable";
static NSString *MKNMZLocationPath = @"MKNMZLocationPath";
static NSString *NamazuLocationPath = @"NamazuLocationPath";
static NSString *LibraryLocationPath = @"LibraryLocationPath";

/* File handling */
static NSString *SourcePlist = @"Source.plist";
static NSString *LibraryPlist = @"Library.plist";
static NSString *AttributesPlist = @"Attributes.plist";
static NSString *ContentIndexDirectory = @"Namazu_Index";

/* Drag and Drop */
static NSString *MultipleItemsPboardType = @"MultipleItemsPboardType";

/* Editing Time Stamp */
static NSString *LibraryEditedTimeStamp = @"LibraryEditedTimeStamp";

/* Toolbar */
static NSString *SearchToolbarIdentifier = @"SearchToolbarIdentifier";
static NSString *SearchToolbarItemIdentifier = @"SearchToolbarItemIdentifier";

/* File Information attributes */
static NSString *FileInfoCategory = @"File Information";
static NSString *FileInfoCreationDate = @"Creation Date";
static NSString *FileInfoModificationDate = @"Modification Date";
static NSString *FileInfoSize = @"File Size";
static NSString *FileInfoOwner = @"File Owner";

static NSString *RegularExpressionDisplayFloat1 = @"-0.99";
static NSString *REgularExpressionDisplayFloat2 = @"-0,99";

static NSString *RegularExpressionDisplayDate1 = @"MM/DD/YYYY";
static NSString *RegularExpressionDisplayDate2 = @"DD/MM/YYYY";
static NSString *RegularExpressionDisplayDate3 = @"YYYY/MM/DD";

/* Render */
typedef enum _WikiTagType {
  OtherTagType = 0,
  LinkTagType,
  FileTagType,
  UrefTagType,
  EmailTagType,
  NoteTagType,
  CautionTagType,
  InformationTagType,
  CodeTagType
} WikiTagType;

/* Exception name */
static NSString *RenderTextExceptionName = @"RenderTextExceptionName";

/* Exception reason */
static NSString *GeneralError = @"General Error";

/* Localization */
/* General */
#define sAppName _(@"MyLibrary")
#define sOK _(@"OK")
#define sCancel _(@"Cancel")
#define sQuit _(@"Quit")
#define sDontQuit _(@"Don't Quit")
#define sCancelAndQuit _(@"Cancel and Quit")
#define sWarning _(@"Warning !!!")
#define sRebuild _(@"Rebuild")
#define sYES _(@"Yes")
#define sNO _(@"No")

/* MyLibrary */
#define sCreateLibrary _(@"Create Library")
#define sLibraryWillBeCreated_ _(@"%@ will be created")
#define sFileError _(@"File Error")
#define sFileErrorCopy _(@"File Error (Copy)")
#define sFileErrorWrite _(@"File Error (Write)")
#define sFileErrorRemove _(@"File Error (Remove)")
#define sNotMakeBackup__ _(@"Can not make a backup file \"%@\".\nIt will not affect the use of %@.\nBut there will be no new backup for this file\n")
#define sCannotRemoveBackup__ _(@"Can not remove the previously created backup %@.\nIt will not affect the use of %@.\nBut there will be no new backup for this file.")
#define sFileNotExistWantBackup____ _(@"%@ %@ is not existed, but there is a backup.\nDo you want to restore %@ from this backup ?\nChoose \"No\" will create an empty %@.")
#define sLibraryCannotBeLoaded_ _(@"Library %@ cannot be loaded. Previous library will be loaded instead.")
#define sLibraryCannotBeCreated_ _(@"Library %@ cannot be created")
#define sCannotSaveLibrary_ _(@"Library %@ can not be saved.\nDo you still want to quit ?")
#define sLibraryCorrupted_ _(@"Library %@ may be corrupted or used by other applications")
#define sNotValidLibrary_ _(@"File %@ is not a valid library")
#define sSelectedItemRemoveFromHD _(@"The selected notes and files will be removed from hard disk")
#define sSourceNotValid_ _(@"Source %@ is not valid.\nDo you want to remove it and rebuild a new one ?\nYou will lost all your previous source list.\n")
#define sCannotRebuildSource_ _(@"Source %@ can not be reauld.")
#define sCannotSaveSource_ _(@"Source %@ can not be saved.")
#define sTitleError _(@"Title Error")
#define sDuplicatedTitle _(@"This title is already been used or reserved.\nPlease use another one.")
#define sCannotOpenFile_ _(@"File %@ can not be opened.")
#define sRemoveFolder_ _(@"Folder \"%@\" will be remove.")
#define sIndexDirectoryInvalid_ _(@"Index directory %@ is invalide.\nPlease remove it manually and try again.")

/* Sources */
#define sSource _(@"Source")
#define sLibrary _(@"Library")
#define sSearch _(@"Search")
#define sFolder _(@"Folder")
#define sSmartFolder _(@"Smart Folder")
#define sAttributes _(@"Attributes")

/* LibrarySource */
#define sNote _(@"Note")
#define sUnknown _(@"Unknown")
#define sHome _(@"Home")

/* Render.m */
#define sInvalidURL _(@"Invalid URL format")
#define sInvalidURLDescription_ _(@"\"%@\" is not a valid URL. Please revise it")

/* Attributes */
#define sFileInfo _(@"File Information")
#define sCreationDate _(@"Creation Date")
#define sModificationDate _(@"Modification Date")
#define sFileSize _(@"File Size (bytes)")
#define sOwner _(@"File Owner/Group")
#define sBytes _(@"bytes")

/* Criterion */
#define sAnyText _(@"Any Text")
#define sTitle _(@"Title")
#define sNote _(@"Note")
#define sFilename _(@"File Name")
#define sFiletype _(@"File Type")
#define sFileContent _(@"File Content")

/* windows */
#define sAttributesViewer_ _(@"Attributes Viewer - %@")
#define sSmartFolderEditor_ _(@"Smart Folder Editor -%@")
#define sSummaryViewer_ _(@"Summary Viewer - %@")

/* CriterionView */
#define CriterionAllSubject _(@"All")

#define CriterionContainsVerbString _(@"contains")
#define CriterionDoesNotContainVerbString _(@"does not contain")
#define CriterionIsVerbString _(@"is")
#define CriterionIsNotVerbString _(@"is not")
#define CriterionStartsWithVerbString _(@"starts with")
#define CriterionEndsWithVerbString _(@"ends with")
#define CriterionMatchRegularExpressionVerbString _(@"matches regular expression")
#define CriterionIsAfterVerbString _(@"is after")
#define CriterionIsBeforeVerbString _(@"is before")
#define CriterionIsInTheLastVerbString _(@"is in the last")
#define CriterionIsNotInTheLastVerbString _(@"is not in the last")
#define CriterionIsInTheRangeVerbString _(@"is in the range")
#define CriterionIsGreaterThanVerbString _(@"is greater than")
#define CriterionIsLessThanVerbString _(@"is less than")

/* CriterionObjectView */
#define sCriterionSecondUnit _(@"Seconds")
#define sCriterionMinuteUnit _(@"Minutes")
#define sCriterionHourUnit _(@"Hours")
#define sCriterionDayUnit _(@"Days")
#define sCriterionWeekUnit _(@"Weeks")
#define sCriterionMonthUnit _(@"Months")
#define sCriterionYearUnit _(@"Years")

#define sTo _(@"to")

/* Summary */
#define sBriefSummary _(@"Brief Summary")
#define sRegularSummary _(@"Summary")
#define sCompleteSummary _(@"Complete Summary")

/* Menus for validation */
#define sRemoveMenu _(@"Remove...")
#define sEditSmartFolderMenu _(@"Edit Smart Folder")
#define sIndexingMenu _(@"Indexing...")

#endif /* __Constants__ */
