ctb/include/db.h

Go to the documentation of this file.
00001 #ifndef __DB_H__
00002 #define __DB_H__
00003 
00004 /**
00005  * File Name  : db.h
00006  *
00007  * Description: Content browser metadb interface
00008  */
00009 
00010 /*
00011  * This file is part of ctb.
00012  *
00013  * ctb is free software: you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation, either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * ctb is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00025  */
00026 
00027 /**
00028  * Copyright (C) 2009 iRex Technologies B.V.
00029  * All rights reserved.
00030  */
00031 
00032 #include <gtk/gtk.h>
00033 #include <libermetadb/ermetadb.h>
00034 #include "filemodel.h"
00035 
00036 // columns in database table file_metadata
00037 //   index in MDB_COLUMN_NAMES
00038 typedef enum
00039         {
00040             COL_FILENAME = 0,
00041             COL_DIRECTORY_PATH,
00042             COL_SORT_PRIORITY,
00043             COL_IS_DIRECTORY,
00044             COL_FILETYPE,
00045             COL_FILESIZE,
00046             COL_FILETIME_MODIFIED,
00047             COL_FILETIME_LASTREAD,
00048             COL_FILETIME_ADDED,
00049             COL_TITLE,
00050             COL_AUTHOR,
00051             COL_THUMB_MINI,
00052             COL_THUMB_SMALL,
00053             COL_THUMB_MEDIUM,
00054             COL_THUMB_LARGE,
00055             N_METADATA_COLUMNS
00056         } mdb_column_idx_t;
00057 
00058 erMetadb get_database();
00059 
00060 void close_database();
00061 
00062 int open_global_database ( const gchar *current_dir );
00063 
00064 int db_query_create( int column1, ... );
00065 
00066 int db_query_execute(int            sort_order,
00067                      gboolean       sort_asc, 
00068                      metadata_table **values,
00069                      const gchar    *tag_filter);
00070 
00071 int db_query_execute_recent(metadata_table **values, int limit);
00072 
00073 int db_query_execute_search_filter(int sort_order,
00074                                 gboolean sort_asc,
00075                                 metadata_table **values,
00076                                 const gchar* search_filter);
00077 
00078 int db_query_execute_path_filter(int sort_order,
00079                      gboolean sort_asc, 
00080                      metadata_table **values,
00081                      const gchar* path_filter,
00082                      gboolean show_filenames);
00083 
00084 int db_query_get_metadata(const gchar* filename,
00085                           const gchar* dirpath,
00086                           metadata_table **values);
00087 
00088 int db_query_update_lastread(const GString *filename, const GString *directory, int value);
00089 
00090 #endif
00091 
Generated by  doxygen 1.6.2-20100208