/usr/include/vdk2/vdk/vdkfilechooser.h is in libvdk2-dev 2.4.0-5.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | /*
* ===========================
* VDK Visual Develeopment Kit
* Version 2.0.4
* March 2004
* ===========================
*
* Copyright (C) 1998 - 2004 Mario Motta
* Developed by Mario Motta <mmotta@guest.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _vdkfc_form_h_
#define _vdkfc_form_h_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <vdk/vdk.h>
typedef VDKArray<VDKString> FileStringArray;
/*!
\class VDKFileChooser
\brief Provides a wrap for GtkFileChooser widget
\par Usage
\code
#include <vdk/vdkfilechooser.h>
FileStringArray selections;
VDKFileChooser* fc = new VDKFileChooser(this, &selections,"File chooser");
// fc->MultiSelection = true; // comment out for multi selection mode
fc->AddFilterPattern("All files","*");
fc->AddFilterPattern("C sources","*.c");
fc->AddFilterPattern("CC sources","*.cc");
fc->AddFilterPattern("C/CC headers","*.h");
fc->SetDefaultFilter("All files");
fc->ShowModal();
// returns selections array filled with 1 or more filenames pending
// on selection mode (set with MultiSelection property)
if(selections.size() == 1)
{
printf("\nSelected:%s",(char*) selections[0]);
fflush(stdout);
}
else if(selections.size() > 1)
{
for(int t = 0; t < selections.size(); t++)
printf("\nSelected:%s",(char*) selections[t]);
fflush(stdout);
}
\endcode
On return selections will be an empty array if user presses "cancel" button.
*/
class VDKFileChooser: public VDKForm
{
// gui object declarations
private:
VDKObject* filechooser;
static void file_activated (GtkFileChooser *filechooser,
gpointer user_data);
FileStringArray* selections;
public:
/*!
* Constructor
* \param owner
* \param selections a FileStringArray pointer
* \param title window title
*/
VDKFileChooser(VDKForm* owner, FileStringArray* selections, char* title);
virtual ~VDKFileChooser();
/* !
\internal
called internally by constructor
*/
private: void Setup(void);
protected: VDKBox* mainbox;
protected: VDKBox* fcbox;
protected: VDKSeparator* separator0;
protected: VDKBox* buttonbox;
protected: VDKCustomButton* okButton;
protected: VDKCustomButton* cancelButton;
bool OnokButtonClick(VDKObject* sender);
bool OncancelButtonClick(VDKObject* sender);
public:
DECLARE_SIGNAL_MAP(VDKFileChooser);
/*
declaring signal and events
dynamics tables
*/
DECLARE_SIGNAL_LIST(VDKFileChooser);
DECLARE_EVENT_LIST(VDKFileChooser);
// declares two static used to initialize
// form display type and initial position
static GtkWindowType DisplayType;
static GtkWindowPosition InitialPosition;
//
/*!
* Add a filter based on a pattern
* \param name a human readable name
* \param pattern a filter pattern (ie: *.cc")
*/
void AddFilterPattern(char* name, char* pattern);
/*!
* set <name> filter as default
* \param name a human readable name
*/
void SetDefaultFilter(char* name);
void AddMimeType(char* name, char* mime);
/*!
* remove <name> filter from filter's list
* \param name a human readable name
*/
void RemoveFilter(char* name);
// properties
/*!
setting this property to true allow selecting more than one file
(false by default)
*/
VDKReadWriteValueProp<VDKFileChooser,bool> MultiSelection;
/*!
sets file chooser mode, can be one of following:
- GTK_FILE_CHOOSER_ACTION_OPEN Indicates open mode. The file chooser will only let the user pick an existing file. (this is the default mode)
- GTK_FILE_CHOOSER_ACTION_SAVE Indicates save mode. The file chooser will let the user pick an existing file, or type in a new filename.
- GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER Indicates an Open mode for selecting folders. The file chooser will let the user pick an existing folder.
- GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER Indicates a mode for creating a new folder. The file chooser will let the user name an existing or new folder.
*/
VDKReadWriteValueProp<VDKFileChooser,GtkFileChooserAction> Action;
// properties functors
bool GetMultiSelection() { return gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER(sigwid)); }
void SetMultiSelection(bool ms) { gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(sigwid),ms); }
GtkFileChooserAction GetAction() { return gtk_file_chooser_get_action(GTK_FILE_CHOOSER(sigwid)); }
void SetAction(GtkFileChooserAction a) { gtk_file_chooser_set_action (GTK_FILE_CHOOSER(sigwid),a); }
};
#endif
// end of file:vdkfc.h
|