]> Creatis software - creaImageIO.git/blob - src2/creaImageIOGimmick.h
9cd56660bcef50bb7cb325c181180865b88119db
[creaImageIO.git] / src2 / creaImageIOGimmick.h
1 #ifndef __creaImageIOGimmick_h_INCLUDED__
2 #define __creaImageIOGimmick_h_INCLUDED__
3
4 #include <creaImageIOSQLiteTreeHandler.h>
5
6 namespace creaImageIO
7 {
8         /**
9         * \defgroup Controller Controller
10         */
11         /**
12         * \defgroup View View
13         */
14         /**
15         * \defgroup Model Model
16         */
17
18         /**
19         * \ingroup Controller
20         */
21
22   //=======================================================================
23   /// Central controler of the gimmick application
24   class Gimmick
25   {
26   public:
27     /// Ctor
28     Gimmick();
29     /// Dtor
30     ~Gimmick();
31     
32     /// Initialize (read/creates databases, etc.)
33     bool Initialize();
34     
35     /// Finalize (closes databases, etc.)
36     bool Finalize();
37
38     /// Sets level for messages "Gimmick!" 
39     void SetMessageLevel(int level);
40
41     /// Add a file to the local database
42     void AddFileToLocalDatabase(const std::string&);
43     /// Add a dir to the local database
44     void AddDirToLocalDatabase(const std::string&, bool recurse);
45
46     ///
47     void PrintLocalDatabase();
48
49     /// 
50     SQLiteTreeHandler* GetLocalDatabase() { return mLocalDatabase; }
51
52     const SQLiteTreeHandler* GetLocalDatabase() const { return mLocalDatabase; }
53
54     /// 
55     const std::string& GetHomeDirectory();
56     const std::string& GetUserSettingsDirectory();
57     bool CreateUserSettingsDirectory();
58     const std::string& GetLocalDatabasePath();
59
60   private:
61     SQLiteTreeHandler* mLocalDatabase;
62  
63     std::string mCurrentDirectory;
64     std::string mHomeDirectory;
65     std::string mUserSettingsDirectory;
66     std::string mLocalDatabasePath;
67     
68   };
69   // EO class Gimmick
70   //=======================================================================
71
72
73 } // EO namespace creaImageIO
74
75 // EOF
76 #endif  
77
78