DB Namespace Reference

The core database classes. More...


Classes

class  AndCategoryMatcher
class  Category
class  CategoryCollection
class  CategoryItem
class  CategoryMatcher
 Base class for components of the image searching frame work. More...
class  ContainerCategoryMatcher
class  FileInfo
class  GpsCoordinates
class  GroupCounter
 Utility class to help counting matches for member groups. More...
class  ImageDate
class  ImageCount
class  ImageDateCollection
class  ImageDB
class  ImageInfo
class  ImageInfoList
class  ImageSearchInfo
class  MD5
class  MD5Map
class  MediaCount
class  MemberMap
class  NewImageFinder
class  NoOtherItemsCategoryMatcher
class  OrCategoryMatcher
class  RawId
class  Result
class  ResultId
class  SimpleCategoryMatcher
class  ValueCategoryMatcher
class  IdNameMapper

Typedefs

typedef KSharedPtr< CategoryItemCategoryItemPtr
typedef KSharedPtr< CategoryCategoryPtr
typedef unsigned int StackID
typedef QList< ImageInfoPtr >
::Iterator 
ImageInfoListIterator
typedef QList< ImageInfoPtr >
::ConstIterator 
ImageInfoListConstIterator
typedef KSharedPtr< ImageInfoImageInfoPtr

Enumerations

enum  EXIFMODE_FLAG {
  EXIFMODE_DATE = 0x01, EXIFMODE_ORIENTATION = 0x02, EXIFMODE_DESCRIPTION = 0x04, EXIFMODE_FORCE = 0x08,
  EXIFMODE_USE_IMAGE_DATE_IF_INVALID_EXIF_DATE = 0x10, EXIFMODE_DATABASE_UPDATE = 0x20, EXIFMODE_INIT = EXIFMODE_DATE | EXIFMODE_ORIENTATION | EXIFMODE_DESCRIPTION | EXIFMODE_USE_IMAGE_DATE_IF_INVALID_EXIF_DATE | EXIFMODE_DATABASE_UPDATE
}
enum  PathType { RelativeToImageRoot, AbsolutePath }
enum  MediaType { Image = 0x01, Video = 0x02 }

Functions

unsigned int qHash (const DB::ResultId &id)

Variables

const MediaType anyMediaType = MediaType(Image | Video)


Detailed Description

The core database classes.

The Database

The database is abstracted using the class ImageDB. This interface is subclasses by XMLDB::Database and SQLDB::Database. You can get to the global instance of the running database using ImageDB::instance.

Image information

All information about an image is stored in the class ImageInfo (file name, category items for the image, its size etc etc). This class is rather heavy, and in the early days of KPA lots of methods was given information about an image or a set of images. To avoid copying the ImageInfo all the time, or to avoid handing pointers around, the type ImageInfoPtr was introduced. This is a smart pointer, which results in ImageInfo's are send around as pointers behind the screen, without the drawback of pointers.

Originally KPhotoAlbum was implemented without the SQL backend in mind, all the information from the database was loaded into memory. All the methods in the ImageDB interface that returned information about an image would return a ImageInfoPtr. This, however, is not very SQL friendly - SQL should not fetch the info from it database before it really is needed.

To fix this problem, the class Result was introduced. It abstracts the result of queries on the ImageDB. A result consist of a list of ResultId, which is the abstraction of a given item in the result. When you need to traverse the items of a result, you must iterate them using the iterator Result::begin returns. Doing it that way allows the SQL backend to fetch items in chunks. To get to the actual image information use ImageDB::info.

Searching/Browsing

When the user searches or browses, a ImageSearchInfo instance is build with information about the current search. This class contains information about all the parts of the search, like date range, category items to match etc.

When the search is to happen, the information about categories are compiled into a structure that can take care of searching for the sub component of the category search (A category search may look like "friends &! Joe".

The structure consist of these classes:

Image Dates

KPhotoAlbum has support for image dates, which are not know with an exact precission - this might be the case for a images taken with a non-digital camera. Therefore all dates in KPhotoAlbum are represented using the class ImageDate, which has a lower and an upper date for the range.

The two classes ImageDateCollection and ImageCount work together to support the date bar in its counting of images. See XMLImageDateCollection::count for a detailed description of this.

Undocumented classes


Typedef Documentation

typedef KSharedPtr<CategoryItem> DB::CategoryItemPtr

typedef KSharedPtr<Category> DB::CategoryPtr

typedef KSharedPtr<ImageInfo> DB::ImageInfoPtr

typedef unsigned int DB::StackID


Enumeration Type Documentation

Enumerator:
EXIFMODE_DATE 
EXIFMODE_ORIENTATION 
EXIFMODE_DESCRIPTION 
EXIFMODE_FORCE 
EXIFMODE_USE_IMAGE_DATE_IF_INVALID_EXIF_DATE 
EXIFMODE_DATABASE_UPDATE 
EXIFMODE_INIT 

Enumerator:
Image 
Video 

Enumerator:
RelativeToImageRoot 
AbsolutePath 


Function Documentation

unsigned int DB::qHash ( const DB::ResultId id  )  [inline]


Variable Documentation

const MediaType DB::anyMediaType = MediaType(Image | Video)


Generated on Sun Jul 19 11:01:17 2009 for KPhotoAlbum by  doxygen 1.5.8