• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List

/www/proggenOrg/dedupe/export/trunk/userinterface/gui/ncurses/implementation.h

00001 // NCures "Hello World!" program, taken from
00002 // http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/helloworld.html
00003 #include "interface.h"
00004 
00005 #ifndef ORG_PROGGEN_DEDUPE_GUI_NCURSES
00006 #define ORG_PROGGEN_DEDUPE_GUI_NCURSES
00007 
00008 #include "markable.h"
00009 
00010 namespace Dedupe
00011 {
00012   namespace GUI
00013   {
00014     class NCursesControl : public Markable
00015     {
00016       protected:
00017         WINDOW     * Window;
00018 
00019       protected:
00020         NCursesControl( NCursesDialog & dialog, unsigned int x, unsigned int y, unsigned int width, unsigned int height );
00021       public:
00022         virtual ~NCursesControl() {}
00023     };
00024 
00025     class NCursesButton : public NCursesControl
00026     {
00027       private:
00028         char const * Text;
00029 
00030         void RefreshText();
00031       protected:
00032         void RefreshMark();
00033       public:
00034         NCursesButton( NCursesDialog & dialog, unsigned int x, unsigned int y, unsigned int width, char const * text );
00035         void SetText( char const * text );
00036         virtual ~NCursesButton();
00037     };
00038 
00039     class NCursesListView : public NCursesControl
00040     {
00041       public:
00042         NCursesListView( NCursesDialog & dialog, unsigned int x, unsigned int y, unsigned int width, unsigned int height );
00043         virtual ~NCursesListView() {}
00044 
00045       protected:
00046         void RefreshMark();
00047 
00048     };
00049 
00050     class NCursesMain : public Main,
00051                         public NCursesDialog
00052     {
00053       NCursesButton *Index, *Results, *Trashcan;
00054       NCursesListView *fileBrowser, *selectedFiles;
00055 
00056 
00057       public:
00058         static int const DefaultColorPair = 1;
00059         static int const MarkedColorPair = 2;
00060 
00061         NCursesMain( int argc, char *argv[] );
00062         ~NCursesMain();
00063 
00064         /* Interface */
00065         virtual void TrackFile( const Dedupe::FileInfo & file );
00066         virtual void UntrackFile( const Dedupe::FileInfo & file );
00067         virtual void ClearTrackedFiles();
00068         virtual bool IsRecursive();
00069 
00070         virtual int exec();
00071 
00072       protected:
00073         std::vector<Dedupe::FileInfo> GetFiles() { }
00074         std::vector<Dedupe::FileInfo> GetSelectedTrackedFiles() { }
00075     };
00076   }
00077 }
00078 
00079 #endif

Generated on Mon Mar 11 2013 12:04:52 for Dedupe by  doxygen 1.7.1