~ubuntu-branches/ubuntu/karmic/notecase/karmic

« back to all changes in this revision

Viewing changes to src/gui/FileDialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Vijay(Vijay)
  • Date: 2007-06-14 00:13:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070614001348-z9e2vbgtenb9nhoo
Tags: 1.5.6-0ubuntu1
* New Upstream release 
*  The libgnomevfs2-dev is also added to Build-Depends 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
////////////////////////////////////////////////////////////////////////////
2
 
// NoteCase notes manager project <http://notecase.sf.net>
3
 
//
4
 
// This code is licensed under BSD license.See "license.txt" for more details.
5
 
//
6
 
// File: Implements light wrapper around FileChooser GTK API
7
 
////////////////////////////////////////////////////////////////////////////
8
 
 
9
 
#ifndef FILEDIALOG_H__
10
 
#define FILEDIALOG_H__
11
 
 
12
 
#if _MSC_VER > 1000
13
 
#pragma once
14
 
#endif // _MSC_VER > 1000
15
 
 
16
 
#include <gtk/gtk.h>
17
 
 
18
 
//TOFIX multiple file selection support
19
 
/*
20
 
        gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (file_sel), FALSE);
21
 
        gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), TRUE);
22
 
        gtk_file_chooser_get_filenames
23
 
*/
24
 
 
25
 
 
26
 
class FileDialog  
27
 
{
28
 
public:
29
 
        FileDialog(bool bOpen = true, const char *szTitle = NULL, void *pParent = NULL);
30
 
        virtual ~FileDialog();
31
 
 
32
 
        void SetTitle(const char *szText);
33
 
        void SetFilename(const char *szName);
34
 
        void SetDirectory(const char *szPath);
35
 
        void AddFilter(const char *szText, const char *szPtrn);
36
 
        
37
 
        bool IsOpenDialog(){ return m_bOpenDialog; }
38
 
        bool DoModal();
39
 
        void Close();
40
 
 
41
 
        const char *GetFilename();
42
 
        const char *GetCurrentFilterName();
43
 
        const char *GetDirectory(); 
44
 
 
45
 
protected:
46
 
        GtkWidget *m_pDialog;
47
 
        gchar *m_szFile;
48
 
        gchar *m_szDir;
49
 
        bool   m_bOpenDialog;   //open dialog or save dialog
50
 
};
51
 
 
52
 
#endif // FILEDIALOG_H__
 
1
////////////////////////////////////////////////////////////////////////////
 
2
// NoteCase notes manager project <http://notecase.sf.net>
 
3
//
 
4
// This code is licensed under BSD license.See "license.txt" for more details.
 
5
//
 
6
// File: Implements light wrapper around FileChooser GTK API
 
7
////////////////////////////////////////////////////////////////////////////
 
8
 
 
9
#ifndef FILEDIALOG_H__
 
10
#define FILEDIALOG_H__
 
11
 
 
12
#if _MSC_VER > 1000
 
13
#pragma once
 
14
#endif // _MSC_VER > 1000
 
15
 
 
16
#include <gtk/gtk.h>
 
17
 
 
18
//TOFIX add multiple file selection support
 
19
/*
 
20
        gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (file_sel), FALSE);
 
21
        gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), TRUE);
 
22
        gtk_file_chooser_get_filenames
 
23
*/
 
24
 
 
25
 
 
26
class FileDialog  
 
27
{
 
28
public:
 
29
        FileDialog(bool bOpen = true, bool bOnlyFolders = false, bool bExpand = false, const char *szTitle = NULL, void *pParent = NULL);
 
30
        virtual ~FileDialog();
 
31
 
 
32
        void SetTitle(const char *szText);
 
33
        void SetFilename(const char *szName);
 
34
        void SetDirectory(const char *szPath);
 
35
        void AddFilter(const char *szText, const char *szPtrn);
 
36
        
 
37
        bool IsOpenDialog(){ return m_bOpenDialog; }
 
38
        bool DoModal();
 
39
        void Close();
 
40
 
 
41
        const char *GetFilename();
 
42
        const char *GetCurrentFilterName();
 
43
        const char *GetDirectory(); 
 
44
 
 
45
        void ForceFormatExtension();
 
46
 
 
47
protected:
 
48
        GtkWidget *m_pDialog;
 
49
        gchar *m_szFile;
 
50
        gchar *m_szDir;
 
51
        bool   m_bOpenDialog;   //open dialog or save dialog
 
52
 
 
53
        //used only for custom dlg
 
54
        GtkWidget *m_pFileWidget;       
 
55
        GtkWidget *m_pFormatsCombo;
 
56
        GtkWidget *m_pFileNameEntry;
 
57
};
 
58
 
 
59
#endif // FILEDIALOG_H__