Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

vdkfilechooser.h

00001 /*
00002  * ===========================
00003  * VDK Visual Develeopment Kit
00004  * Version 2.0.4
00005  * March 2004
00006  * ===========================
00007  *
00008  * Copyright (C) 1998 - 2004  Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024  * 02111-1307, USA.
00025  */
00026 
00027 #ifndef _vdkfc_form_h_
00028 #define _vdkfc_form_h_
00029 #ifdef HAVE_CONFIG_H
00030 #include <config.h>
00031 #endif
00032 #include <vdk/vdk.h>
00033 
00034 typedef VDKArray<VDKString> FileStringArray;
00066 class VDKFileChooser: public VDKForm
00067 {
00068 // gui object declarations
00069 private:
00070 
00071   VDKObject* filechooser;
00072   static void file_activated (GtkFileChooser *filechooser,
00073                            gpointer user_data);
00074   FileStringArray* selections;
00075 public:
00082   VDKFileChooser(VDKForm* owner, FileStringArray* selections, char* title);
00083   virtual ~VDKFileChooser();
00084   /* !
00085      \internal
00086      called internally by constructor
00087   */
00088  private:  void Setup(void);
00089 
00090  protected: VDKBox* mainbox;
00091  protected: VDKBox* fcbox;
00092  protected: VDKSeparator* separator0;
00093  protected: VDKBox* buttonbox;
00094  protected: VDKCustomButton* okButton;
00095  protected: VDKCustomButton* cancelButton;
00096  bool OnokButtonClick(VDKObject* sender);
00097  bool OncancelButtonClick(VDKObject* sender); 
00098 
00099  public:
00100   DECLARE_SIGNAL_MAP(VDKFileChooser);
00101   /*
00102     declaring signal and events
00103     dynamics tables
00104   */
00105   DECLARE_SIGNAL_LIST(VDKFileChooser);
00106   DECLARE_EVENT_LIST(VDKFileChooser);
00107   // declares two static used to initialize
00108   // form display type and initial position
00109   static GtkWindowType VDKFileChooser::DisplayType;
00110   static GtkWindowPosition VDKFileChooser::InitialPosition;
00111   //
00117   void AddFilterPattern(char* name, char* pattern);
00122   void SetDefaultFilter(char* name);
00123   void AddMimeType(char* name, char* mime);
00128   void RemoveFilter(char* name);
00129   // properties
00134   VDKReadWriteValueProp<VDKFileChooser,bool> MultiSelection;
00142   VDKReadWriteValueProp<VDKFileChooser,GtkFileChooserAction> Action;
00143   // properties functors
00144   bool GetMultiSelection() { return gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER(sigwid)); }
00145   void SetMultiSelection(bool ms) {   gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(sigwid),ms); }
00146   GtkFileChooserAction GetAction() { return gtk_file_chooser_get_action(GTK_FILE_CHOOSER(sigwid)); }
00147   void SetAction(GtkFileChooserAction a) { gtk_file_chooser_set_action (GTK_FILE_CHOOSER(sigwid),a); }
00148 };
00149 #endif
00150 // end of file:vdkfc.h

Generated on Sat Sep 3 12:10:19 2005 for vdk 2.4.0 by  doxygen 1.4.4