PrefabSelector.h

Go to the documentation of this file.
00001 
00005 /*
00006  Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008  This program is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU General Public License
00010  as published by the Free Software Foundation; either version 2
00011  of the License, or (at your option) any later version.
00012 
00013  This program is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017  See the GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with this program; if not, write to the Free Software
00021  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023  */
00024 
00025 #ifndef PREFABS_H_
00026 #define PREFABS_H_
00027 
00028 #include <gtk/gtk.h>
00029 #include <string>
00030 
00031 namespace sidebar
00032 {
00033 
00034     class PrefabSelector
00035     {
00036         private:
00037 
00038             GtkWidget* _widget;
00039 
00040             GtkTreeStore* _store;
00041 
00042             GtkTreeModel* _fileFiltered;
00043 
00044             GtkTreeModel* _fileSorted;
00045 
00046             GtkTreeView* _view;
00047 
00048             GtkEntry* _filterEntry;
00049 
00050             int _selectedSelectionStrategy;
00051 
00052         private:
00053 
00054             // Private constructor, creates GTK widgets
00055             PrefabSelector ();
00056 
00057             /* GTK CALLBACKS */
00058             static gboolean callbackFilterFiles (GtkTreeModel *model, GtkTreeIter *iter, PrefabSelector *self);
00059             static gboolean callbackRefilter (PrefabSelector *self);
00060             static void callbackSelectionOptionToggleExtend (GtkWidget *widget, PrefabSelector *self);
00061             static void callbackSelectionOptionToggleReplace (GtkWidget *widget, PrefabSelector *self);
00062             static void callbackSelectionOptionToggleUnselect (GtkWidget *widget, PrefabSelector *self);
00063             static gint callbackButtonPress (GtkWidget *widget, GdkEventButton *event, PrefabSelector *self);
00064 
00065             /* GTK CALLBACK HELPER FUNCTIONS */
00066             static gboolean FilterFileOrDirectory (GtkTreeModel *model, GtkTreeIter *entry, PrefabSelector *self);
00067             static gboolean FilterDirectory (GtkTreeModel *model, GtkTreeIter *possibleDirectory, PrefabSelector *self);
00068         public:
00069 
00070             static std::string GetFullPath (const std::string& file);
00071 
00072             static GtkWidget* ConstructNotebookTab (void);
00073 
00074             GtkWidget* getWidget ();
00075     };
00076 }
00077 
00078 #endif

Generated by  doxygen 1.6.2