PageRenderTime 36ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/mozilla/mozilla/dist/include/widget/nsIFilePicker.h

http://kmbrasil.codeplex.com
C++ Header | 343 lines | 177 code | 63 blank | 103 comment | 0 complexity | f5fbad03a8224bd25513584f396bb8e2 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/widget/public/nsIFilePicker.idl
  3. */
  4. #ifndef __gen_nsIFilePicker_h__
  5. #define __gen_nsIFilePicker_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsILocalFile; /* forward declaration */
  14. class nsIFileURL; /* forward declaration */
  15. class nsIDOMWindow; /* forward declaration */
  16. class nsISimpleEnumerator; /* forward declaration */
  17. /* starting interface: nsIFilePicker */
  18. #define NS_IFILEPICKER_IID_STR "80faf095-c807-4558-a2cc-185ed70754ea"
  19. #define NS_IFILEPICKER_IID \
  20. {0x80faf095, 0xc807, 0x4558, \
  21. { 0xa2, 0xcc, 0x18, 0x5e, 0xd7, 0x07, 0x54, 0xea }}
  22. class NS_NO_VTABLE nsIFilePicker : public nsISupports {
  23. public:
  24. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEPICKER_IID)
  25. enum { modeOpen = 0 };
  26. enum { modeSave = 1 };
  27. enum { modeGetFolder = 2 };
  28. enum { modeOpenMultiple = 3 };
  29. enum { returnOK = 0 };
  30. enum { returnCancel = 1 };
  31. enum { returnReplace = 2 };
  32. enum { filterAll = 1 };
  33. enum { filterHTML = 2 };
  34. enum { filterText = 4 };
  35. enum { filterImages = 8 };
  36. enum { filterXML = 16 };
  37. enum { filterXUL = 32 };
  38. enum { filterApps = 64 };
  39. /**
  40. * Initialize the file picker widget. The file picker is not valid until this
  41. * method is called.
  42. *
  43. * @param parent nsIDOMWindow parent. This dialog will be dependent
  44. * on this parent. parent must be non-null.
  45. * @param title The title for the file widget
  46. * @param mode load, save, or get folder
  47. *
  48. */
  49. /* void init (in nsIDOMWindow parent, in AString title, in short mode); */
  50. NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) = 0;
  51. /**
  52. * Append to the filter list with things from the predefined list
  53. *
  54. * @param filters mask of filters i.e. (filterAll | filterHTML)
  55. *
  56. */
  57. /* void appendFilters (in long filterMask); */
  58. NS_IMETHOD AppendFilters(PRInt32 filterMask) = 0;
  59. /**
  60. * Add a filter
  61. *
  62. * @param title name of the filter
  63. * @param filter extensions to filter -- semicolon and space separated
  64. *
  65. */
  66. /* void appendFilter (in AString title, in AString filter); */
  67. NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) = 0;
  68. /**
  69. * The filename that should be suggested to the user as a default.
  70. *
  71. * @throws NS_ERROR_FAILURE on attempts to get
  72. */
  73. /* attribute AString defaultString; */
  74. NS_IMETHOD GetDefaultString(nsAString & aDefaultString) = 0;
  75. NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) = 0;
  76. /**
  77. * The extension that should be associated with files of the type we
  78. * want to work with. On some platforms, this extension will be
  79. * automatically appended to filenames the user enters, if needed.
  80. */
  81. /* attribute AString defaultExtension; */
  82. NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) = 0;
  83. NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) = 0;
  84. /**
  85. * The filter which is currently selected in the File Picker dialog
  86. *
  87. * @return Returns the index (0 based) of the selected filter in the filter list.
  88. */
  89. /* attribute long filterIndex; */
  90. NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) = 0;
  91. NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) = 0;
  92. /**
  93. * Set the directory that the file open/save dialog initially displays
  94. *
  95. * @param displayDirectory the name of the directory
  96. *
  97. */
  98. /* attribute nsILocalFile displayDirectory; */
  99. NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) = 0;
  100. NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) = 0;
  101. /**
  102. * Get the nsILocalFile for the file or directory.
  103. *
  104. * @return Returns the file currently selected
  105. */
  106. /* readonly attribute nsILocalFile file; */
  107. NS_IMETHOD GetFile(nsILocalFile * *aFile) = 0;
  108. /**
  109. * Get the nsIFileURL for the file or directory.
  110. *
  111. * @return Returns the file currently selected
  112. */
  113. /* readonly attribute nsIFileURL fileURL; */
  114. NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) = 0;
  115. /**
  116. * Get the enumerator for the selected files
  117. * only works in the modeOpenMultiple mode
  118. *
  119. * @return Returns the files currently selected
  120. */
  121. /* readonly attribute nsISimpleEnumerator files; */
  122. NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) = 0;
  123. /**
  124. * Show File Dialog. The dialog is displayed modally.
  125. *
  126. * @return returnOK if the user selects OK, returnCancel if the user selects cancel
  127. *
  128. */
  129. /* short show (); */
  130. NS_IMETHOD Show(PRInt16 *_retval) = 0;
  131. };
  132. /* Use this macro when declaring classes that implement this interface. */
  133. #define NS_DECL_NSIFILEPICKER \
  134. NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode); \
  135. NS_IMETHOD AppendFilters(PRInt32 filterMask); \
  136. NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter); \
  137. NS_IMETHOD GetDefaultString(nsAString & aDefaultString); \
  138. NS_IMETHOD SetDefaultString(const nsAString & aDefaultString); \
  139. NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension); \
  140. NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension); \
  141. NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex); \
  142. NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex); \
  143. NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory); \
  144. NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory); \
  145. NS_IMETHOD GetFile(nsILocalFile * *aFile); \
  146. NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL); \
  147. NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles); \
  148. NS_IMETHOD Show(PRInt16 *_retval);
  149. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  150. #define NS_FORWARD_NSIFILEPICKER(_to) \
  151. NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) { return _to Init(parent, title, mode); } \
  152. NS_IMETHOD AppendFilters(PRInt32 filterMask) { return _to AppendFilters(filterMask); } \
  153. NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) { return _to AppendFilter(title, filter); } \
  154. NS_IMETHOD GetDefaultString(nsAString & aDefaultString) { return _to GetDefaultString(aDefaultString); } \
  155. NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) { return _to SetDefaultString(aDefaultString); } \
  156. NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) { return _to GetDefaultExtension(aDefaultExtension); } \
  157. NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) { return _to SetDefaultExtension(aDefaultExtension); } \
  158. NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) { return _to GetFilterIndex(aFilterIndex); } \
  159. NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) { return _to SetFilterIndex(aFilterIndex); } \
  160. NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) { return _to GetDisplayDirectory(aDisplayDirectory); } \
  161. NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) { return _to SetDisplayDirectory(aDisplayDirectory); } \
  162. NS_IMETHOD GetFile(nsILocalFile * *aFile) { return _to GetFile(aFile); } \
  163. NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) { return _to GetFileURL(aFileURL); } \
  164. NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) { return _to GetFiles(aFiles); } \
  165. NS_IMETHOD Show(PRInt16 *_retval) { return _to Show(_retval); }
  166. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  167. #define NS_FORWARD_SAFE_NSIFILEPICKER(_to) \
  168. NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(parent, title, mode); } \
  169. NS_IMETHOD AppendFilters(PRInt32 filterMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendFilters(filterMask); } \
  170. NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendFilter(title, filter); } \
  171. NS_IMETHOD GetDefaultString(nsAString & aDefaultString) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultString(aDefaultString); } \
  172. NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultString(aDefaultString); } \
  173. NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultExtension(aDefaultExtension); } \
  174. NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultExtension(aDefaultExtension); } \
  175. NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilterIndex(aFilterIndex); } \
  176. NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilterIndex(aFilterIndex); } \
  177. NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDisplayDirectory(aDisplayDirectory); } \
  178. NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDisplayDirectory(aDisplayDirectory); } \
  179. NS_IMETHOD GetFile(nsILocalFile * *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(aFile); } \
  180. NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileURL(aFileURL); } \
  181. NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFiles(aFiles); } \
  182. NS_IMETHOD Show(PRInt16 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Show(_retval); }
  183. #if 0
  184. /* Use the code below as a template for the implementation class for this interface. */
  185. /* Header file */
  186. class nsFilePicker : public nsIFilePicker
  187. {
  188. public:
  189. NS_DECL_ISUPPORTS
  190. NS_DECL_NSIFILEPICKER
  191. nsFilePicker();
  192. private:
  193. ~nsFilePicker();
  194. protected:
  195. /* additional members */
  196. };
  197. /* Implementation file */
  198. NS_IMPL_ISUPPORTS1(nsFilePicker, nsIFilePicker)
  199. nsFilePicker::nsFilePicker()
  200. {
  201. /* member initializers and constructor code */
  202. }
  203. nsFilePicker::~nsFilePicker()
  204. {
  205. /* destructor code */
  206. }
  207. /* void init (in nsIDOMWindow parent, in AString title, in short mode); */
  208. NS_IMETHODIMP nsFilePicker::Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode)
  209. {
  210. return NS_ERROR_NOT_IMPLEMENTED;
  211. }
  212. /* void appendFilters (in long filterMask); */
  213. NS_IMETHODIMP nsFilePicker::AppendFilters(PRInt32 filterMask)
  214. {
  215. return NS_ERROR_NOT_IMPLEMENTED;
  216. }
  217. /* void appendFilter (in AString title, in AString filter); */
  218. NS_IMETHODIMP nsFilePicker::AppendFilter(const nsAString & title, const nsAString & filter)
  219. {
  220. return NS_ERROR_NOT_IMPLEMENTED;
  221. }
  222. /* attribute AString defaultString; */
  223. NS_IMETHODIMP nsFilePicker::GetDefaultString(nsAString & aDefaultString)
  224. {
  225. return NS_ERROR_NOT_IMPLEMENTED;
  226. }
  227. NS_IMETHODIMP nsFilePicker::SetDefaultString(const nsAString & aDefaultString)
  228. {
  229. return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231. /* attribute AString defaultExtension; */
  232. NS_IMETHODIMP nsFilePicker::GetDefaultExtension(nsAString & aDefaultExtension)
  233. {
  234. return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236. NS_IMETHODIMP nsFilePicker::SetDefaultExtension(const nsAString & aDefaultExtension)
  237. {
  238. return NS_ERROR_NOT_IMPLEMENTED;
  239. }
  240. /* attribute long filterIndex; */
  241. NS_IMETHODIMP nsFilePicker::GetFilterIndex(PRInt32 *aFilterIndex)
  242. {
  243. return NS_ERROR_NOT_IMPLEMENTED;
  244. }
  245. NS_IMETHODIMP nsFilePicker::SetFilterIndex(PRInt32 aFilterIndex)
  246. {
  247. return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249. /* attribute nsILocalFile displayDirectory; */
  250. NS_IMETHODIMP nsFilePicker::GetDisplayDirectory(nsILocalFile * *aDisplayDirectory)
  251. {
  252. return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254. NS_IMETHODIMP nsFilePicker::SetDisplayDirectory(nsILocalFile * aDisplayDirectory)
  255. {
  256. return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. /* readonly attribute nsILocalFile file; */
  259. NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile * *aFile)
  260. {
  261. return NS_ERROR_NOT_IMPLEMENTED;
  262. }
  263. /* readonly attribute nsIFileURL fileURL; */
  264. NS_IMETHODIMP nsFilePicker::GetFileURL(nsIFileURL * *aFileURL)
  265. {
  266. return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268. /* readonly attribute nsISimpleEnumerator files; */
  269. NS_IMETHODIMP nsFilePicker::GetFiles(nsISimpleEnumerator * *aFiles)
  270. {
  271. return NS_ERROR_NOT_IMPLEMENTED;
  272. }
  273. /* short show (); */
  274. NS_IMETHODIMP nsFilePicker::Show(PRInt16 *_retval)
  275. {
  276. return NS_ERROR_NOT_IMPLEMENTED;
  277. }
  278. /* End of implementation class template. */
  279. #endif
  280. #endif /* __gen_nsIFilePicker_h__ */