vdk 2.4.0
vdkfilechooser.h
1 /*
2  * ===========================
3  * VDK Visual Develeopment Kit
4  * Version 2.0.4
5  * March 2004
6  * ===========================
7  *
8  * Copyright (C) 1998 - 2004 Mario Motta
9  * Developed by Mario Motta <mmotta@guest.net>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  * 02111-1307, USA.
25  */
26 
27 #ifndef _vdkfc_form_h_
28 #define _vdkfc_form_h_
29 #ifdef HAVE_CONFIG_H
30 #include <config.h>
31 #endif
32 #include <vdk/vdk.h>
33 
66 class VDKFileChooser: public VDKForm
67 {
68 // gui object declarations
69 private:
70 
71  VDKObject* filechooser;
72  static void file_activated (GtkFileChooser *filechooser,
73  gpointer user_data);
74  FileStringArray* selections;
75 public:
82  VDKFileChooser(VDKForm* owner, FileStringArray* selections, char* title);
83  virtual ~VDKFileChooser();
84  /* !
85  \internal
86  called internally by constructor
87  */
88  private: void Setup(void);
89 
90  protected: VDKBox* mainbox;
91  protected: VDKBox* fcbox;
92  protected: VDKSeparator* separator0;
93  protected: VDKBox* buttonbox;
94  protected: VDKCustomButton* okButton;
95  protected: VDKCustomButton* cancelButton;
96  bool OnokButtonClick(VDKObject* sender);
97  bool OncancelButtonClick(VDKObject* sender);
98 
99  public:
100  DECLARE_SIGNAL_MAP(VDKFileChooser);
101  /*
102  declaring signal and events
103  dynamics tables
104  */
105  DECLARE_SIGNAL_LIST(VDKFileChooser);
106  DECLARE_EVENT_LIST(VDKFileChooser);
107  // declares two static used to initialize
108  // form display type and initial position
109  static GtkWindowType DisplayType;
110  static GtkWindowPosition InitialPosition;
111  //
117  void AddFilterPattern(char* name, char* pattern);
122  void SetDefaultFilter(char* name);
123  void AddMimeType(char* name, char* mime);
128  void RemoveFilter(char* name);
129  // properties
134  VDKReadWriteValueProp<VDKFileChooser,bool> MultiSelection;
142  VDKReadWriteValueProp<VDKFileChooser,GtkFileChooserAction> Action;
143  // properties functors
144  bool GetMultiSelection() { return gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER(sigwid)); }
145  void SetMultiSelection(bool ms) { gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(sigwid),ms); }
146  GtkFileChooserAction GetAction() { return gtk_file_chooser_get_action(GTK_FILE_CHOOSER(sigwid)); }
147  void SetAction(GtkFileChooserAction a) { gtk_file_chooser_set_action (GTK_FILE_CHOOSER(sigwid),a); }
148 };
149 #endif
150 // end of file:vdkfc.h